Overview
Set Machine classification request
Set Machine classification response
Error Message
Code sample


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 times period for the predefined case. In case the end time is empty, the application will classify the machine states up to a maximum of the end of the current shift at most or until new calls with end time are entered into the system.


Machine classifications request

Pre steps

  1. Get Token
  2. Get Machines Info
  3. Get Machine Classifications Id

API Method

Method Name
setMachineClassification
URLhttps://developers.3dsignals.io/api/v1/machineClassification
HTTP MethodPOST
Accepted content typesapplication/json
JSON sample

Data Structure

Field nameData TypeField description
machineIdstringThe request machine ID
startTimeepoch timestamp in secondsThe beginning time
endTimeepoch timestamp in seconds The ending time 
reasonIdstringThe request reason ID

Set Machine classification response  

Response code 200 for success.


Error Message

Error codeReason
403- ForbiddenUnauthorized scope request
422- Unprocessable Entity Machine/reason ID not exist
422- Unprocessable EntityStart time > End Time
422- Unprocessable Entity
Future start time
422- Unprocessable EntityMessage without start and end times

Code sample

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)