Page Summary
-
This webpage details the process of creating an ambient device within a user's Google Photos account via an HTTP POST request to
https://photosambient.googleapis.com/v1/devices. -
A
requestIdquery parameter is mandatory, requiring a unique, client-provided UUID in the format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" to prevent device duplication. -
The request body must contain an instance of
AmbientDevice, and upon success, the response body will contain the newly createdAmbientDevice. -
Creating an ambient device requires authorization with the
https://www.googleapis.com/auth/photosambient.mediaitemsOAuth scope. -
There is a limit of 100 devices per user, and attempting to exceed this limit results in a
RESOURCE_EXHAUSTEDerror.
Creates an ambient device in the user's Google Photos account.
If a device with the provided requestId already exists, an ALREADY_EXISTS error is returned. To help prevent duplicate devices, do the following:
- If you know the
deviceIdof the existing device, calldevices.getto retrieve it. - If you don't know the
deviceId, calldevices.deletewith therequestIdto remove the orphaned device before retrying this method.
You may create up to 100 devices per user of your app. If that limit is exceeded, a RESOURCE_EXHAUSTED error is returned.
HTTP request
POST https://photosambient.googleapis.com/v1/devices
The URL uses gRPC Transcoding syntax.
Query parameters
| Parameters | |
|---|---|
requestId |
Optional. A client-provided unique identifier for this request. This is used to mitigate resource duplication in the event of a network failure. This ID must have the format of a UUID (version 4) string and follow these requirements:
|
Request body
The request body contains an instance of AmbientDevice.
Response body
If successful, the response body contains a newly created instance of AmbientDevice.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/photosambient.mediaitems