Machine Info

Provides the developer with unique machine IDs. The unique IDs have to be used to retrieve/submit information about specific machines.

Machine info request

Pre steps

API Method

Method NamegetMachineInfo
URLhttps://developers.3dsignals.io/api/v1/mahcineInfo
HTTP MethodGET

Machine info response

Provides the developer with unique machine IDs. The unique IDs have to be used to retrieve/submit information Response code 200 will contain a JSON file with a list of the machine objects with the following fields.

Field nameData TypeField description
machineDisplayNameobjectThe machine’s display name in dView
machineUniqueIdstringThe machine’s ID as defined in the 3d Signals cloud
factoryIdstringThe factory ID to which the machine belongs
factoryNamestringFactory Name


Error Message

Error codeReason
403- ForbiddenUnauthorized scope request

Sample Code

Postman

CURL

curl --location --request GET 'https://developers.3dsignals.io/api/v1/MahcineInfo' \
--header 'Authorization: Bearer "YOUR TOKEN" \'

Python

import requests

url = "https://developers.3dsignals.io/api/v1/MahcineInfo"
payload={}
headers = {
  'Authorization': 'Bearer "YOUR TOKEN" \\'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)

Machine status

Overview

This method allows the user to get the current state and state duration of a specific machine by providing the machine Id.

3d Signals provides a continuous machine state, this state is calculated within a one minute interval, hence the current state reflects the state within a range of 1 – 2 minutes.    

Get Machine state request

Pre Steps

  • Get Machine Info

API Method

Method NamegetMachineState
URLhttps://developers.3dsignals.io/api/v1/machineState?machineId={id}
HTTP MethodGET
Query string parametermachineId – as defined by 3d Signals

Get machine state response

Response code 200, contains a JSON file with the current machine state and state start time following fields.

Field nameData TypeField description
machineStatestring“OPERATING”/ ”IDLE”/ “OFF”
durationInMinutesintegerDuration from the beginning of the current state
astUpdateTimetimestamp (sec’)The timestamp of the  latest state update



Error Message

Error codeReason
403- ForbiddenUnauthorized scope request
422- Unprocessable EntityMissing Machine ID
204- No ContentNo Data

Sample Code

Postman

CURL

curl --location --request GET 'https://developers.3dsignals.io/api/v1/machineState?machineId= MACHINE ID \
--header 'Authorization: Bearer "YOUR TOKEN"  '

Python

import requests

url = "https://developers.3dsignals.io/api/v1/machineState?machineId= MACHINE ID "
payload={}
headers = {
  'Authorization': YOUR TOKEN '
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)

Machine activity Log

Overview

This method provides the user with the ability to get the machine’s activity data for specific machines in a time frame.

The request has the following limitations per each request:

The maximum period of 30 days.

Get Machine activity Log request

Pre Steps

  • Get Machine Info

API Method

Method Name
MachineActivityLog
URLhttps://developers.3dsignals.io/api/v1/machineActivity
HTTP MethodPOST
Accepted content typesapplication/json
Data structTBD:: add subTable
JSON sample

Data Structure

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

Get Machine activity Log response

Response code 200 will contain a JSON file with a list of objects with the following fields.

Field nameData TypeField description
startTimeepoch timestamp in secondsThe beginning state time
endTimeepoch timestamp in secondsThe ending state time
machineStatestring“OPERATING”/ ”IDLE”/ “OFF”
durationInMinutesintegerDuration of the current state


Error Message

Error codeReason
403- ForbiddenUnauthorized scope request
422- Unprocessable EntityMissing Machine ID
422- Unprocessable EntityStart time > End Time
422- Unprocessable EntityRequest times > maximum times
204- No ContentNo Data

Sample Code

Postman

CURL

curl --location --request POST 'https://developers.3dsignals.io/api/v1/machineActivity' \
--header 'Authorization: Bearer YOUR TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "startTime":1234,
    "endTime":1234,
    "machineId":"MACHINE_ID"
}'

Python

import requests
import json

url = "https://developers.3dsignals.io/api/v1/machineActivity"
payload = json.dumps({
  "startTime": 1234,
  "endTime": 1234,
  "machineId": "MACHINE ID"
})
headers = {
  'Authorization': 'Bearer TOUR_TOKEN',
  'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Machine classification Values

Overview

Provides the developer with a list of machine states, as a set of unique IDs.The “Query string parameter” code returns the list of reasons per machine, as unique IDs.

Machine classifications values request

Pre steps

  • Get Machine Info

API Method

Method NameMachineClassification
URLhttps://developers.3dsignals.io/api/v1/machineClassifications?machineId={machineId}
HTTP MethodGET
Query string parametemachineId – as defined by 3d Signals

Machine classifications values response

Response code 200 will contain a JSON file with a list of the machines classifications with the following fields.

Field nameData TypeField description
reasonsArray[object]Tuple list of display names and codes for every state
namestringDisplay name if the Reason
codestringreason code



Error Message

Error codeReason
403- ForbiddenUnauthorized scope request
422- Unprocessable EntityMissing Machine ID
404 – Not Foundmachine Id not found
204- No Contentresult list is empty

Sample Code

Postman

CURL

curl --location -g --request POST 'https://developers.3dsignals.io/api/v1/machineClassifications?machineId={machineId}' \
--header 'Authorization: Bearer Your_Token' \
--header 'Content-Type: application/json' \
--data-raw '
'


Python

import requests
import json
url = "https://developers.3dsignals.io/api/v1/machineClassifications?machineId={machineId}"
payload = "\n"
headers = {
  'Authorization': 'Bearer Your_Token',
  'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)



Machine classification

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

  • Get Machine Info
  • Get Machine Classification Values

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

Machine classifications reaponse

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

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)