Hi,
Thank you for reaching out to the Google Ads API support team.
I understand that you are looking for a specific example for the
ShareablePreviewService for reviewing the performance max asset group ads using the Google Ads API. Kindly note that officially there is no specific example in the Google Ads API documentation for using this service. Kindly note that after creating asset groups and linking assets to them, you can generate a shareable preview to showcase how the ads created from each asset group will appear. You need to pass the asset group IDs to
ShareablePreviewService.GenerateShareablePreviews, you can obtain URLs for the ad previews, along with their expiration timestamps, which can be shared with your users. You can use this
method for making an API call using the Google Ads API. However, I have created from my end and provided you the sample request and response logs for your reference.
Request Body:
==============
POST https://googleads.googleapis.com/v18/customers/{customer ID}:generateShareablePreviews?key=[YOUR_API_KEY] HTTP/1.1
developer-token: **********************
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json
{
"shareablePreviews": [
{
"assetGroupIdentifier": {
"assetGroupId": {assetGroupID}
}
}
]
}
Response:
==========
HTTP/1.1 200
content-encoding: gzip
content-length: 362
content-type: application/json; charset=UTF-8
date: Fri, 13 Dec 2024 01:29:01 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"responses": [
{
"shareablePreviewResult": {
"shareablePreviewUrl": "{URL}",
"expirationDateTime": "2024-12-27 06:59:01.098"
},
"assetGroupIdentifier": {
"assetGroupId": "{asset group ID}"
}
}
]
}
I hope this helps.
