Part 3. Cloud API: APP Service APIs

Application Endpoints

Click an API endpoint to expand/collapse its content.
POST/apps
Purpose: Adds a new App. When added, the system will reply a unique ID and key for the App.
Notes
The account registered later will belong to the App.
  • Each App should include an ID and a Key, to identify which App is working when an API is called.
  • It also strictly controls Service authority when using App in the future.
  • The app_id and app_key are unique values, created by API Service Management.
  • APP encryption can be performed for security and data protection.
Request Method
POST
Changelog
Aug 21, 2017 First version
Dec 21, 2017 Second version
Permission
No additional permission needed.
Request Parameters
Need Parameter Type Description
Required app_name String Name of the registered App.
Return Values (JSON)
Fields Type Description
app_id String The unique value of the App generated by the system: app_id.
app_key String The system generates the Key of the App.
When the App calls the API, you must include request headers including app_key and app_id for service authentication.
app_name String Name of the registered App to be confirmed through Response.
app_created_time String The time when the registration succeeds, by using Timestamp (UTC).
Sample Response
Sample response when a request has succeeded:
{
  "app_id": "58819874-ee6a-4c4f-a310-f7bb08b8275b",
  "app_key": "Dd2xUw9S7yjr0oDHHSLQxUw9Syjr0oD9S7yjr0oDHHSLQxU",
  "app_name": "Example Demo App",
  "app_created_time": "1500616342"
}
Unique Error Message of this API
HTTP Status Code Error Message Description
400 SAME_VALUE The same app_name already exists.

▲ Top

PUT/apps/:app_id
Purpose: Updates App information. Must verify that the updated App information belongs to the App.
Request Method
PUT
Changelog
Aug 21, 2017 First version
Dec 21, 2017 Second version
Permission
Must verify that the app_id and app_key of the Header belongs to the App (compared with app_id of Path) to continually update the App information.
Request Parameters
Need Parameter Type Description
Required api_id String api_id to be updated.
Required app_name String App name to be updated.
For example: Baby Monitor
Return Values (JSON)
Fields Type Description
app_id String The updated ID number of the App.
app_name String The updated App name.
app_updated_time String The time when the update is completed, by using Timestamp (UTC).
Sample Response
Sample response when a request has succeeded:
{
  "app_id": "58819874-ee6a-4c4f-a310-f7bb08b8275b",
  "app_name": "Baby Monitor",
  "app_updated_time": "1500617357"
}
Unique Error Message of this API
HTTP Status Code Error Message Description
400 SAME_VALUE The app_name already exists.

▲ Top