Difference between revisions of "API Add Round"
From zFairs Contest Management
Line 25: | Line 25: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | <br/><br/< | + | <br/><br/><br/><br/> |
[[Category: API]] | [[Category: API]] |
Revision as of 10:47, 31 December 2020
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({
Username:'admin username',
Password: 'password',
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);});