Method: projects.locations.registries.devices.setState

Sets the state of a device.

HTTP request

POST https://cloudiotdevice.googleapis.com/v1/{name=projects/*/locations/*/registries/*/devices/*}:setState

The URL uses Google API HTTP annotation syntax.

Each request must include a JWT in the header.

Path parameters

Parameters
name

string

The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0.

Request body

The request body contains data with the following structure:

JSON representation
{
  "state": {
    object(DeviceState)
  },
}
Fields
state

object(DeviceState)

The device state.

Response body

If successful, the response body will be empty.

DeviceState

The device state reported to Cloud IoT Core.

JSON representation
{
  "binaryData": string,
}
Fields
binaryData

string (bytes format)

Data in binary format.

A base64-encoded string.

Was this page helpful? Let us know how we did:

Send feedback about...

Google Cloud Internet of Things Core