BOCHU IoT Api
  1. Machine Management
BOCHU IoT Api
  • 0. Introduction
  • a. Use our demo to quickly generate request headers
  • b. Manually create the request header
  • 1. Machine Quota
  • 2. API Quota & API Rate Limit
  • Global Error Code
  • Cutting Machine API
    • Machine Management
      • Machine List
        POST
      • Machine Detailed Information
        POST
      • Machine Status Change Records
        POST
    • Real-time Data
      • Machine Operating Status
      • Machine Current Alarm List
      • Machine Ongoing Processing Task
      • Real-time Status of the Cutting System
    • Historical Data
      • Paged Processing Records
    • Statistics Information
      • Summary of Statistical Data for a Period of Time
      • Daily Alarm Duration
      • Daily Piercing Count
      • Daily Idle Time
      • Daily Laser-On Time
      • Daily Gas-On Time
      • Daily Cutting Length
      • Daily Traveling Distance
      • Daily Processing Time v2
    • Task Management
      • Upload Cut Task
  • Welding Machine API
    • Machine Management
      • Machine List
      • Machine Detailed Information
      • Machine Status Change Records
    • Real-time Data
      • Machine Operating Status
    • Historical Data
      • Paged Welding Processing Records
    • Statistics Information
      • Summary of Welding Statistical Data for a Period of Time
      • Daily Flat-Weld Length
      • Daily Flat-Weld Time
      • Daily Vertical-Weld Length
      • Daily Vertical-Weld Time
      • Daily Weld Length
      • Daily Weld Time
      • Daily Weld-Pass Count
      • Daily Idle Time
      • Daily Processing Time
    • Task Management
      • Upload Weld Task
  1. Machine Management

Machine Status Change Records

POST
/api/user_devices/time_periods
Machine Management

Function Introduction#

Used to query the status change records of authenticated machines within a specified time period.

Notes#

cardId ① Needs to be the control card ID of the authenticated machine; ② Needs to be the control card ID within the user device quota.
The difference between startTime and endTime should not exceed one day and must be within the same day.
Only saves records of the machine for the last 100 days.

Request

Header Params
app-id
string 
required
Example:
op188b25734a433a79
time-stamp
string 
required
Example:
1701055999133
app-sign
string 
required
Example:
6829d50c9e68138b109d5ae040d48166
zoneId
string 
optional
The query time-zone can be specified by header 'zoneId'. If 'zoneId' is not set, Asia/Shanghai will be used as default.
The time-zone ID must be from IANA Time Zone Database(TZDB). If 'zoneId' cannot be recognized, Asia/Shanghai will be used as default.
ref: https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html
Example:
America/Chicago
Body Params application/json
cardId
string 
required
Control Card ID
startTime
string 
required
Query Start Time
endTime
string 
required
Query End Time
Example
{
  "cardId": "1234567890",
  "startTime": "2023-11-17 00:00:00",
  "endTime": "2023-11-17 23:59:59"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/user_devices/time_periods' \
--header 'app-id: op188b25734a433a79' \
--header 'time-stamp: 1701055999133' \
--header 'app-sign: 6829d50c9e68138b109d5ae040d48166' \
--header 'zoneId: America/Chicago' \
--header 'Content-Type: application/json' \
--data-raw '{
    "cardId": "1234567890",
    "startTime": "2023-11-17 00:00:00",
    "endTime": "2023-11-17 23:59:59"
}'

Responses

🟢200Success
application/json
Body
status
integer 
required
Status Code
msg
string 
required
Response Message
data
array [object {4}] 
required
time
integer 
required
Duration of Status (in seconds)
timeStart
string 
required
Start Time of Status
timeEnd
string 
required
End Time of Status
status
string 
required
Machine Status; Possible machine statuses: "OFFLINE" (Offline), "IDLE" (Idle), "WORK" (Processing), "PAUSE" (Paused), "ALARM" (Alarm), "PLC" (PLC Execution), "UNKNOWN" (Unknown)
Example
{
  "status": 0,
  "msg": "OK",
  "data": [
    {
      "time": 21600,
      "timeStart": "2023-11-17 00:00:00",
      "timeEnd": "2023-11-17 06:00:00",
      "status": "OFFLINE"
    },
    {
      "time": 21600,
      "timeStart": "2023-11-17 06:00:00",
      "timeEnd": "2023-11-17 12:00:00",
      "status": "IDLE"
    },
    {
      "time": 21600,
      "timeStart": "2023-11-17 12:00:00",
      "timeEnd": "2023-11-17 18:00:00",
      "status": "WORK"
    },
    {
      "time": 3600,
      "timeStart": "2023-11-17 18:00:00",
      "timeEnd": "2023-11-17 19:00:00",
      "status": "PAUSE"
    },
    {
      "time": 3600,
      "timeStart": "2023-11-17 19:00:00",
      "timeEnd": "2023-11-17 20:00:00",
      "status": "ALARM"
    },
    {
      "time": 3600,
      "timeStart": "2023-11-17 20:00:00",
      "timeEnd": "2023-11-17 21:00:00",
      "status": "PLC"
    },
    {
      "time": 10799,
      "timeStart": "2023-11-17 21:00:00",
      "timeEnd": "2023-11-17 23:59:59",
      "status": "UNKNOWN"
    }
  ]
}
Modified at 2024-10-09 01:54:08
Previous
Machine Detailed Information
Next
Machine Operating Status
Built with