Method: projects.locations.registries.devices.publishEvent

Publishes a telemetry event for a device.

HTTP request

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

The URL uses gRPC Transcoding 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
{
  "subFolder": string,
  "gatewayInfo": {
    object(GatewayInfo)
  },
  "binaryData": string
}
Fields
subFolder

string

Optional subfolder for the telemetry event. This can be used to classify types of events, and is included in the Pub/Sub message attributes.

gatewayInfo

object(GatewayInfo)

Set only if the message is sent through a gateway or a gateway is making the request on behalf of a device.

binaryData

string (bytes format)

Payload data in binary format.

A base64-encoded string.

Response body

If successful, the response body will be empty.

Esta página foi útil? Conte sua opinião sobre:

Enviar comentários sobre…

Cloud IoT Core Documentation