1

I have set up pub/sub event subscriptions and I am now getting event messages into my GCP Console. My nest doorbell comes with a preview URL when certain events are triggered, here is the payload:

{
  "eventId" : "7feb3438-1dbf-4e32-849a-805d5887c48f",
  "timestamp" : "2019-01-01T00:00:01Z",
  "resourceUpdate" : {
    "name" : "enterprises/project-id/devices/device-id",
    "events" : {
      "sdm.devices.events.CameraClipPreview.ClipPreview" : {
        "eventSessionId" : "CjY5Y3VKaTZwR3o4Y19YbTVfMF...",
        "previewUrl" : "https://previewUrl/..."
      }
    }
  }
  "userId" : "AVPHwEuBfnPOnTqzVFT4IONX2Qqhu9EJ4ubO-bNnQ-yi",
  "resourceGroup" : [
    "enterprises/project-id/devices/device-id"
  ]
}

The previewUrl comes in fine, and looks something like https://nest-camera-frontend.googleapis.com/frontend/encrypted/clippreview/AhHSDAh687gOY88G8yg8-YGgyG788786gfFtOLyGgVvdYDgdGDgdPDdpD9d9D-5IX

However when I paste this into the browser I get the 401 Bad request Google page.

Is the previewURL not meant to be accessed in a browser? How do I access/download the preview video?

Anthony
  • 929
  • 7
  • 21

1 Answers1

4

I believe you have to download it first, can you try this, replacing {access-token} with your OAuth access token?

curl -H 'Authorization: Bearer {access-token}' https://nest-camera-frontend.googleapis.com/frontend/encrypted/clippreview/AhHSDAh687gOY88G8yg8-YGgyG788786gfFtOLyGgVvdYDgdGDgdPDdpD9d9D-5IX
Gothic
  • 322
  • 3
  • 12
  • As a follow up, the documentation has been updated for this: https://developers.google.com/nest/device-access/traits/device/camera-clip-preview#preview-the-clip – Gothic Feb 04 '22 at 18:23