Register an application
POST /api
Register your application with the gateway to obtain an API credential.
Before sending this request, press the gateway's physical button to open the registration window. Discover the gateway to check that registration is enabled.
Save the username returned in data.obj. You will need it in the application-key header for authenticated requests.
Example request
json
{
"device_type": "bweetech#cwgk4rns"
}Parameters
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
device_type | body | string | Yes | A client identifier of your choice. Use vendorID#deviceID to make clients easier to identify. |
Example response
json
{
"code": 0,
"msg": "success",
"data": {
"arr": [],
"obj": {
"username": "BISyGakszuQEGd4uBM"
}
}
}json
{
"code": -1,
"msg": "link button not pressed"
}Responses
| Status code | Meaning |
|---|---|
| 200 | OK |
Response fields
HTTP 200 OK
| Field | Type | Required | Description |
|---|---|---|---|
code | integer | Yes | 0 on success; a negative value on failure. |
msg | string | Yes | Message |
data | object | No | Response payload. |
data.obj | object | No | Returned resource. |
data.obj.username | string | No | Save this credential for authenticated requests. |