Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

Programs

Paul Dorsch edited this page Mar 7, 2019 · 3 revisions

Programs

Get all

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"
           },
            ...
        ]
    }

Get One

Route: /api/program/:id
Method: GET
Parameters:

  • id is 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!",
    }

Create

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"
                   }
    }

Update

Route: /api/program/:id
Method: PUT
Parameters:

  • id is 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"
                   }
    }

Delete

Route: /api/program/:id
Method: DELETE
Parameters:

  • id is the id of the focus item

Empty request body
Example response body:

    {
        status: 'ok'
    }

Clone this wiki locally