This repository was archived by the owner on Jun 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Programs
Paul Dorsch edited this page Mar 7, 2019
·
3 revisions
Route: /api/programs
Method: GET
Empty request body
Example response body:
This will always turn at least an empty array
{
"status": "ok",
"programs": [
{
"name": "Sample Program",
"description": "Providing sample programs",
"type": "website"
},
{
"name": "New Program",
"description": "A new program",
"type": "mobile game"
},
...
]
}Route: /api/program/:id
Method: GET
Parameters:
-
idis the program object id
Example response body:
{
"status": "ok",
"program": {
"name": "Sample Program",
"description": "Providing sample programs",
"type": "website"
}
}Or if there was an error in the program lookup:
{
"status": "error",
"error": err,
"message": "An unexpected internal server error has occurred!",
}Route: /api/program
Method: POST
Example request body
{
"name": "New Program",
"description": "A new program",
"type": "mobile game" // can only be either "mobile game" or "website"
}Example reponse body
{
"status": "ok",
"program": {
"name": "New Program",
"description": "A new program",
"type": "mobile game"
}
}Route: /api/program/:id
Method: PUT
Parameters:
-
idis the program object id
Example request body
All members are optional
{
"name": "New Program",
"description": "A new program with an updated description",
"type": "mobile game" // can only be either "mobile game" or "website"
}Example reponse body
{
"status": "ok",
"program": {
"name": "New Program",
"description": "A new program with an updated description",
"type": "mobile game"
}
}Route: /api/program/:id
Method: DELETE
Parameters:
-
idis the id of the focus item
Empty request body
Example response body:
{
status: 'ok'
}