MQTT endpoint

Location /api/apps/{appID}/installations/{installationID}/mqtt-endpoint
For MQTT installations this resource allows to retrieve the needed information to connect and authorize with a MQTT broker inside the Kii Cloud.

Request Headers (Applies to all methods)

Authorization
header
Required: Yes

GET

/api/apps/{appID}/installations/{installationID}/mqtt-endpoint

Description

Retrieve the information for connecting to an MQTT broker in Kii Cloud.

Security

Can be performed by the administrator and the installation owner.

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
Responses
200

Content-Type application/vnd.kii.MQTTEndpointResponse+json

The information has been retrieved successfully.
Headers
Name Type Description
X-MQTT-TTL int The lifetime of the mqttTopic in seconds. The mqttTopic will expire when its lifetime ends. If this happens, the client needs to request a new MQTT endpont info.
Contents
Name Type Description
installationID string The ID of the installation
username string The username to use for connecting to the MQTT broker.
password string The password to use for connecting to the MQTT broker.
mqttTopic string The topic to subscribe in the MQTT broker.
host string The hostname of the MQTT broker host.
portSSL int The port to connect using SSL/TLS.
portTCP int The port to connect using plain TCP.
X-MQTT-TTL int The lifetime of the mqttTopic in seconds. The mqttTopic will expire when its lifetime ends. If this happens, the client needs to request a new MQTT endpont info.
404

Content-Type application/vnd.kii.InstallationNotFoundException+json

The installation was not found.
Contents
Name Type Description
errorCode string Error code "INSTALLATION_NOT_FOUND".
message string The error message.
installationID string The ID of the installation
appID string The appID of the installation
installationRegistrationID string The registration ID for the installation
deviceType string The type of the installation
404

Content-Type application/vnd.kii.MQTTEndpointNotFoundException+json

The type of the installation was not MQTT.
Contents
Name Type Description
errorCode string Error code "MQTT_ENDPOINT_NOT_FOUND".
message string The error message.
installationID string The ID of the installation
appID string The appID of the installation
installationRegistrationID string The registration ID for the installation
installationType string The type of the installation
401

Content-Type application/vnd.kii.UnauthorizedAccessException+json

Not authorized to retrieve the endpoint information.
Contents
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).
503

Content-Type application/vnd.kii.MQTTEndpointNotReadyException+json

The MQTT endpoint was not ready. The client needs to try again later.
Headers
Name Type Description
Retry-After int The amount of time in seconds that the client needs to wait before retrying to get the MQTT endpoint information.
Contents
Name Type Description
errorCode string Error code "MQTT_ENDPOINT_NOT_READY".
message string The error message.
installationID string The ID of the installation
appID string The appID of the installation
installationRegistrationID string The registration ID for the installation
installationType string The type of the installation
retryAfter int The amount of time in seconds that the client needs to wait before retrying to get the MQTT endpoint information.