Request Headers (Applies to all methods)
POST
/api/apps/{appID}/installations
Register a new installation.
The owner of the installation is determined by the access token used for requesting the installation:
- If a user token is used, the corresponding user becomes the owner of the installation. Please do not fill in the fields "userID" and "thingID" in the request.
- If a thing token is used, the corresponding thing becomes the owner of the installation. Please do not fill in the fields "userID" and "thingID" in the request.
- If an app administrator token is used, you need to specify the owner of the installation explicitly by filling either the "userID" or "thingID" field in the request.
The "deviceType" specifies the type of the installation. The available types are ANDROID, IOS, JPUSH, and MQTT.
- If you are installing ANDROID, IOS, or JPUSH, you need to provide the "installationRegistrationID". A pair of the "deviceType" and "installationRegistrationID" constitutes a unique key. If you call this method with the already-existing pair of the "deviceType" and "installationRegistrationID", the owner of the installation will be updated on the basis of the access token. Note that the method will not fail if the access token points to the same owner and thus makes no change in the installation owner.
- If you are installing MQTT, you do not need to provide the "installationRegistrationID". The server will generate the ID and return it in the response. If the owner already has an MQTT installation, no new installation will be registered. The server will return the "installationID" and "installationRegistrationID" of the existing installation.
Can be performed with an app administrator, user, and thing token.
Content-Type application/vnd.kii.InstallationCreationRequest+json
All the required data for creating the installation.
{
"installationRegistrationID": "[string]",
"deviceType": "[string]",
"userID": "[string]",
"thingID": "[string]",
"development": "[boolean]"
}
Content-Type application/vnd.kii.InstallationCreationResponse+json
Name | Type | Description |
---|---|---|
Location | string | The URI to the registered installation |
Name | Type | Description |
---|---|---|
InstallationID | string | The ID of the installation in Kii Cloud. |
installationRegistrationID | string | The registrationID that indentifies the installation in the external service. This ID is only provided for the "MQTT" installation. |
Content-Type application/vnd.kii.UserNotFoundException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "USER_NOT_FOUND". |
message | string | The error message. |
field | string | The field used for searching the user. This can be the userID or address field. |
value | string | The field value used for searching the user. |
appID | string | The ID of the application. |
Content-Type application/vnd.kii.ValidationException+json
- A mandatory field was not provided in the request
- "installationRegistrationID" was provided for an "MQTT" installation
- "userID" or "thingID" were provided when using a user or thing token
- Both "userID" and "thingID" were provided when using an app admin or anonymous token
Name | Type | Description |
---|---|---|
errorCode | string | Error code "INVALID_INPUT_DATA". |
message | string | The error message. |
Content-Type application/vnd.kii.UnauthorizedAccessException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "UNAUTHORIZED". |
message | string | The error message. |
authenticatedAppID | string | The authenticated appID. |
authenticatedPrincipalID | string | The authenticated principal ID (userID or thingID). |
GET
/api/apps/{appID}/installations
Retrieve the installations.
If either "userID" or "thingID" is specified, the installations owned by the corresponding user or thing will be retrieved. If neither of them is specified, all installations registered in the application will be retrieved.
- Retrieving the installations of a certain owner can be performed by the owner himself and the administrator.
- Retrieving all installations in the application can be performed only by the administrator.
Content-Type application/json
Content-Type application/vnd.kii.InstallationsRetrievalResponse+json
Name | Type | Description |
---|---|---|
installations | InstallationRetrievalResponse | |
installationID | string | The ID of the installation |
installationRegistrationID | string | The ID of the registration that identifies the device externally. |
deviceType | string | The type of the installation. |
userID | string | The userID of the installation owner. |
thingID | string | The thingID of the installation owner. |
development | boolean | The flag that indicates if the installation is for development or production environment. |
paginationKey | string | The paginationKey for getting the next page of installations (if available). |
Content-Type application/vnd.kii.ValidationException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "INVALID_INPUT_DATA". |
message | string | The error message. |
Content-Type application/vnd.kii.UnauthorizedAccessException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "UNAUTHORIZED". |
message | string | The error message. |
authenticatedAppID | string | The authenticated appID. |
authenticatedPrincipalID | string | The authenticated principal ID (userID or thingID). |