Overview
Get machine state request
Get machine state response
Error Message
Code sample


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:

  1. Get Token
  2. Get Machines Info

Method API

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

Code sample

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)