...
URL | HTTP Type | Description | ||
---|---|---|---|---|
/competition | POST | Create a new Competition | ||
Code Block | | collapse | true/competition/{competitionId}GET | Get a Competition |
/competition/{competitionId} | PUT | Update a Competition | ||
/competition/{competitionId} | DELETE | Delete a Competition | ||
/competition | GET | Batch Get Competitions (Paginated) | ||
/competition/count | GET | Get the number of Competitions | ||
/competition/name/{name} | GET | Find a Competition by name |
Participant
URL | HTTP Type | Description |
---|---|---|
/competition/{competitionId}/participant | POST | Join as a Participant in a Competition |
/competition/{competitionId}/participant/{principalId} | POST | Add another user as a Participant in a Competition. Requires admin rights on the Competition. |
/competition/{competitionId}/participant/{principalId} | GET | Get a Participant |
/competition/{competitionId}/participant/{principalId} | DELETE | Delete a Participant |
/competition/{competitionId}/participant/ | GET | Batch get Participants for a given Competition (Paginated) |
/competition/{competitionId}/participant/count | GET | Get the number of Participants in a given Competition |
Submission
URL | HTTP Type | Description |
---|---|---|
/competition/submission | POST | Create a new Submission. |
/competition/submission/{submissionId} | GET | Get a Submission |
/competition/submission/{submissionId}/status | GET | Get the status of a Submission |
/competition/submission/{submissionId}/status | PUT | Update the status of a Submission. |
/competition/submission/{submissionId} | DELETE | Delete a Submission. Requires admin rights on the Competition. |
/competition/{compId}/submission | GET | Batch get Submissions for a given Competition (Paginated). |
/competition/{compId}/submission/count | GET | Get the number of Submissions for a given Competition |
cURL Examples
Create a Competition
Code Block curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -H Content-Type:application/json -d '{ "status":"PLANNED", "description":"description", "name":"my first competition", "contentSource":"contentSource" }' https://repo-staging.prod.sagebase.org/repo/v1
...
/competition
...
Get a Competition
Code Block curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json 'https://repo-staging.prod.sagebase.org/repo/v1/competition/
...
1588317'
Update a Competition
Code Block curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -H Content-Type:application/json -X PUT -d '{ "id":"1588317", "createdOn":"2013-01-16T16:30:56.727Z", "etag":"eed22bca-d88e-4b4a-8b1a-35dca7b7b8db", "status":"OPEN", "description":"description", "ownerId":"1588313", "name":"my first competition", "contentSource":"contentSource" }' https://repo-staging.prod.sagebase.org/repo/v1/competition/1588317
...
- Delete a Competition
...
...
- (
...
Participant
...
Join as a Participant in a Competition
...
collapse | true |
---|
- TODO)
Create a Participant
Code Block curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -H Content-Type:application/json -d '{ "ownerId":"123456" }' https://repo-staging.prod.sagebase.org/repo/v1/competition/987654/participant
...
Submission
...
Create a new Submission.
(and corresponding SubmissionStatus object)
Delete a Participant
Code Block curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -X DELETE 'https://repo-staging.sagebase.org/repo/v1/competition/1588317/participant/1588313'
Create a Submission
Code Block curl -i -k -H sessionToken:xxxxxxxxxxxxxxxx -H Accept:application/json -H Content-Type:application/json -d '{ "competitionId":"1588317", "entityId":"1588315", "versionNumber":"1", "name":"some-name" }' https://repo-staging.prod.sagebase.org/repo/v1
...
/competition/submission
...
...
Get the status of a Submission
...
- Update
...
- a
...
- SubmissionStatus
(TODO) - Delete a Submission
(TODO)
Example Workflow
The following is a proposed workflow for interacting with the Competition Services. Please note that some components are still under development.
...