InvokeAssistant - AWS IoT SiteWise

InvokeAssistant

Invokes SiteWise Assistant to start or continue a conversation.

Request Syntax

POST /assistant/invocation HTTP/1.1 Content-type: application/json { "conversationId": "string", "enableTrace": boolean, "message": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

conversationId

The ID assigned to a conversation. AWS IoT SiteWise automatically generates a unique ID for you, and this parameter is never required. However, if you prefer to have your own ID, you must specify it here in UUID format. If you specify your own ID, it must be globally unique.

Type: String

Length Constraints: Fixed length of 36.

Pattern: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}

Required: No

enableTrace

Specifies if to turn trace on or not. It is used to track the SiteWise Assistant's reasoning, and data access process.

Type: Boolean

Required: No

message

A text message sent to the SiteWise Assistant by the user.

Type: String

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

Required: Yes

Response Syntax

HTTP/1.1 200 x-amz-iotsitewise-assistant-conversation-id: conversationId Content-type: application/json { "accessDeniedException": { }, "conflictingOperationException": { }, "internalFailureException": { }, "invalidRequestException": { }, "limitExceededException": { }, "output": { "citations": [ { "content": { "text": "string" }, "reference": { "dataset": { "datasetArn": "string", "source": { "arn": "string", "location": { "uri": "string" } } } } } ], "message": "string" }, "resourceNotFoundException": { }, "throttlingException": { }, "trace": { "text": "string" } }

Response Elements

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

The response returns the following HTTP headers.

conversationId

The ID of the conversation, in UUID format. This ID uniquely identifies the conversation within AWS IoT SiteWise.

Length Constraints: Fixed length of 36.

Pattern: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}

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

accessDeniedException

Access is denied.

Type: Exception

HTTP Status Code: 403
conflictingOperationException

Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.

Type: Exception

HTTP Status Code: 409
internalFailureException

AWS IoT SiteWise can't process your request right now. Try again later.

Type: Exception

HTTP Status Code: 500
invalidRequestException

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.

Type: Exception

HTTP Status Code: 400
limitExceededException

You've reached the limit for a resource. For example, this can occur if you're trying to associate more than the allowed number of child assets or attempting to create more than the allowed number of properties for an asset model.

For more information, see Quotas in the AWS IoT SiteWise User Guide.

Type: Exception

HTTP Status Code: 410
output

Contains the SiteWise Assistant's response.

Type: InvocationOutput object

resourceNotFoundException

The requested resource can't be found.

Type: Exception

HTTP Status Code: 404
throttlingException

Your request exceeded a rate limit. For example, you might have exceeded the number of AWS IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.

For more information, see Quotas in the AWS IoT SiteWise User Guide.

Type: Exception

HTTP Status Code: 429
trace

Contains tracing information of the SiteWise Assistant's reasoning and data access.

Type: Trace object

Errors

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

AccessDeniedException

Access is denied.

HTTP Status Code: 403

ConflictingOperationException

Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.

HTTP Status Code: 409

InternalFailureException

AWS IoT SiteWise can't process your request right now. Try again later.

HTTP Status Code: 500

InvalidRequestException

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.

HTTP Status Code: 400

LimitExceededException

You've reached the limit for a resource. For example, this can occur if you're trying to associate more than the allowed number of child assets or attempting to create more than the allowed number of properties for an asset model.

For more information, see Quotas in the AWS IoT SiteWise User Guide.

HTTP Status Code: 410

ResourceNotFoundException

The requested resource can't be found.

HTTP Status Code: 404

ThrottlingException

Your request exceeded a rate limit. For example, you might have exceeded the number of AWS IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.

For more information, see Quotas in the AWS IoT SiteWise User Guide.

HTTP Status Code: 429

See Also

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