Machine activity log
Overview
Get machine activity Log request
Get machine activity log response
Error Message
Sample code
Overview
This method returns the machine’s activity data for a specific machine in a specific time frame. The request has the following limitations per each request: Maximum period is 30 days.
limitations
The request has the following limitations per each request: Maximum period allowed (from start to end time) is 30 days.
Get machine activity Log request
Pre steps:
API Method
Method Name | MachineActivityLog |
URL | https://developers.3dsignals.io/api/v1/machineActivity |
HTTP Method | POST |
Accepted content types | application/json |
JSON sample | { |
Data Structure
Field name | Data Type | Field description |
startTime | Integer | start-time in epoch timestamp in seconds |
endTime | Integer | end-time in epoch timestamp in seconds |
machineId | string | request machine ID |
Get Machine activity Log response
Response code 200 will contain a JSON file with a list of the machine’s activities
Field name | Data Type | Field description |
activity | epoch timestamp in seconds | The state start time |
Where each object contains the following fields:
Field name | Data Type | Field description |
startTime | Integer | epoch timestamp in seconds |
endTime | Integer | epoch timestamp in seconds |
machineState | string | “OPERATING”/ ”IDLE”/ “OFF” |
Example of response:
Error Message
Error code | Reason |
403- Forbidden | Unauthorized scope request |
422- Unprocessable Entity | Missing Machine ID |
422- Unprocessable Entity | Start time > End Time |
422- Unprocessable Entity | Request period > Maximum allowed period |
204- No Content | No Data available |
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)