Resource: MediaItem
A single media item.
JSON representation | |
---|---|
{ "name": string, "mediaFormat": enum ( |
Fields | ||
---|---|---|
name |
The resource name for this media item. |
|
mediaFormat |
The format of this media item. Must be set when the media item is created, and is read-only on all other requests. Cannot be updated. |
|
locationAssociation |
Required when calling This is required when adding new media to a location with |
|
googleUrl |
Output only. Google-hosted URL for this media item. This URL is not static since it may change over time. For video this will be a preview image with an overlaid play icon. |
|
thumbnailUrl |
Output only. Where provided, the URL of a thumbnail image for this media item. |
|
createTime |
Output only. Creation time of this media item. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
|
dimensions |
Output only. The dimensions (width and height) in pixels. |
|
insights |
Output only. Statistics for this media item. |
|
attribution |
Output only. Attribution information for customer media items. You must display this attribution as provided to your users and must not delete or alter the attribution. |
|
description |
Description for this media item. Descriptions cannot be modified through the Google My Business API, but can be set when creating a new media item that is not a cover photo. |
|
Union field With the exception of All uploaded photos should follow the Business Profile guidelines for photos. |
||
sourceUrl |
A publicly accessible URL where the media item can be retrieved from. When creating one of this or dataRef must be set to specify the source of the media item. If This field cannot be updated. |
|
dataRef |
Input only. A reference to media item binary data as obtained by the When creating a media item, either
or
must be set. |
MediaItemDataRef
Reference to the photo binary data of a MediaItem
uploaded through the Google My Business API.
Create a data ref using media.startUpload
, and use this ref when uploading bytes to [media.upload] and subsequently calling media.create
.
JSON representation | |
---|---|
{ "resourceName": string } |
Fields | |
---|---|
resourceName |
The unique ID for this media item's binary data. Used to upload the photo data with [media.upload] and when creating a new media item from those bytes with Example of uploading bytes: For |
MediaFormat
Enum for media format.
Enums | |
---|---|
MEDIA_FORMAT_UNSPECIFIED |
Format unspecified. |
PHOTO |
Media item is a photo. In this version, only photos are supported. |
VIDEO |
Media item is a video. |
LocationAssociation
How the media item is associated with its location.
JSON representation | |
---|---|
{ // Union field |
Fields | ||
---|---|---|
Union field location_attachment_type . Location media must either have a category or the ID of a price list item that they are associated with. Non-location media (for example, local post photos) must have neither. location_attachment_type can be only one of the following: |
||
category |
The category that this location photo belongs to. |
|
priceListItemId |
The ID of a price list item that this location photo is associated with. |
Category
Enum for media item category.
Enums | |
---|---|
CATEGORY_UNSPECIFIED |
Unspecified category. |
COVER |
Cover photo. A location has only one cover photo. |
PROFILE |
Profile photo. A location has only one profile photo. |
LOGO |
Logo photo. |
EXTERIOR |
Exterior media. |
INTERIOR |
Interior media. |
PRODUCT |
Product media. |
AT_WORK |
'At-work' media. |
FOOD_AND_DRINK |
Food and drink media. |
MENU |
Menu media. |
COMMON_AREA |
Common area media. |
ROOMS |
Rooms media. |
TEAMS |
Teams media. |
ADDITIONAL |
Additional, uncategorized media. |
Dimensions
Dimensions of the media item.
JSON representation | |
---|---|
{ "widthPixels": integer, "heightPixels": integer } |
Fields | |
---|---|
widthPixels |
Width of the media item, in pixels. |
heightPixels |
Height of the media item, in pixels. |
MediaInsights
Insights and statistics for the media item.
JSON representation | |
---|---|
{ "viewCount": string } |
Fields | |
---|---|
viewCount |
Output only. The number of times the media item has been viewed. |
Attribution
Attribution information for customer media items, such as the contributor's name and profile picture.
JSON representation | |
---|---|
{ "profileName": string, "profilePhotoUrl": string, "takedownUrl": string, "profileUrl": string } |
Fields | |
---|---|
profileName |
The user name to attribute the media item to. |
profilePhotoUrl |
URL of the attributed user's profile photo thumbnail. |
takedownUrl |
The URL of the takedown page, where the media item can be reported if it is inappropriate. |
profileUrl |
The URL of the attributed user's Google Maps profile page. |
Methods |
|
---|---|
|
Creates a new media item for the location. |
|
Deletes the specified media item. |
|
Returns metadata for the requested media item. |
|
Returns a list of media items associated with a location. |
|
Updates metadata of the specified media item. |
|
Generates a MediaItemDataRef for media item uploading. |