API Set Judging Assignments

From zFairs Contest Management
Revision as of 15:12, 12 December 2020 by Trent (talk | contribs) (Created page with "== Upload loading Judging Assignments == You can use our api to upload your judging assignments. To do this you need to POST a message to your site. Below is an example of wha...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Upload loading Judging Assignments

You can use our api to upload your judging assignments. To do this you need to POST a message to your site. Below is an example of what needs to be posted. You can get round Id from the get info api call, judge id, and project key are returned when a judge or project is added.

fetch('/api/data/JudgingAssignments', {
    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: {
				RoundId: 123,
				Assignments:[{
					ProjectKey: 'e381c719-d7fc-471a-b50c-fe51747652e4',
					JudgeId: '674907d1-60db-443b-b3c9-4755564c94a9',
					At: '2020-12-31 11:30 am', //optional 
				},
				...
				]
            }
        })
})
.then(response => response.json())
.then(data=>{console.log('Success: ',data);})
.catch((error)=>{console.log('Error: ', error);});
  • Note that all all assignments in this round will be cleared, prior to setting these new assignments.