[SearchAccounts] Error 3030 Predicate passed in search is invalid

Lonny Kapelushnik 16 Reputation points

I am using the PHP SDK (https://github.com/BingAds/BingAds-PHP-SDK) to get data from our Ads and am running into an issue. I originally posted this as a GH issue (https://github.com/BingAds/BingAds-PHP-SDK/issues/145), but I think here may be more appropriate.

When calling SearchAccounts I am receiving "Predicate passed in search is invalid" regardless of which predicate is passed in. I copied the code and modified from your samples. I don't believe I've done anything wrong.

I can confirm that the OAuthToken is valid and that when it expires I'm able to use the same OAuthWebAuthCodeGrant and AuthorizationData to generate new tokens from the refresh token.

Here is a sample of the PHP code (I adapted this code from https://github.com/BingAds/BingAds-PHP-SDK/blob/main/samples/V13/AuthHelper.php#L145-L166):

$authentication = (new OAuthWebAuthCodeGrant())

$this->authorizationData = (new AuthorizationData())


$page = 0;
$limit = 1000;
$proxy = new ServiceClient(

$pageInfo = new Paging();
$pageInfo->Index = $page;
$pageInfo->Size = $limit;

$predicate = new Predicate();
$predicate->Field = 'AccountLifeCycleStatus';
$predicate->Operator = PredicateOperator::Equals;
$predicate->Value = 'Active';

$request = new SearchAccountsRequest();
$request->Ordering = null;
$request->PageInfo = $pageInfo;
$request->Predicates = [$predicate];


Here is the XML generated from calling $proxy->GetService()->__getLastRequest():

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://bingads.microsoft.com/Customer/v13/Entities" xmlns:ns2="https://bingads.microsoft.com/Customer/v13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <ns2:Ordering xsi:nil="true"/>

And here is the response I receive:

{"ApiFault":{"TrackingId":"51977592-dc41-471b-83d9-5eded4974e17","OperationErrors":{"OperationError":{"Code":"3030","Details":"","Message":"Predicate passed in search is invalid."}}}}
Microsoft Advertising API
Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
296 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Eric Urban - MSFT 621 Reputation points Microsoft Employee

    @Lonny Kapelushnik - Per documentation:

    If the predicate Field is set to "AccountLifeCycleStatus", then you must specify one additional predicate with the Field set to another value such as UserId.

    Please let me know if this resolves the issue or if you have any follow up questions.