Ad account Not found error

api

#1

{“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.


#2

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


#3

I am using that code

// Create twitter ads client
$twitterAds = new TwitterAds(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET,true);

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

”;
print_r($twitterAds); die;

#4

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.

Regards


#5

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?


#6

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.


#7

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.

Thanks!


#8

ok will try it, how do I get targeting location code "'00a8b25e420adc94"
like here you are doing here –
$targetingCriteria = new TargetingCriteria($account);
$targetingCriteria->setLineItemId($lineItem->getId());
$targetingCriteria->setTargetingType(‘LOCATION’);
$targetingCriteria->setTargetingValue(‘00a8b25e420adc94’);
$targetingCriteria->save();

can we also pass age range and gender option too?


#9

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();


#10

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