Operator Skills

A operator is a part of the staff in the operating facility. He has a unique id, and string fields for additional information: name, description and role. skills field is a JSON object that contains the skills of the operator.

Version 1.2.0

New field has been added to the operator skills: user_id that refers to the resource owner (user) in the OAuth Server or any other type of authentication platform.

Operator Skills Scheme

Scheme:

{
  "id": "UUID",
  "name": "String",
  "desc": "String",
  "role": "String",
  "skills": "JSON",
  "user_id": "String"
}

Example operator:

{
  "id": "c228b656-e2b6-42b0-ae51-40e977dabc75",
  "name": "Jimmy Jones",
  "desc": "Good old Jimmy, expert at everything",
  "role": "Team Leader",
  "skills": {
    "machine": 4,
    "tool": 3,
    "computer": 1
  },
  "user_id": "d0e579cb-dcb9-44f6-af95-eb4ca658d1e6"
}

GET methods

GET /api/operator_skills

Returns all operator skills with their relative information if at least one resource exists, otherwise returns an empty collection. Request can contain a page parameter that returns a specific page, additionally total number of pages, next page, previous page and other information are described in the response header.

Example request:

GET /api/operator_skills HTTP/1.1
Host: |localhost|

Example response:

HTTP/1.1 200 OK
Content-type: application/json
X-Total: 2
X-Total-Pages: 1
X-Page: 1
X-Per-Page: 10

[
  {
    "id": "c228b656-e2b6-42b0-ae51-40e977dabc75",
    "name": "Jimmy Jones",
    "desc": "Good old Jimmy, expert at everything",
    "role": "Team Leader",
    "skills": {
      "machine": 4,
      "tool": 3,
      "computer": 1
    },
    "user_id": "d0e579cb-dcb9-44f6-af95-eb4ca658d1e6"
  },
  {
    "id": "07a6c0d7-e264-4576-9338-9eb4ce385490",
    "name": "Johnny Jones",
    "desc": "Good old Jimmy's brother, expert at nothing",
    "role": "Operator",
    "skills": {
      "machine": 2,
      "tool": 2,
      "computer": 4
    },
    "user_id": "19ad1479-8e85-4e5f-901e-dd70a459396e"
  }
]
Query Parameters:
 
  • page (integer) – page number, 10 resources per page are returned, default is 1
  • access_token (string) – valid access token for OAuth2 authentication
Response Headers:
 
  • X-Total – total number of elements in the collection server-side
  • X-Total-Pages – total number of pages containing all elements
  • X-Page – current page that has been returned
  • X-Per-Page – number of elements per page
  • X-Next-Page – id of next page
  • X-Previous-Page – id of previous page
Response JSON Array of Objects:
 
  • id (string) – id of the operator skills resource
  • name (string) – name of the operator to which we refer
  • desc (string) – description of the operator
  • role (string) – role of the operator
  • skills (json) – skills JSON object containing key:value pairs of skills of the operator
  • user_id (string) – unique identified from the OAuth or other authentication server
Status Codes:
GET /api/operator_skills/:id

Returns a specific operator with :id and its parameteres if it exists, otherwise returns 404 error.

Example request:

GET /api/operator_skills/07a6c0d7-e264-4576-9338-9eb4ce385490 HTTP/1.1
Host: |localhost|

Example response:

HTTP/1.1 200 OK
Content-type: application/json

{
  "id": "07a6c0d7-e264-4576-9338-9eb4ce385490",
  "name": "Johnny Jones",
  "desc": "Good old Jimmy's brother, expert at nothing",
  "role": "Operator",
  "skills": {
    "machine": 2,
    "tool": 2,
    "computer": 4
  },
  "user_id": "d0e579cb-dcb9-44f6-af95-eb4ca658d1e6"
}
Parameters:
  • id (string) – operator’s unique id
Query Parameters:
 
  • access_token (string) – valid access token for OAuth2 authentication
Response JSON Object:
 
  • id (string) – id of the operator skills resource
  • name (string) – name of the operator to which we refer
  • desc (string) – description of the operator
  • role (string) – role of the operator
  • skills (json) – skills JSON object containing key:value pairs of skills of the operator
Response JSON Array of Objects:
 
  • user_id (string) – unique identified from the OAuth or other authentication server
