Subscribed thing

Location /api/apps/{appID}/things/{thingID}/topics/{topicID}/push/subscriptions/things/{thingID}
This resource represents a thing as a subscriber to the current topic.

Request Headers (Applies to all methods)

Authorization
header
Required: Yes

PUT

/api/apps/{appID}/things/{thingID}/topics/{topicID}/push/subscriptions/things/{thingID}

Description

Subscribe this thing to the current topic.

Security

Can be performed by the administrator and the thing to subscribe itself.

Note

This request requires empty body.

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
URL Params
Name Required? type Description
thingID Yes string thingID of the subscribed thing
Responses
204

Content-Type (None)

The thing has been subscribed successfully.
Note This response has no contents.
404

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

The thing was 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.
404

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

The topic was not found.
Contents
Name Type Description
errorCode string Error code "TOPIC_NOT_FOUND".
message string The error message.
topicID string The ID of the topic that is not found
objectScope ObjectScope The scope of the topic
appID string The ID of the application.
userID string The ID of the user. Only provided for a user-scope bucket.
groupID string The ID of the group. Only provided for a group-scope bucket.
thingID string The ID of the thing. Only provided for a thing-scope bucket.
type string One of "APP", "APP_AND_USER", "APP_AND_GROUP", or "APP_AND_THING".
409

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

The thing was already subscribed to the topic.
Contents
Name Type Description
errorCode string Error code "PUSH_SUBSCRIPTION_ALREADY_EXISTS".
message string The error message.
topicID string The ID of the topic where the subscription already exists
objectScope ObjectScope The scope of the topic
appID string The ID of the application.
userID string The ID of the user. Only provided for a user-scope bucket.
groupID string The ID of the group. Only provided for a group-scope bucket.
thingID string The ID of the thing. Only provided for a thing-scope bucket.
type string One of "APP", "APP_AND_USER", "APP_AND_GROUP", or "APP_AND_THING".
subject string The subject that is already subscribed to the topic/filter
401

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

Not authorized to access this method.
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).

PUT

/api/apps/{appID}/things/{thingID}/topics/{topicID}/push/subscriptions/things/{thingID}

Description

Subscribe this thing to the current topic with a push configuration.

Security

Can be performed by the administrator and the thing to subscribe itself.

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

The data to configure the parameters for the push messages the thing will receive through this subscription.

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
URL Params
Name Required? type Description
thingID Yes string thingID of the subscribed thing
Params
Name Required? Type Description
pushConfiguration PushConfiguration
gcm GCMConfigurationType
apns APNSConfigurationType
mqtt MQTTConfigurationType
sendAppID boolean Set true or false to send "AppID" field in notifications.
sendSender boolean Set true or false to send "Sender" field in notifications.
sendWhen boolean Set true or false to send "When" field in notifications.
sendObjectScope boolean Set true or false to send "ObjectScope" field in notifications.
sendTopicID boolean Set true or false to send "TopicID" field in notifications.
sendSourceURI boolean Set true or false to send "sourceURI" field in notifications. The value is true by default.
sendSenderURI boolean Set true or false to send "SenderURI" field in notifications. The value is true by default.
sendOrigin boolean Set true or false to send "Origin" field in notifications.
sendBucketID boolean Set true or false to send "BucketID" field in notifications.
sendBucketType boolean Set true or false to send "BucketType" field in notifications.
sendObjectID boolean Set true or false to send "ObjectID" field in notifications.
sendModifiedAt boolean Set true or false to send "ModifiedAt" field in notifications.
sendMessageType boolean Set true or false to send "MessageType" field in notifications.
Sample Request
{
  "pushConfiguration": "[PushConfiguration]"
}
Responses
204

Content-Type (None)

The thing has been subscribed successfully.
Note This response has no contents.
404

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

The thing was 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.
404

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

The topic was not found.
Contents
Name Type Description
errorCode string Error code "TOPIC_NOT_FOUND".
message string The error message.
topicID string The ID of the topic that is not found
objectScope ObjectScope The scope of the topic
appID string The ID of the application.
userID string The ID of the user. Only provided for a user-scope bucket.
groupID string The ID of the group. Only provided for a group-scope bucket.
thingID string The ID of the thing. Only provided for a thing-scope bucket.
type string One of "APP", "APP_AND_USER", "APP_AND_GROUP", or "APP_AND_THING".
409

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

