Members
-
Route:
Method Path POST /api/mission/add Body Parameters:
Name Type Description form formData an html form containing the mission pbo file to be uploaded Header Parameters:
Name Type Description Accept String application/json Content-Type String multipart/form-data Response:
Name Type Description Success JSON full mission json Failed JSON check result Error JSON error message from server Response Code:
Type Description 201 Success: the mission is published 202 Failed: the check reported an error 400 Error: bad request (file size exceeded, incomplete form, etc.) Example
Typical POST request to publish a mission
//header\\ POST /api/mission/add HTTP/1.1 Accept: application/json Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryWmunjnPoLceaU7KM //body\\ ------WebKitFormBoundaryWmunjnPoLceaU7KM Content-Disposition: form-data; name="file"; filename="CPC-CO[25]-WelcomeToTheJungle-V2.pja305.pbo" Content-Type: application/octet-stream //here is the file content ------WebKitFormBoundaryWmunjnPoLceaU7KM--
-
Route:
Method Path POST /api/mission/check Body Parameters:
Name Type Description form formData an html form containing the mission pbo file to be checked Header Parameters:
Name Type Description Accept String application/json Content-Type String multipart/form-data Response:
Name Type Description Success JSON full mission json Failed JSON result of the check Error JSON error message from server Response Code:
Type Description 200 Success: the mission is valid, ready to publish 202 Failed: the check reported an error 400 Error: bad request (file size exceeded, incomplete forme, etc.) Example
Same as /api/mission/add route. Change the api endpoint to /api/mission/check -
Route:
Method Path GET /api/mission/list Header Parameters:
Name Type Description Content-Type String any value accepted in Content-type field (text/html for example) Response:
Name Type Description Success JSON list of all published missions Error JSON error message from server Response Code:
Type Description 200 Success: list of missions successfully returned 400 Error: bad request Example
Typical GET request to obtain the list of published missions
//header\\ GET /api/mission/list HTTP/1.1 content-type: text/html //body\\ //Nothing
-
Route:
Method Path GET /api/mission/show/:missionPbo Header Parameters:
Name Type Description Accept String application/json Route Parameters:
Name Type Description missionPbo String exact name of mission pbo file Response:
Name Type Description Success JSON information about mission Failed JSON result of the check Error JSON error message from server Response Code:
Type Description 200 Success: information about mission returned 400 Error: bad request 404 Error: non-existent pbo in database of published missions Example
Typical GET request to obtain information about a published mission
//header\\ GET /api/mission/show/exact-name-of-pbo-file-of-publisehd-mission.pbo HTTP/1.1 content-type: text/html //body\\ //Nothing
-
Route:
Method Path PUT /api/mission/update/ Header Parameters:
Name Type Description Accept String application/json Route Parameters:
Name Type Description missionPbo String exact name of mission pbo file Response:
Name Type Description Success JSON MissionPbo : new value for updateKey key is updateVal Failed JSON error message Error JSON error message Response Code:
Type Description 200 Success: information about mission returned 202 Fail: update failed 400 Error: bad request 404 Error: pbo not found in database Example
Typical PUT request to obtain information about a published mission
//header\\ PUT /api/mission/update/exact-name-of-puvblished-pbo-file/?field-to-be-updated=new-value HTTP/1.1 content-type: text/html //body\\ //Nothing