API & SDK Documentation

Get Device Status API

Overview

Endpoint

...
GET /api/v1/devices/{device_id}/status
...
    

Authentication

* Requires **Bearer Token** authentication
* Token can be generated via the **OAuth 2.0** flow

**Bearer Token**
Token: **OAuth 2.0**
    

Request Example

...http
GET /api/v1/devices/123456/status HTTP/1.1
Host: api.example.com
Authorization: Bearer 
Content-Type: application/json
    

Response Example

...json
{
  "device_id": "123456",
  "battery_level": 78,
  "is_online": true,
  "last_active": "2025-09-01T12:34:56Z"
}
...
    

Response Parameters

Parameters Type Description
device_id String Unique device ID
battery_level Integer Current battery level (0-100)
is_online Boolean Online status
last_active String Last active time (UTC)

Error Codes

Error Codes Description Solution Description
401 Unauthorized Check if the token has expired or is invalid
404 Device Not Found Confirm whether the device_id is correct
500 Internal Server Error Please try again later or contact technical support

Notes

* This API is **read-only** and does not modify device status
* Frequent requests (e.g., >60 per minute) may trigger rate limiting