https://googleads.googleapis.com/v2/customers/9032841878/googleAds:search
['query' => 'SELECT campaign.id,campaign.name,metrics.impressions, metrics.clicks, metrics.ctr FROM ad']
Array
(
[error] => Array
(
[code] => 400
[message] => Request contains an invalid argument.
[status] => INVALID_ARGUMENT
[details] => Array
(
[0] => Array
(
[@type] => type.googleapis.com/google.ads.googleads.v2.errors.GoogleAdsFailure
[errors] => Array
(
[0] => Array
(
[errorCode] => Array
(
[queryError] => PROHIBITED_RESOURCE_TYPE_IN_FROM_CLAUSE
)
[message] => ad may not be used in FROM clause in this service.
)
)
)
)
)
[code] => 400
)
Hello Sergey,
Thank you for reaching out. From the shared details, I understand you are trying to use cURL to retrieve the ads details from your Google Ads account. The error 'PROHIBITED_RESOURCE_TYPE_IN_FROM_CLAUSE' is observed as you are trying to query the ad resource in your FROM clause instead of ad_group_ad resource which is available via Google Ads API Beta. Could you please modify the report query and let me know if you still have any issues?
Regards,
Nikisha Patel, Google Ads API Team