Ad account Not found error


{“errors”:[{“code”:“NOT_FOUND”,“message”:“Account 18ce54ccn6w was not found”}],“request”:{“params”:{}}}

Getting this error
I don’t understand why it is coming, I am new to twitter.


Hi @rajanbhadauria! Welcome! :slight_smile: What request are you making? Please tell us the full raw request url, parameters included.


I am using that code

// Create twitter ads client

// Retrieve account information
$account = $twitterAds->getAccounts(ACCOUNT_ID);
echo “

print_r($twitterAds); die;


Hi @rajanbhadauria,

Seeing your code, it looks like you’re using my library, Am I Right? Twitter Ads PHP SDK

It looks like you’re trying to access to an account (with the ACCOUNT_ID information), but I’m noticing that youre atacking the SANDBOX API since you put TRUE at the end of the creation of the TwitterAds object.

Ads Accounts are totally different in Sandbox and production mode. You will not find your account in sandbox, you will find a totally different account.



yes I am using your library, Thank you for such a useful library.

I wanted to test your library with out giving Credit card. Is there any way to do that?


Hi @rajanbhadauria! While in sandbox, make the request GET accounts to see what your account id is in the sandbox.
In sandbox, you are being assigned a temporary account with which you need to make calls.


Thaks for your feedback,

Why do you need a credit card on my library?

You need it in order to promote tweets in the ads API, but i not require nothing similar.

Also, in the sandbox enviorment you can create funding_instruments (AKA payment methods) that are fake.



ok will try it, how do I get targeting location code "'00a8b25e420adc94"
like here you are doing here –
$targetingCriteria = new TargetingCriteria($account);

can we also pass age range and gender option too?


Yes, you can do it.

You only need to select the correct targeting type and the targeting value.

$targetingCriteria = new TargetingCriteria($account); $targetingCriteria->setLineItemId($lineItem->getId()); $targetingCriteria->setTargetingType('GENDER'); $targetingCriteria->setTargetingValue('VALUE'); $targetingCriteria->save();


@rajanbhadauria: for age targeting, make sure you have the AGE_TARGETING account feature enabled.