Device Register
裝置註冊,由 IoT Device 進行自我註冊,Device 發出註冊訊息
POST https://{Server Name}/api/Devices/Register
Request method
| Request methods/headers | Value |
|---|---|
| Method | POST |
| Content-Type | application/json |
| Authorization | CCP-ANON-KEY <access_token> |
Headers Authorization: {tenantGuid}:{CCP-KEY}
Headers Authorization
| Name | Description |
|---|---|
| tenantGuid | 請洽系統管理員 |
| CCP-KEY | 請洽系統管理員 |
Request body
{
"guid": "string($uuid)",
"deviceId": "string",
"name": "string",
"deviceType": "string",
"ioTSituation": "Azure",
"productGuid": "string($uuid)"
}
| Name | Required/Optional | Type | Description |
|---|---|---|---|
| guid | Optional | String($uuid) | 裝置的 GUID,可指定或由系統產生 |
| deviceId | Required | String | 該裝置的獨特 ID ,例如:無人機序號、安卓板子序號、 CPU 序號、網卡序號…等 |
| name | Required | String | 管理系統上看到的名稱,名稱不能有空白字元或特殊字元 |
| deviceType | Required | String | 無人機、公播、智慧貨架、投影機…等 |
| ioTSituation | Required | Enum | 使用 IoT 通訊方式,[ Azure, AWS, RabbitMQ ], 預設 Azure |
| productGuid | Optional | String($uuid) | 裝置預設綁定的產品資訊,不指定可註冊後再指定,主要會影響 OTA 與後端系統同步工作 |
Response
| Response headers | Value |
|---|---|
| status | 200: Success 400: Bad request 409: The device has been registered 500: Failure due to server error |
| Content-Type | application/json |
Response body
{
"guid": "string",
"deviceId": "string",
"name": "string",
"tenantGuid": "string",
"secretKey": "string",
"azureIoTHub": {
"deviceId": "string",
"hostName": "string",
"symmetricKey": {
"primaryKey": "string",
"secondaryKey": "string"
},
"azureIoTHubConnectionString": "string"
}
}
| Name | Type | Value description | ||
|---|---|---|---|---|
| guid | GUID | CCP 系統自動產生 | ||
| deviceId | String | 呼叫 API 時提供的 deviceId | ||
| name | String | 呼叫 API 時提供的 name | ||
| tenantGuid | GUID | 呼叫 API 時提供的 tenantGuid | ||
| secretKey | String | 提供給裝置呼叫 CCP Web API 時建立 HMAC Header 的金鑰只註冊時提供,將來都不會再任何一個地方取得,包含 CCP 管理平台 若使用 IoTHub 此金鑰預設使用 symmetricKey primaryKey | ||
| azureIoTHub | deviceId | String | 呼叫 API 時提供的 name | |
| symmetricKey | primaryKey | String | 對稱金鑰,主要金鑰 | |
| secondaryKey | String | 對稱金鑰,次要金鑰 | ||
| azureIoTHubConnectionString | String | Azure IoT Hub 連接字串 | ||
April 22, 2020