Skip to content

Programs

Iván Uresti edited this page Aug 11, 2019 · 1 revision

Program

With the API it is possible create, read, update and delete programs.

To delete a program it must not have batches associated to it.

Add program

Request

  • Method: POST
  • Roles allowed: ADMINISTRATOR
  • URL: https://{{TECHNOVATIONSLP_URL}}/api/program
  • Headers:
    • Authorization. access_token (Bearer)
  • Body: content-type=application/json
{
  "name": "<A name for the program>",
  "description": "<A description for the program>",
  "responsible": "Free fields intended to store names of people in charge"
}

Response

Program created including new id:

{
  "id":"2f07f87e-9572-4c5b-89ca-b6a812888e23",
  "name": "<A name for the program>",
  "description": "<A description for the program>",
  "responsible": "Free fields intended to store names of people in charge"
}

List all programs

Request

  • Method: GET
  • Roles allowed: *
  • URL: https://{{TECHNOVATIONSLP_URL}}/api/program
  • Headers:
    • Authorization. access_token (Bearer)

Response

List of programs with below structure:

[
    {
       "id":"2f07f87e-9572-4c5b-89ca-b6a812888e23",
       "name": "<A name for the program>",
       "description": "<A description for the program>",
       "responsible": "Free fields intended to store names of people in charge"
    }
]

Read a single program

Request

  • Method: GET
  • Roles allowed: *
  • URL: https://{{TECHNOVATIONSLP_URL}}/api/program/
  • Headers:
    • Authorization. access_token (Bearer)

Response

Program or 404(not found):

    {
       "id":"2f07f87e-9572-4c5b-89ca-b6a812888e23",
       "name": "<A name for the program>",
       "description": "<A description for the program>",
       "responsible": "Free fields intended to store names of people in charge"
    }

Update existent program

Request

  • Method: PUT
  • Roles allowed: ADMINISTRATOR
  • URL: https://{{TECHNOVATIONSLP_URL}}/api/program
  • Headers:
    • Authorization. access_token (Bearer)
  • Body: content-type=application/json
{
  "id":"2f07f87e-9572-4c5b-89ca-b6a812888e23",
  "name": "<A name for the program>",
  "description": "<A description for the program>",
  "responsible": "Free fields intended to store names of people in charge"
}

Response

Program updated:

{
  "id":"2f07f87e-9572-4c5b-89ca-b6a812888e23",
  "name": "<A name for the program>",
  "description": "<A description for the program>",
  "responsible": "Free fields intended to store names of people in charge"
}

Read a single program

Request

  • Method: DELETE
  • Roles allowed: ADMINISTRATOR
  • URL: https://{{TECHNOVATIONSLP_URL}}/api/program/
  • Headers:
    • Authorization. access_token (Bearer)

Response

200 (no body) or 404(not found):