Unable to retrieve multiple AudienceSegment

29 views
Skip to first unread message

Olivier Rougereau

unread,
Oct 22, 2023, 10:54:16 PM10/22/23
to Google Ads API and AdWords API Forum
Hello,

I use PHP SDK 202305 and I always have a parsing error when I try to request multiple audience segments using the function getAudienceSegmentsByStatement().

With this statement I have a ParseError.UNPARSABLE:

$statementBuilder = (new StatementBuilder())
->where('name IN (:names) AND status = :status')
->withBindVariableValue('names', ['AAA', 'BBB'])
->withBindVariableValue('status', AudienceSegmentStatus::ACTIVE);


With this statement it works well:

$statementBuilder = (new StatementBuilder())
->where('name IN (\'AAA', \'BBB\') AND status = :status')
->withBindVariableValue('status', AudienceSegmentStatus::ACTIVE);

I don't understand why. I use this type of statement in various services without errors.

Any idea? A bug?

Thanks for your help.

Google Ads API Forum Advisor

unread,
Oct 23, 2023, 3:17:46 AM10/23/23
to adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

By reviewing your query, I understand that you are getting a parsing error while trying to request multiple audience segments using the function getAudienceSegmentsByStatement().

Could you please confirm if you are using Google Ads API? If yes, then I would kindly request you to provide us with the complete API logs (request and response logs with request-id and request header) generated at your end to better assist you on this request. 

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02pVNww:ref"

Thanks,
 
Google Logo Google Ads API Team

 

Reply all
Reply to author
Forward
0 new messages