BatchGetAssetPropertyValue - Amazon IoT SiteWise
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

BatchGetAssetPropertyValue

Gets the current value for one or more asset properties. For more information, see Querying current values in the Amazon IoT SiteWise User Guide.

Request Syntax

POST /properties/batch/latest HTTP/1.1 Content-type: application/json { "entries": [ { "assetId": "string", "entryId": "string", "propertyAlias": "string", "propertyId": "string" } ], "nextToken": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

entries

The list of asset property value entries for the batch get request. You can specify up to 128 entries per request.

Type: Array of BatchGetAssetPropertyValueEntry objects

Required: Yes

nextToken

The token to be used for the next set of paginated results.

Type: String

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

Pattern: [A-Za-z0-9+/=]+

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "errorEntries": [ { "entryId": "string", "errorCode": "string", "errorMessage": "string" } ], "nextToken": "string", "skippedEntries": [ { "completionStatus": "string", "entryId": "string", "errorInfo": { "errorCode": "string", "errorTimestamp": number } } ], "successEntries": [ { "assetPropertyValue": { "quality": "string", "timestamp": { "offsetInNanos": number, "timeInSeconds": number }, "value": { "booleanValue": boolean, "doubleValue": number, "integerValue": number, "stringValue": "string" } }, "entryId": "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.

errorEntries

A list of the errors (if any) associated with the batch request. Each error entry contains the entryId of the entry that failed.

Type: Array of BatchGetAssetPropertyValueErrorEntry objects

nextToken

The token for the next set of results, or null if there are no additional results.

Type: String

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

Pattern: [A-Za-z0-9+/=]+

skippedEntries

A list of entries that were not processed by this batch request. because these entries had been completely processed by previous paginated requests. Each skipped entry contains the entryId of the entry that skipped.

Type: Array of BatchGetAssetPropertyValueSkippedEntry objects

successEntries

A list of entries that were processed successfully by this batch request. Each success entry contains the entryId of the entry that succeeded and the latest query result.

Type: Array of BatchGetAssetPropertyValueSuccessEntry objects

Errors

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

InternalFailureException

Amazon 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

ServiceUnavailableException

The requested service is unavailable.

HTTP Status Code: 503

ThrottlingException

Your request exceeded a rate limit. For example, you might have exceeded the number of Amazon 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 Amazon IoT SiteWise User Guide.

HTTP Status Code: 429

Examples

Example

The following example uses the Amazon Command Line Interface (Amazon CLI) to retrieve the current temperature value for two wind turbines. The following also shows the contents of the batch-get-asset-property-value.json file.

Sample Request

aws iotsitewise batch-get-asset-property-value --cli-input-json file://batch-get-asset-property-value.json
{ "entries":[ { "entryId":"1", "assetId":"a1b2c3d4-5678-90ab-cdef-11111EXAMPLE", "propertyId":"a1b2c3d4-5678-90ab-cdef-22222EXAMPLE" }, { "entryId":"2", "assetId":"a1b2c3d4-5678-90ab-cdef-33333EXAMPLE", "propertyId":"a1b2c3d4-5678-90ab-cdef-44444EXAMPLE" } ] }

Sample Response

{ "errorEntries":[ ], "successEntries":[ { "entryId":"1", "propertyValue":{ "value":{ "doubleValue":1426.66 }, "timestamp":{ "timeInSeconds":1580853000, "offsetInNanos":0 }, "quality":"GOOD" } }, { "entryId":"2", "propertyValue":{ "value":{ "doubleValue":1429.44 }, "timestamp":{ "timeInSeconds":1580853000, "offsetInNanos":0 }, "quality":"GOOD" } } ] }

See Also

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