Menu
AWS IoT
API Reference

Publish

Publishes state information.

For more information, see HTTP Protocol in the AWS IoT Developer Guide.

Request Syntax

POST /topics/topic?qos=qos HTTP/1.1

payload

URI Request Parameters

The request requires the following URI parameters.

qos

The Quality of Service (QoS) level.

Valid Range: Minimum value of 0. Maximum value of 1.

topic

The name of the MQTT topic.

Request Body

The request accepts the following binary data.

payload

The state information, in JSON format.

Response Syntax

HTTP/1.1 200

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

InternalFailureException

An unexpected error has occurred.

HTTP Status Code: 500

InvalidRequestException

The request is not valid.

HTTP Status Code: 400

MethodNotAllowedException

The specified combination of HTTP verb and URI is not supported.

HTTP Status Code: 405

UnauthorizedException

You are not authorized to perform this operation.

HTTP Status Code: 401

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: