SendEvent - Amazon IVS

SendEvent

Sends an event to a room. Use this within your application’s business logic to send events to clients of a room; e.g., to notify clients to change the way the chat UI is rendered.

Request Syntax

POST /SendEvent HTTP/1.1 Content-type: application/json { "attributes": { "string" : "string" }, "eventName": "string", "roomIdentifier": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

attributes

Application-defined metadata to attach to the event sent to clients. The maximum length of the metadata is 1 KB total.

Type: String to string map

Required: No

eventName

Application-defined name of the event to send to clients.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Required: Yes

roomIdentifier

Identifier of the room to which the event will be sent. Currently this must be an ARN.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: arn:aws:ivschat:[a-z0-9-]+:[0-9]+:room/[a-zA-Z0-9-]+

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "id": "string" }

Response Elements

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

The following data is returned in JSON format by the service.

id

An identifier generated by Amazon IVS Chat. This identifier must be used in subsequent operations for this message, such as DeleteMessage.

Type: String

Length Constraints: Fixed length of 12.

Pattern: [a-zA-Z0-9]+

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

HTTP Status Code: 403

PendingVerification

HTTP Status Code: 403

ResourceNotFoundException

HTTP Status Code: 404

ThrottlingException

HTTP Status Code: 429

ValidationException

HTTP Status Code: 400

See Also

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