Hello,
Thank you for reaching out to us.
Can you further elaborate on your concern so we can better assist you? Can you also share to us the complete API logs (request and response with request-id)?
Please send the requested details via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.
Regards,
Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
|
||||||
Hello,
Thank you for reaching out to us.
Can you further elaborate on your concern so we can better assist you? Can you also share to us the complete API logs (request and response with request-id)?
Please send the requested details via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsapi-support@google.com alias instead.
Regards,
Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
Hello Shirly,
Thank you for reaching out to us.
Can you also share to us the complete API logs (request and response with request-id) generated when the error was encountered? Since you're using PHP, you can enable logging via this guide.
You can then send those requested details via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.
Regards,
AssetOperation operation = AssetOperation.newBuilder()
.setCreate(Asset.newBuilder()
.setCallAsset(CallAsset.newBuilder()
.setCountryCode(countryCode).setPhoneNumber(phone)))
.build();
String resourceName;
// Gets the Asset Service client.
try (AssetServiceClient assetServiceClient = client.createAssetServiceClient()) {
// Issues the request and returns the resource name of the new Promotion asset.
MutateAssetsResponse response = assetServiceClient.mutateAssets(String.valueOf(customerId),
ImmutableList.of(operation));
resourceName = response.getResults(0).getResourceName();
log.info("Created CallAsset with resource name " + resourceName);
} catch (ApiException e) {
throw new ExternalApiException(e);
}
CampaignAssetOperation op = CampaignAssetOperation
.newBuilder().setCreate(CampaignAsset.newBuilder().setAsset(resourceName)
.setFieldType(AssetFieldType.CALL).setCampaign(ResourceNames.campaign(customerId, campaignId)))
.build();
// Creates a service client.
try (CampaignAssetServiceClient campaignAssetServiceClient = client.createCampaignAssetServiceClient()) {
// Issues the mutate request.
MutateCampaignAssetsResponse response = campaignAssetServiceClient
.mutateCampaignAssets(String.valueOf(customerId), Lists.newArrayList(op));
// Prints some information about the result.
for (MutateCampaignAssetResult result : response.getResultsList()) {
log.info("Attached CallAsset to campaign");
}
} catch (ApiException e) {
throw new ExternalApiException(e);
}
|
||||||