The thing was already subscribed to the topic.
Contents
Name Type Description
errorCode string Error code "PUSH_SUBSCRIPTION_ALREADY_EXISTS".
message string The error message.
topicID string The ID of the topic where the subscription already exists
objectScope ObjectScope The scope of the topic
appID string The ID of the application.
userID string The ID of the user. Only provided for a user-scope bucket.
groupID string The ID of the group. Only provided for a group-scope bucket.
thingID string The ID of the thing. Only provided for a thing-scope bucket.
type string One of "APP", "APP_AND_USER", "APP_AND_GROUP", or "APP_AND_THING".
subject string The subject that is already subscribed to the topic/filter
401

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

Not authorized to access this method.
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).

GET

/api/apps/{appID}/things/{thingID}/topics/{topicID}/push/subscriptions/things/{thingID}

Description

Check if this thing is subscribed to the current topic.

Security

Can be performed by the administrator and the subscribed thing itself.

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
URL Params
Name Required? type Description
thingID Yes string thingID of the subscribed thing
Responses
204

Content-Type (None)

The thing is subscribed to the topic.
Note This response has no contents.
404

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

The thing was 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.
404

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

The topic was not found.
Contents
Name Type Description
errorCode string Error code "TOPIC_NOT_FOUND".
message string The error message.
topicID string The ID of the topic that is not found
objectScope ObjectScope The scope of the topic
appID string The ID of the application.
userID string The ID of the user. Only provided for a user-scope bucket.
groupID string The ID of the group. Only provided for a group-scope bucket.
thingID string The ID of the thing. Only provided for a thing-scope bucket.
type string One of "APP", "APP_AND_USER", "APP_AND_GROUP", or "APP_AND_THING".
404

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

The subscription was not found, or the thing was subscribed to the topic.
Contents
Name Type Description
errorCode string Error code "PUSH_SUBSCRIPTION_NOT_FOUND".
message string The error message.
topicID string The ID of the topic where the subscription is not found
objectScope ObjectScope The scope of the topic
appID string The ID of the application.
userID string The ID of the user. Only provided for a user-scope bucket.
groupID string The ID of the group. Only provided for a group-scope bucket.
thingID string The ID of the thing. Only provided for a thing-scope bucket.
type string One of "APP", "APP_AND_USER", "APP_AND_GROUP", or "APP_AND_THING".
subject string The subject that is not subscribed to the topic/filter
401

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

Not authorized to access this method.
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).

HEAD

/api/apps/{appID}/things/{thingID}/topics/{topicID}/push/subscriptions/things/{thingID}

Description

Check if this thing is subscribed to the current topic.

Security

Can be performed by the administrator and the subscribed thing itself.

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
URL Params
Name Required? type Description
thingID Yes string thingID of the subscribed thing
Responses
204

Content-Type (None)

The thing is subscribed to the topic.
Note This response has no contents.
404

Content-Type (None)

The thing is not subscribed to the topic.
401

Content-Type (None)

Not authorized to access this method.

DELETE

/api/apps/{appID}/things/{thingID}/topics/{topicID}/push/subscriptions/things/{thingID}

Description

Unsubscribe this thing from the current topic.

Security

Can be performed by the administrator and the thing to subscribe itself.

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
URL Params
Name Required? type Description
thingID Yes string thingID of the subscribed thing
Responses
200

Content-Type (None)

The thing has been unsubscribed successfully.
404

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

The thing was 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.
404

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

The topic was not found.
Contents
Name Type Description
errorCode string Error code "TOPIC_NOT_FOUND".
message string The error message.
topicID string The ID of the topic that is not found
objectScope ObjectScope The scope of the topic
appID string The ID of the application.
userID string The ID of the user. Only provided for a user-scope bucket.
groupID string The ID of the group. Only provided for a group-scope bucket.
thingID string The ID of the thing. Only provided for a thing-scope bucket.
type string One of "APP", "APP_AND_USER", "APP_AND_GROUP", or "APP_AND_THING".
404

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

The thing was not subscribed to the topic.
Contents
Name Type Description
errorCode string Error code "PUSH_SUBSCRIPTION_NOT_FOUND".
message string The error message.
topicID string The ID of the topic where the subscription is not found
objectScope ObjectScope The scope of the topic
appID string The ID of the application.
userID string The ID of the user. Only provided for a user-scope bucket.
groupID string The ID of the group. Only provided for a group-scope bucket.
thingID string The ID of the thing. Only provided for a thing-scope bucket.
type string One of "APP", "APP_AND_USER", "APP_AND_GROUP", or "APP_AND_THING".
subject string The subject that is not subscribed to the topic/filter
401

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

Not authorized to access this method.
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).