Hi all,
previously, the AdWords API allowed downlaoding the results of a BatchJob through a downloadUrl which had detailed information on the resulting items created by the batch job. This included, in the case of Ad Groups:
$adGroup->getCampaignName(),
$adGroup->getName(),
$adGroup->getId()
the parent Campaign Name, the Ad Group Name, and the Ad Group Id.
In the Google Ads API, all we get in the response:
foreach ($batchJobResults->iterateAllElements() as $batchJobResult) {
/** @var BatchJobResult $batchJobResult */
printf(
"Batch job #%d has a status '%s' and response of type '%s'.%s",
$batchJobResult->getOperationIndex(),
$batchJobResult->getStatus()
? $batchJobResult->getStatus()->getMessage() : 'N/A',
$batchJobResult->getMutateOperationResponse()
? $batchJobResult->getMutateOperationResponse()->getResponse()
: 'N/A',
PHP_EOL
);
}
is basically nothing else than only the resource name. However, as you do not know the resource name in advance, there is no way to check which item has actually been created. You would have to make a new request to query the API for the details of the resource name, or worse yet, get an entire report on the elements of the account, in this case, the Ad Groups.
Is there a way to get a more detailed batch job result response, like in the elder days?