AWS IoT 1-Click
Devices API Reference

Device Methods

Given a device ID, represents the collection of invokable device methods. For more information, see Device Methods in the AWS IoT 1-Click Developer Guide.

URI

/devices/deviceId/methods

HTTP Methods

GET

Operation ID: GetDeviceMethods

Given a device ID, returns the invokable methods associated with the device.

Path Parameters

Name Type Required Description
deviceId String True

The unique identifier of the device.

Responses

Status Code Response Model Description
200 GetDeviceMethodsResponse

200 response

400 InvalidRequestException

400 response

404 ResourceNotFoundException

404 response

500 InternalFailureException

500 response

POST

Operation ID: InvokeDeviceMethod

Given a device ID, issues a request to invoke a named device method (with possible parameters). See the "Example POST" code snippet below.

Path Parameters

Name Type Required Description
deviceId String True

The unique identifier of the device.

Responses

Status Code Response Model Description
200 InvokeDeviceMethodResponse

200 response

400 InvalidRequestException

400 response

404 ResourceNotFoundException

404 response

409 ResourceConflictException

409 response

412 PreconditionFailedException

412 response

416 RangeNotSatisfiableException

416 response

500 InternalFailureException

500 response

OPTIONS

Responses

Status Code Response Model Description
200 None

200 response

Schemas

Request Bodies

Example POST

{ "deviceMethodParameters": "string", "deviceMethod": { "deviceType": "string", "methodName": "string" } }

Response Bodies

Example GetDeviceMethodsResponse

{ "deviceMethods": [ { "deviceType": "string", "methodName": "string" } ] }

Example InvokeDeviceMethodResponse

{ "deviceMethodResponse": "string" }

Example InvalidRequestException

{ "code": "string", "message": "string" }

Example ResourceNotFoundException

{ "code": "string", "message": "string" }

Example ResourceConflictException

{ "code": "string", "message": "string" }

Example PreconditionFailedException

{ "code": "string", "message": "string" }

Example RangeNotSatisfiableException

{ "code": "string", "message": "string" }

Example InternalFailureException

{ "code": "string", "message": "string" }

Properties

DeviceMethod

Property Type Required Description
deviceType

string

False

The type of the device, such as "button".

methodName

string

False

The name of the method applicable to the deviceType.

GetDeviceMethodsResponse

Property Type Required Description
deviceMethods

Array of type DeviceMethod

False

List of available device APIs.

InternalFailureException

Property Type Required Description
code

string

False

500

message

string

False

The 500 error message returned by the web server.

InvalidRequestException

Property Type Required Description
code

string

False

400

message

string

False

The 400 error message returned by the web server.

InvokeDeviceMethodRequest

Property Type Required Description
deviceMethodParameters

string

False

A JSON encoded string containing the device method request parameters.

deviceMethod

DeviceMethod

False

The device method to invoke.

InvokeDeviceMethodResponse

Property Type Required Description
deviceMethodResponse

string

False

A JSON encoded string containing the device method response.

PreconditionFailedException

Property Type Required Description
code

string

False

412

message

string

False

An error message explaining the error or its remedy.

RangeNotSatisfiableException

Property Type Required Description
code

string

False

416

message

string

False

The requested number of results specified by nextToken cannot be satisfied.

ResourceConflictException

Property Type Required Description
code

string

False

409

message

string

False

An error message explaining the error or its remedy.

ResourceNotFoundException

Property Type Required Description
code

string

False

404

message

string

False

The requested device could not be found.

See Also

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

GetDeviceMethods

InvokeDeviceMethod