Machine classification
Overview
Set Machine classification request
Set Machine classification response
Error Message
Sample code
Overview
This method allows the developer to classify machine states, as ongoing or predefined times.
The desired classification is selected by the key from the list obtained in Get Machine classifications Values
In order to set machine classification, the developer must fill in the reason id, machine id, and time period for the predefined case. In case the end time is empty, the application will classify the machine state up to a maximum of the end of the current shift, or until new calls with end time are entered into the system.
Set machine classifications request
Pre steps
API Method
Method Name | setMachineClassification |
URL | https://developers.3dsignals.io/api/v1/machineClassification |
HTTP Method | POST |
Accepted content types | application/json |
JSON sample |
|
Data Structure
Field name | Data Type | Field description |
machineId | string | The request machine ID |
startTime | epoch timestamp in seconds | The start time for selected reason |
endTime | epoch timestamp in seconds | The end time for selected reason |
reasonId | string | The request reason ID |
Set Machine classification response
Response code 200 for success.
Error Message
Error code | Reason |
403- Forbidden | Unauthorized scope request |
422- Unprocessable Entity | Machine/reason ID not defined |
422- Unprocessable Entity | Start time > End Time |
422- Unprocessable Entity | Future start time |
422- Unprocessable Entity | Request without start and/or end times |
Sample code
Postman
CURL
curl --location --request POST 'https://developers.3dsignals.io/api/v1/machineClassification' \ --header 'Authorization: Bearer YOUR_TOKEN \ --header 'Content-Type: application/json' \ --data-raw '{ "machineId": "string", "startTime": 1614273208, "endTime": 1614273314, "reason": "string" }'
Python
import requests import json url = "https://developers.3dsignals.io/api/v1/machineClassification" payload = json.dumps({ "machineId": "string", "startTime": 1614273208, "endTime": 1614273314, "reason": "string" }) headers = { 'Authorization': 'Bearer Your_Token', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)