# REST Resource: photo

- [Resource: Photo](https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo)
  - [JSON representation](https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo.SCHEMA_REPRESENTATION)
- [PhotoId](https://developers.google.com/streetview/publish/reference/rest/v1/photo#PhotoId)
  - [JSON representation](https://developers.google.com/streetview/publish/reference/rest/v1/photo#PhotoId.SCHEMA_REPRESENTATION)
- [UploadRef](https://developers.google.com/streetview/publish/reference/rest/v1/photo#UploadRef)
  - [JSON representation](https://developers.google.com/streetview/publish/reference/rest/v1/photo#UploadRef.SCHEMA_REPRESENTATION)
- [Pose](https://developers.google.com/streetview/publish/reference/rest/v1/photo#Pose)
  - [JSON representation](https://developers.google.com/streetview/publish/reference/rest/v1/photo#Pose.SCHEMA_REPRESENTATION)
- [LatLng](https://developers.google.com/streetview/publish/reference/rest/v1/photo#LatLng)
  - [JSON representation](https://developers.google.com/streetview/publish/reference/rest/v1/photo#LatLng.SCHEMA_REPRESENTATION)
- [Level](https://developers.google.com/streetview/publish/reference/rest/v1/photo#Level)
  - [JSON representation](https://developers.google.com/streetview/publish/reference/rest/v1/photo#Level.SCHEMA_REPRESENTATION)
- [Connection](https://developers.google.com/streetview/publish/reference/rest/v1/photo#Connection)
  - [JSON representation](https://developers.google.com/streetview/publish/reference/rest/v1/photo#Connection.SCHEMA_REPRESENTATION)
- [Place](https://developers.google.com/streetview/publish/reference/rest/v1/photo#Place)
  - [JSON representation](https://developers.google.com/streetview/publish/reference/rest/v1/photo#Place.SCHEMA_REPRESENTATION)
- [TransferStatus](https://developers.google.com/streetview/publish/reference/rest/v1/photo#TransferStatus)
- [MapsPublishStatus](https://developers.google.com/streetview/publish/reference/rest/v1/photo#MapsPublishStatus)
- [Methods](https://developers.google.com/streetview/publish/reference/rest/v1/photo#METHODS_SUMMARY)

## Resource: Photo

Photo is used to store 360 photos along with photo metadata.

| JSON representation |
|---|
| ``` { "photoId": { object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#PhotoId`) }, "uploadReference": { object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#UploadRef`) }, "downloadUrl": string, "thumbnailUrl": string, "shareLink": string, "pose": { object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#Pose`) }, "connections": [ { object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#Connection`) } ], "captureTime": string, "uploadTime": string, "places": [ { object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#Place`) } ], "viewCount": string, "transferStatus": enum (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#TransferStatus`), "mapsPublishStatus": enum (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#MapsPublishStatus`) } ``` |

| Fields ||
|---|---|
| `photoId` | ``object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#PhotoId`)`` Required. Output only. Required when updating a photo. Output only when creating a photo. Identifier for the photo, which is unique among all photos in Google. |
| `uploadReference` | ``object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#UploadRef`)`` Input only. Required when creating a photo. Input only. The resource URL where the photo bytes are uploaded to. |
| `downloadUrl` | `string` Output only. The download URL for the photo bytes. This field is set only when `https://developers.google.com/streetview/publish/reference/rest/v1/photo/get#body.QUERY_PARAMETERS.view` is set to `https://developers.google.com/streetview/publish/reference/rest/v1/PhotoView#ENUM_VALUES.INCLUDE_DOWNLOAD_URL`. |
| `thumbnailUrl` | `string` Output only. The thumbnail URL for showing a preview of the given photo. |
| `shareLink` | `string` Output only. The share link for the photo. |
| `pose` | ``object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#Pose`)`` Optional. Pose of the photo. |
| `connections[]` | ``object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#Connection`)`` Optional. Connections to other photos. A connection represents the link from this photo to another photo. |
| `captureTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Optional. Absolute time when the photo was captured. When the photo has no exif timestamp, this is used to set a timestamp in the photo metadata. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `uploadTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Time when the image was uploaded. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `places[]` | ``object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#Place`)`` Optional. Places where this photo belongs. |
| `viewCount` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. View count of the photo. |
| `transferStatus` | ``enum (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#TransferStatus`)`` Output only. Status of rights transfer on this photo. |
| `mapsPublishStatus` | ``enum (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#MapsPublishStatus`)`` Output only. Status in Google Maps, whether this photo was published or rejected. |

## PhotoId

Identifier for a `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo`.

| JSON representation |
|---|
| ``` { "id": string } ``` |

| Fields ||
|---|---|
| `id` | `string` A unique identifier for a photo. |

## UploadRef

Upload reference for media files.

| JSON representation |
|---|
| ``` { // Union field `file_source` can be only one of the following: "uploadUrl": string // End of list of possible types for union field `file_source`. } ``` |

| Fields ||
|---|---|
| Union field `file_source`. Required. `file_source` can be only one of the following: ||
| `uploadUrl` | `string` An upload reference should be unique for each user. It follows the form: "https://streetviewpublish.googleapis.com/media/user/{account_id}/photo/{uploadReference}" |

## Pose

Raw pose measurement for an entity.

| JSON representation |
|---|
| ``` { "latLngPair": { object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#LatLng`) }, "altitude": number, "heading": number, "pitch": number, "roll": number, "gpsRecordTimestampUnixEpoch": string, "level": { object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#Level`) }, "accuracyMeters": number } ``` |

| Fields ||
|---|---|
| `latLngPair` | ``object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#LatLng`)`` Latitude and longitude pair of the pose, as explained here: <https://cloud.google.com/datastore/docs/reference/rest/Shared.Types/LatLng> When creating a `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo`, if the latitude and longitude pair are not provided, the geolocation from the exif header is used. A latitude and longitude pair not provided in the photo or exif header causes the photo process to fail. |
| `altitude` | `number` Altitude of the pose in meters above WGS84 ellipsoid. NaN indicates an unmeasured quantity. |
| `heading` | `number` The following pose parameters pertain to the center of the photo. They match <https://developers.google.com/streetview/spherical-metadata>. Compass heading, measured at the center of the photo in degrees clockwise from North. Value must be \>=0 and \<360. NaN indicates an unmeasured quantity. |
| `pitch` | `number` Pitch, measured at the center of the photo in degrees. Value must be \>=-90 and \<= 90. A value of -90 means looking directly down, and a value of 90 means looking directly up. NaN indicates an unmeasured quantity. |
| `roll` | `number` Roll, measured in degrees. Value must be \>= 0 and \<360. A value of 0 means level with the horizon. NaN indicates an unmeasured quantity. |
| `gpsRecordTimestampUnixEpoch` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Time of the GPS record since UTC epoch. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `level` | ``object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#Level`)`` Level (the floor in a building) used to configure vertical navigation. |
| `accuracyMeters` | `number` The estimated horizontal accuracy of this pose in meters with 68% confidence (one standard deviation). For example, on Android, this value is available from this method: <https://developer.android.com/reference/android/location/Location#getAccuracy()>. Other platforms have different methods of obtaining similar accuracy estimations. |

## LatLng

An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the [WGS84 standard](https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version). Values must be within normalized ranges.

| JSON representation |
|---|
| ``` { "latitude": number, "longitude": number } ``` |

| Fields ||
|---|---|
| `latitude` | `number` The latitude in degrees. It must be in the range \[-90.0, +90.0\]. |
| `longitude` | `number` The longitude in degrees. It must be in the range \[-180.0, +180.0\]. |

## Level

Level information containing level number and its corresponding name.

| JSON representation |
|---|
| ``` { "number": number, "name": string } ``` |

| Fields ||
|---|---|
| `number` | `number` Optional. Floor number, used for ordering. 0 indicates the ground level, 1 indicates the first level above ground level, -1 indicates the first level under ground level. Non-integer values are OK. |
| `name` | `string` Required. A name assigned to this Level, restricted to 3 characters. Consider how the elevator buttons would be labeled for this level if there was an elevator. |

## Connection

A connection is the link from a source photo to a destination photo.

| JSON representation |
|---|
| ``` { "target": { object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#PhotoId`) } } ``` |

| Fields ||
|---|---|
| `target` | ``object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#PhotoId`)`` Required. The destination of the connection from the containing photo to another photo. |

## Place

Place metadata for an entity.

| JSON representation |
|---|
| ``` { "placeId": string, "name": string, "languageCode": string } ``` |

| Fields ||
|---|---|
| `placeId` | `string` Place identifier, as described in <https://developers.google.com/places/place-id>. |
| `name` | `string` Output only. The name of the place, localized to the languageCode. |
| `languageCode` | `string` Output only. The languageCode that the name is localized with. This should be the languageCode specified in the request, but may be a fallback. |

## TransferStatus

Status of rights transfer.

| Enums ||
|---|---|
| `TRANSFER_STATUS_UNKNOWN` | The status of this transfer is unspecified. |
| `NEVER_TRANSFERRED` | This photo has never been in a transfer. |
| `PENDING` | This photo transfer has been initiated, but the receiver has not yet responded. |
| `COMPLETED` | The photo transfer has been completed, and this photo has been transferred to the recipient. |
| `REJECTED` | The recipient rejected this photo transfer. |
| `EXPIRED` | The photo transfer expired before the recipient took any action. |
| `CANCELLED` | The sender cancelled this photo transfer. |
| `RECEIVED_VIA_TRANSFER` | The recipient owns this photo due to a rights transfer. |

## MapsPublishStatus

Publication status of the photo in Google Maps.

| Enums ||
|---|---|
| `UNSPECIFIED_MAPS_PUBLISH_STATUS` | The status of the photo is unknown. |
| `PUBLISHED` | The photo is published to the public through Google Maps. |
| `REJECTED_UNKNOWN` | The photo has been rejected for an unknown reason. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/streetview/publish/reference/rest/v1/photo/create` | After the client finishes uploading the photo with the returned `https://developers.google.com/streetview/publish/reference/rest/v1/photo#UploadRef`, `https://developers.google.com/streetview/publish/reference/rest/v1/photo/create#google.streetview.publish.v1.StreetViewPublishService.CreatePhoto` publishes the uploaded `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo` to Street View on Google Maps. |
| ### `https://developers.google.com/streetview/publish/reference/rest/v1/photo/delete` | Deletes a `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo` and its metadata. |
| ### `https://developers.google.com/streetview/publish/reference/rest/v1/photo/get` | Gets the metadata of the specified `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo`. |
| ### `https://developers.google.com/streetview/publish/reference/rest/v1/photo/startUpload` | Creates an upload session to start uploading photo bytes. |
| ### `https://developers.google.com/streetview/publish/reference/rest/v1/photo/update` | Updates the metadata of a `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo`, such as pose, place association, connections, etc. |