About Device APIs¶
Device APIs are the APIs provided by Device Provisioning Service specifically for devices. With Device APIs, devices can directly register themselves and get their authentication information.
The common use cases for Device APIs include:
Devices can use Device APIs to register themselves with EnOS and obtain the authentication information in order to securely connect to EnOS.
Gateway devices that manage multiple sub-devices or branch devices can use Device APIs to obtain EnOS triple authentication information for those devices, enabling the gateway devices to establish connections and facilitate data communication between the sub-devices or branch devices and EnOS.
API Scope of Application¶
The devices suitable for the Device APIs need to meet the following requirements:
Capable of sending POST requests to a specified address using the HTTP/HTTPS protocol.
Able to retrieve valid device registration information for device authentication and self-registration.
API Request¶
The structure of a Device API request consists of 3 parts: Request URI, Request Header, and Request Body, in which the Request Header and Request Body are consistent with Application APIs. The Request URI format for a Device API is as follows:
{URI-scheme}://{dps-address}/{service-name}/{endpoint-URL}
{URI-scheme}
: The protocol, supporting HTTP and HTTPS.{dps-address}
: the IP address of Device APIs, and its format isiot-dps-{ENV_ID}.envisioniot.com
. The{ENV_ID}
represents the environment identifier, e.g.eu2
andus2
.{service-name}
: The service name. The service name of Device APIs isdev
.{endpoint-URL}
: The resources and operations on resources, e.g.get/conn
.
API Response¶
An example of the Device API response in JSON format with its parameters explained is shown below:
{
"pk": "ProductKey",
"dk": "DeviceKey",
"ds": "DeviceSecret"
}
For description of the response parameters, see each API documentation.
Device SDKs¶
You can obtain the device SDKs in EnOS Developer Center to connect your devices to EnOS.