AWS IoT 1-Click Devices Service 2018-05-14
- Client: Aws\IoT1ClickDevicesService\IoT1ClickDevicesServiceClient
- Service ID: iot1click-devices
- Version: 2018-05-14
This page describes the parameters and results for the operations of the AWS IoT 1-Click Devices Service (2018-05-14), and shows how to use the Aws\IoT1ClickDevicesService\IoT1ClickDevicesServiceClient object to call the described operations. This documentation is specific to the 2018-05-14 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName')
, where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */)
.
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */)
.
- ClaimDevicesByClaimCode ( array $params = [] )
- Adds device(s) to your account (i.
- DescribeDevice ( array $params = [] )
- Given a device ID, returns a DescribeDeviceResponse object describing the details of the device.
- FinalizeDeviceClaim ( array $params = [] )
- Given a device ID, finalizes the claim request for the associated device.
- GetDeviceMethods ( array $params = [] )
- Given a device ID, returns the invokable methods associated with the device.
- InitiateDeviceClaim ( array $params = [] )
- Given a device ID, initiates a claim request for the associated device.
- InvokeDeviceMethod ( array $params = [] )
- Given a device ID, issues a request to invoke a named device method (with possible parameters).
- ListDeviceEvents ( array $params = [] )
- Using a device ID, returns a DeviceEventsResponse object containing an array of events for the device.
- ListDevices ( array $params = [] )
- Lists the 1-Click compatible devices associated with your AWS account.
- ListTagsForResource ( array $params = [] )
- Lists the tags associated with the specified resource ARN.
- TagResource ( array $params = [] )
- Adds or updates the tags associated with the resource ARN.
- UnclaimDevice ( array $params = [] )
- Disassociates a device from your AWS account using its device ID.
- UntagResource ( array $params = [] )
- Using tag keys, deletes the tags (key/value pairs) associated with the specified resource ARN.
- UpdateDeviceState ( array $params = [] )
- Using a Boolean value (true or false), this operation enables or disables the device given a device ID.
Operations
ClaimDevicesByClaimCode
$result = $client->claimDevicesByClaimCode
([/* ... */]); $promise = $client->claimDevicesByClaimCodeAsync
([/* ... */]);
Adds device(s) to your account (i.e., claim one or more devices) if and only if you received a claim code with the device(s).
Parameter Syntax
$result = $client->claimDevicesByClaimCode([ 'ClaimCode' => '<string>', // REQUIRED ]);
Parameter Details
Members
- ClaimCode
-
- Required: Yes
- Type: string
Result Syntax
[ 'ClaimCode' => '<string>', 'Total' => <integer>, ]
Result Details
Members
- ClaimCode
-
- Type: string
The claim code provided by the device manufacturer.
- Total
-
- Type: int
The total number of devices associated with the claim code that has been processed in the claim request.
Errors
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
- ForbiddenException:
- This error does not currently have a description.
DescribeDevice
$result = $client->describeDevice
([/* ... */]); $promise = $client->describeDeviceAsync
([/* ... */]);
Given a device ID, returns a DescribeDeviceResponse object describing the details of the device.
Parameter Syntax
$result = $client->describeDevice([ 'DeviceId' => '<string>', // REQUIRED ]);
Parameter Details
Members
- DeviceId
-
- Required: Yes
- Type: string
Result Syntax
[ 'DeviceDescription' => [ 'Arn' => '<string>', 'Attributes' => ['<string>', ...], 'DeviceId' => '<string>', 'Enabled' => true || false, 'RemainingLife' => <float>, 'Tags' => ['<string>', ...], 'Type' => '<string>', ], ]
Result Details
Members
- DeviceDescription
-
- Type: DeviceDescription structure
Device details.
Errors
- ResourceNotFoundException:
- This error does not currently have a description.
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
FinalizeDeviceClaim
$result = $client->finalizeDeviceClaim
([/* ... */]); $promise = $client->finalizeDeviceClaimAsync
([/* ... */]);
Given a device ID, finalizes the claim request for the associated device.
Claiming a device consists of initiating a claim, then publishing a device event, and finalizing the claim. For a device of type button, a device event can be published by simply clicking the device.
Parameter Syntax
$result = $client->finalizeDeviceClaim([ 'DeviceId' => '<string>', // REQUIRED 'Tags' => ['<string>', ...], ]);
Parameter Details
Members
- DeviceId
-
- Required: Yes
- Type: string
- Tags
-
- Type: Associative array of custom strings keys (__string) to strings
Result Syntax
[ 'State' => '<string>', ]
Result Details
Members
- State
-
- Type: string
Errors
- ResourceNotFoundException:
- This error does not currently have a description.
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
- PreconditionFailedException:
- This error does not currently have a description.
- ResourceConflictException:
- This error does not currently have a description.
GetDeviceMethods
$result = $client->getDeviceMethods
([/* ... */]); $promise = $client->getDeviceMethodsAsync
([/* ... */]);
Given a device ID, returns the invokable methods associated with the device.
Parameter Syntax
$result = $client->getDeviceMethods([ 'DeviceId' => '<string>', // REQUIRED ]);
Parameter Details
Members
- DeviceId
-
- Required: Yes
- Type: string
Result Syntax
[ 'DeviceMethods' => [ [ 'DeviceType' => '<string>', 'MethodName' => '<string>', ], // ... ], ]
Result Details
Members
- DeviceMethods
-
- Type: Array of DeviceMethod structures
List of available device APIs.
Errors
- ResourceNotFoundException:
- This error does not currently have a description.
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
InitiateDeviceClaim
$result = $client->initiateDeviceClaim
([/* ... */]); $promise = $client->initiateDeviceClaimAsync
([/* ... */]);
Given a device ID, initiates a claim request for the associated device.
Claiming a device consists of initiating a claim, then publishing a device event, and finalizing the claim. For a device of type button, a device event can be published by simply clicking the device.
Parameter Syntax
$result = $client->initiateDeviceClaim([ 'DeviceId' => '<string>', // REQUIRED ]);
Parameter Details
Members
- DeviceId
-
- Required: Yes
- Type: string
Result Syntax
[ 'State' => '<string>', ]
Result Details
Members
- State
-
- Type: string
Errors
- ResourceNotFoundException:
- This error does not currently have a description.
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
- ResourceConflictException:
- This error does not currently have a description.
InvokeDeviceMethod
$result = $client->invokeDeviceMethod
([/* ... */]); $promise = $client->invokeDeviceMethodAsync
([/* ... */]);
Given a device ID, issues a request to invoke a named device method (with possible parameters). See the "Example POST" code snippet below.
Parameter Syntax
$result = $client->invokeDeviceMethod([ 'DeviceId' => '<string>', // REQUIRED 'DeviceMethod' => [ 'DeviceType' => '<string>', 'MethodName' => '<string>', ], 'DeviceMethodParameters' => '<string>', ]);
Parameter Details
Members
- DeviceId
-
- Required: Yes
- Type: string
- DeviceMethod
-
- Type: DeviceMethod structure
The device method to invoke.
- DeviceMethodParameters
-
- Type: string
A JSON encoded string containing the device method request parameters.
Result Syntax
[ 'DeviceMethodResponse' => '<string>', ]
Result Details
Members
- DeviceMethodResponse
-
- Type: string
A JSON encoded string containing the device method response.
Errors
- InvalidRequestException:
- This error does not currently have a description.
- PreconditionFailedException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
- ResourceNotFoundException:
- This error does not currently have a description.
- RangeNotSatisfiableException:
- This error does not currently have a description.
- ResourceConflictException:
- This error does not currently have a description.
ListDeviceEvents
$result = $client->listDeviceEvents
([/* ... */]); $promise = $client->listDeviceEventsAsync
([/* ... */]);
Using a device ID, returns a DeviceEventsResponse object containing an array of events for the device.
Parameter Syntax
$result = $client->listDeviceEvents([ 'DeviceId' => '<string>', // REQUIRED 'FromTimeStamp' => <integer || string || DateTime>, // REQUIRED 'MaxResults' => <integer>, 'NextToken' => '<string>', 'ToTimeStamp' => <integer || string || DateTime>, // REQUIRED ]);
Parameter Details
Members
- DeviceId
-
- Required: Yes
- Type: string
- FromTimeStamp
-
- Required: Yes
- Type: timestamp (string|DateTime or anything parsable by strtotime)
- MaxResults
-
- Type: int
- NextToken
-
- Type: string
- ToTimeStamp
-
- Required: Yes
- Type: timestamp (string|DateTime or anything parsable by strtotime)
Result Syntax
[ 'Events' => [ [ 'Device' => [ 'Attributes' => [ ], 'DeviceId' => '<string>', 'Type' => '<string>', ], 'StdEvent' => '<string>', ], // ... ], 'NextToken' => '<string>', ]
Result Details
Members
- Events
-
- Type: Array of DeviceEvent structures
- NextToken
-
- Type: string
Errors
- ResourceNotFoundException:
- This error does not currently have a description.
- RangeNotSatisfiableException:
- This error does not currently have a description.
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
ListDevices
$result = $client->listDevices
([/* ... */]); $promise = $client->listDevicesAsync
([/* ... */]);
Lists the 1-Click compatible devices associated with your AWS account.
Parameter Syntax
$result = $client->listDevices([ 'DeviceType' => '<string>', 'MaxResults' => <integer>, 'NextToken' => '<string>', ]);
Parameter Details
Members
- DeviceType
-
- Type: string
- MaxResults
-
- Type: int
- NextToken
-
- Type: string
Result Syntax
[ 'Devices' => [ [ 'Arn' => '<string>', 'Attributes' => ['<string>', ...], 'DeviceId' => '<string>', 'Enabled' => true || false, 'RemainingLife' => <float>, 'Tags' => ['<string>', ...], 'Type' => '<string>', ], // ... ], 'NextToken' => '<string>', ]
Result Details
Members
- Devices
-
- Type: Array of DeviceDescription structures
A list of devices.
- NextToken
-
- Type: string
The token to retrieve the next set of results.
Errors
- RangeNotSatisfiableException:
- This error does not currently have a description.
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
ListTagsForResource
$result = $client->listTagsForResource
([/* ... */]); $promise = $client->listTagsForResourceAsync
([/* ... */]);
Lists the tags associated with the specified resource ARN.
Parameter Syntax
$result = $client->listTagsForResource([ 'ResourceArn' => '<string>', // REQUIRED ]);
Parameter Details
Members
- ResourceArn
-
- Required: Yes
- Type: string
Result Syntax
[ 'Tags' => ['<string>', ...], ]
Result Details
Members
- Tags
-
- Type: Associative array of custom strings keys (__string) to strings
Errors
- ResourceNotFoundException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
TagResource
$result = $client->tagResource
([/* ... */]); $promise = $client->tagResourceAsync
([/* ... */]);
Adds or updates the tags associated with the resource ARN. See AWS IoT 1-Click Service Limits for the maximum number of tags allowed per resource.
Parameter Syntax
$result = $client->tagResource([ 'ResourceArn' => '<string>', // REQUIRED 'Tags' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
- ResourceArn
-
- Required: Yes
- Type: string
- Tags
-
- Required: Yes
- Type: Associative array of custom strings keys (__string) to strings
Result Syntax
[]
Result Details
Errors
- ResourceNotFoundException:
- This error does not currently have a description.
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
UnclaimDevice
$result = $client->unclaimDevice
([/* ... */]); $promise = $client->unclaimDeviceAsync
([/* ... */]);
Disassociates a device from your AWS account using its device ID.
Parameter Syntax
$result = $client->unclaimDevice([ 'DeviceId' => '<string>', // REQUIRED ]);
Parameter Details
Members
- DeviceId
-
- Required: Yes
- Type: string
Result Syntax
[ 'State' => '<string>', ]
Result Details
Members
- State
-
- Type: string
Errors
- ResourceNotFoundException:
- This error does not currently have a description.
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
UntagResource
$result = $client->untagResource
([/* ... */]); $promise = $client->untagResourceAsync
([/* ... */]);
Using tag keys, deletes the tags (key/value pairs) associated with the specified resource ARN.
Parameter Syntax
$result = $client->untagResource([ 'ResourceArn' => '<string>', // REQUIRED 'TagKeys' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
- ResourceArn
-
- Required: Yes
- Type: string
- TagKeys
-
- Required: Yes
- Type: Array of strings
Result Syntax
[]
Result Details
Errors
- ResourceNotFoundException:
- This error does not currently have a description.
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
UpdateDeviceState
$result = $client->updateDeviceState
([/* ... */]); $promise = $client->updateDeviceStateAsync
([/* ... */]);
Using a Boolean value (true or false), this operation enables or disables the device given a device ID.
Parameter Syntax
$result = $client->updateDeviceState([ 'DeviceId' => '<string>', // REQUIRED 'Enabled' => true || false, ]);
Parameter Details
Members
- DeviceId
-
- Required: Yes
- Type: string
- Enabled
-
- Type: boolean
If true, the device is enabled. If false, the device is disabled.
Result Syntax
[]
Result Details
Errors
- ResourceNotFoundException:
- This error does not currently have a description.
- InvalidRequestException:
- This error does not currently have a description.
- InternalFailureException:
- This error does not currently have a description.
Shapes
Attributes
Members
Device
Members
- Attributes
-
- Type: Attributes structure
The user specified attributes associated with the device for an event.
- DeviceId
-
- Type: string
The unique identifier of the device.
- Type
-
- Type: string
The device type, such as "button".
DeviceClaimResponse
Members
- State
-
- Type: string
The device's final claim state.
DeviceDescription
Members
- Arn
-
- Type: string
The ARN of the device.
- Attributes
-
- Type: Associative array of custom strings keys (__string) to strings
An array of zero or more elements of DeviceAttribute objects providing user specified device attributes.
- DeviceId
-
- Type: string
The unique identifier of the device.
- Enabled
-
- Type: boolean
A Boolean value indicating whether or not the device is enabled.
- RemainingLife
-
- Type: double
A value between 0 and 1 inclusive, representing the fraction of life remaining for the device.
- Tags
-
- Type: Associative array of custom strings keys (__string) to strings
- Type
-
- Type: string
The type of the device, such as "button".
DeviceEvent
Members
- Device
-
- Type: Device structure
An object representing the device associated with the event.
- StdEvent
-
- Type: string
A serialized JSON object representing the device-type specific event.
DeviceEventsResponse
Members
- Events
-
- Type: Array of DeviceEvent structures
An array of zero or more elements describing the event(s) associated with the device.
- NextToken
-
- Type: string
The token to retrieve the next set of results.
DeviceMethod
Members
- DeviceType
-
- Type: string
The type of the device, such as "button".
- MethodName
-
- Type: string
The name of the method applicable to the deviceType.
Empty
Description
On success, an empty object is returned.
Members
ForbiddenException
Members
- Code
-
- Type: string
403
- Message
-
- Type: string
The 403 error message returned by the web server.
InternalFailureException
Members
- Code
-
- Type: string
500
- Message
-
- Type: string
The 500 error message returned by the web server.
InvalidRequestException
Members
- Code
-
- Type: string
400
- Message
-
- Type: string
The 400 error message returned by the web server.
PreconditionFailedException
Members
- Code
-
- Type: string
412
- Message
-
- Type: string
An error message explaining the error or its remedy.
RangeNotSatisfiableException
Members
- Code
-
- Type: string
416
- Message
-
- Type: string
The requested number of results specified by nextToken cannot be satisfied.
ResourceConflictException
Members
- Code
-
- Type: string
409
- Message
-
- Type: string
An error message explaining the error or its remedy.
ResourceNotFoundException
Members
- Code
-
- Type: string
404
- Message
-
- Type: string
The requested device could not be found.