Topics

Location /api/apps/{appID}/things/{thingID}/topics
This resource represents a list of all topics created in an application, user, group or thing. Topics are channels created to send messages. A user or thing has to be subscribed to a topic to receive a message from it.

Request Headers (Applies to all methods)

Authorization
header
Required: Yes

GET

/api/apps/{appID}/things/{thingID}/topics

Description

Obtain the list of the available topics in the application, user, group or thing being accessed

Security

Can be performed with administrator, user and thing credentials. In case of user/thing credentials only will be recovered the topics the user/thing has permission to subscribe. Anonymous access is not allowed.

Content-Type application/json

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
Params
Name Required? Type Description
paginationKey No string The pagination key to request for more results.
Responses
200

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

The list of topics has been retrieved successfully.
Contents
Name Type Description
topics TopicRetrievalResponse
topicID string The ID of the topic
paginationKey string The key to request for next page of topics. If not provided there are not more topics to retrieve.
404

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

Happens when accessing a topic from a thing and the thing is not found.
Contents
Name Type Description
errorCode string Error code "THING_NOT_FOUND".
message string The error message.
field string The field used for searching the thing. This can be the "thingID" or "vendorThingID" field.
value string The field value used for searching the thing.
appID string The ID of the application.
401

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

Not authorized to retrieve the list of topics.
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).