Pulling LabelID from LabelName AWQL

19 views
Skip to first unread message

Ildar Khakimov

unread,
Dec 2, 2016, 10:46:49 PM12/2/16
to AdWords API Forum

Hello

I'm trying to execute this query:
SELECT LabelId FROM LABEL_REPORT WHERE LabelName='mtl-mansion-for-sale'

But it throws an error:
An error has occurred: [QueryError{reason=INVALID_FROM_CLAUSE, message=}] 


We first get the "CampaignService" which loads the required class using the following snippet:
$campaignService = $user->GetService('CampaignService', ADWORDS_VERSION);

Could you please advise?

Using Adwords PHP library

Joyce Lava

unread,
Dec 4, 2016, 9:49:12 PM12/4/16
to AdWords API Forum
Hi Ildar,

If you wish to use AWQL with reports, you should not use any API service. You would have to generate it using reporting configuration. An example code from PHP client library can be found here.

However, if you wish to use AWQL with service calls, then the FROM clause is not needed and the service should be LabelService instead of CampaignService.

Regards,
Joyce, AdWords API Team
Reply all
Reply to author
Forward
0 new messages