Status Codes:

POST methods

POST /api/operator_skills

Adds a new operator skills with its name, description, role and optionals. id is generated server-side. Returns an URI location of the new resource or error message.

Note: Do not execute twice the same POST request for it will create two resources with the same information.

Example request:

POST /api/operator_skills HTTP/1.1
Host: |localhost|
Content-Type: application/json

{
  "name": "Jason Jones",
  "desc": "Third Jones brother, here just for the money",
  "role": "Operator",
  "skills": {}
}

Example response:

HTTP/1.1 201 Created
Content-type: application/json

{
  "id": "5880f2f1-e548-4db5-9ef3-3e23954689f4",
  "name": "Jason Jones",
  "desc": "Third Jones brother, here just for the money",
  "role": "Operator",
  "skills": {},
  "user_id": "d0e579cb-dcb9-44f6-af95-eb4ca658d1e6"
}
Query Parameters:
 
  • access_token (string) – valid access token for OAuth2 authentication
Request JSON Object:
 
  • name (string) – operator’s name
  • desc (string) – operator’s description
  • role (string) – operator’s role
  • skills (json) – operator’s skills
Request JSON Array of Objects:
 
  • user_id (string) – unique identified from the OAuth or other authentication server
Response JSON Object:
 
  • id (string) – id of the operator skills resource
  • name (string) – name of the operator to which we refer
  • desc (string) – description of the operator
  • role (string) – role of the operator
  • skills (json) – skills JSON object containing key:value pairs of skills of the operator
Response JSON Array of Objects:
 
  • user_id (string) – unique identified from the OAuth or other authentication server
Status Codes:

PUT methods

PUT /api/operator_skills/:id

Updates an existing operator skills with new information. Returns an URI location of the new resource or error message.

Note: All parameters must be defined with the PUT request, ie. PUT request replaces the existing resource with the modified one if it exists, or creates a new one.

Example request:

PUT /api/operator_skills/5880f2f1-e548-4db5-9ef3-3e23954689f4 HTTP/1.1
Host: |localhost|
Content-Type: application/json

{
  "name": "Jason Jones",
  "desc": "Third Jones brother, here just for the money",
  "role": "Quality Manager",
  "skills": {
    "machine": 2,
    "tool": 2,
    "computer": 5
  },
  "user_id": "d0e579cb-dcb9-44f6-af95-eb4ca658d1e6"
}

Example response:

HTTP/1.1 200 OK
Content-type: application/json

{
  "id": "5880f2f1-e548-4db5-9ef3-3e23954689f4",
  "name": "Jason Jones",
  "desc": "Third Jones brother, here just for the money",
  "role": "Quality Manager",
  "skills": {
    "machine": 2,
    "tool": 2,
    "computer": 5
  },
  "user_id": "d0e579cb-dcb9-44f6-af95-eb4ca658d1e6"
}
Parameters:
  • id (string) – operator’s unique id
Query Parameters:
 
  • access_token (string) – valid access token for OAuth2 authentication
Request JSON Object:
 
  • name (string) – operator’s name
  • desc (string) – operator’s description
  • role (string) – operator’s role
  • skills (json) – operator’s skills
Request JSON Array of Objects:
 
  • user_id (string) – unique identified from the OAuth or other authentication server
Response JSON Object:
 
  • id (string) – id of the operator skills resource
  • name (string) – name of the operator to which we refer
  • desc (string) – description of the operator
  • role (string) – role of the operator
  • skills (json) – skills JSON object containing key:value pairs of skills of the operator
Response JSON Array of Objects:
 
  • user_id (string) – unique identified from the OAuth or other authentication server
Status Codes:

DELETE methods

DELETE /api/operator_skills/:id

Delete an existing operator, responds with the confirmation or error. Can only delete one resource at a time, to remove a collection of operator call the DELETE method for each element.

Example request:

DELETE /api/operator_skills/5880f2f1-e548-4db5-9ef3-3e23954689f4 HTTP/1.1
Host: |localhost|

Example response:

HTTP/1.1 200 OK
Parameters:
  • id (string) – operator’s unique id
Query Parameters:
 
  • access_token (string) – valid access token for OAuth2 authentication
Status Codes: