Device Methods - AWS IoT 1-Click

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
NameTypeRequiredDescription
deviceIdStringTrue

The unique identifier of the device.

Responses
Status codeResponse modelDescription
200 GetDeviceMethodsResponse

200 response

400InvalidRequestException

400 response

404ResourceNotFoundException

404 response

500InternalFailureException

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
NameTypeRequiredDescription
deviceIdStringTrue

The unique identifier of the device.

Responses
Status codeResponse modelDescription
200 InvokeDeviceMethodResponse

200 response

400InvalidRequestException

400 response

404ResourceNotFoundException

404 response

409ResourceConflictException

409 response

412PreconditionFailedException

412 response

416RangeNotSatisfiableException

416 response

500InternalFailureException

500 response

OPTIONS

Responses
Status codeResponse modelDescription
200None

200 response

Schemas

Request bodies

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

Response bodies

{ "deviceMethods": [ { "deviceType": "string", "methodName": "string" } ] }
{ "deviceMethodResponse": "string" }
{ "code": "string", "message": "string" }
{ "code": "string", "message": "string" }
{ "code": "string", "message": "string" }
{ "code": "string", "message": "string" }
{ "code": "string", "message": "string" }
{ "code": "string", "message": "string" }

Properties

DeviceMethod

PropertyTypeRequiredDescription
deviceType

string

False

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

methodName

string

False

The name of the method applicable to the deviceType.

GetDeviceMethodsResponse

PropertyTypeRequiredDescription
deviceMethods

Array of type DeviceMethod

False

List of available device APIs.

InternalFailureException

PropertyTypeRequiredDescription
code

string

False

500

message

string

False

The 500 error message returned by the web server.

InvalidRequestException

PropertyTypeRequiredDescription
code

string

False

400

message

string

False

The 400 error message returned by the web server.

InvokeDeviceMethodRequest

PropertyTypeRequiredDescription
deviceMethod

DeviceMethod

False

The device method to invoke.

deviceMethodParameters

string

False

A JSON encoded string containing the device method request parameters.

InvokeDeviceMethodResponse

PropertyTypeRequiredDescription
deviceMethodResponse

string

False

A JSON encoded string containing the device method response.

PreconditionFailedException

PropertyTypeRequiredDescription
code

string

False

412

message

string

False

An error message explaining the error or its remedy.

RangeNotSatisfiableException

PropertyTypeRequiredDescription
code

string

False

416

message

string

False

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

ResourceConflictException

PropertyTypeRequiredDescription
code

string

False

409

message

string

False

An error message explaining the error or its remedy.

ResourceNotFoundException

PropertyTypeRequiredDescription
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