Difference between revisions of "API Add Round"
From zFairs Contest Management
(One intermediate revision by one other user not shown) | |||
Line 8: | Line 8: | ||
headers:{'Content-Type': 'application/json'}, | headers:{'Content-Type': 'application/json'}, | ||
body: JSON.stringify({ | body: JSON.stringify({ | ||
− | + | ApiKey:'<Private key>', | |
− | |||
FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f | FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f | ||
Body: { | Body: { | ||
Line 25: | Line 24: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | <br/><br/< | + | <br/><br/><br/><br/> |
[[Category: API]] | [[Category: API]] |
Latest revision as of 20:48, 10 April 2024
Add Judging Round
You can use our api to add judging Rounds to your contest. To do this you need to POST a message to your site. Below is an example of what needs to be posted.
fetch('/api/data/round', {
method:'POST',
headers:{'Content-Type': 'application/json'},
body: JSON.stringify({
ApiKey:'<Private key>',
FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f
Body: {
RoundName: "Round Name",
RoundValue: 100, //0-100
IsSubRound: false, // false or true
Id: 0 //0 to create a new round, or the round Id to update an existing round
}
})
})
.then(response => response.json())
.then(data=>{console.log('Success: ',data);})
.catch((error)=>{console.log('Error: ', error);});