nest-device-access

Unable to receive Device Access events


I've enabled events for my project in the Device Access Console and provided a Pub/Sub topic, but I'm not receiving them. I am able to successfully authorize accounts and list devices for the authorized user.


Solution

  • After events are enabled through the Device Access Console, you must initiate them using a one-time call to list devices after you receive an access token for each authorized account. This initial call finishes the authorization process and enables events to be sent to your Pub/Sub subscription.

    For example, a simple cURL call like this will initiate events:

    curl -X GET 'https://smartdevicemanagement.googleapis.com/v1/enterprises/[project-id]/devices' \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Bearer my-access-token'