Reach estimate returns error with a valid geo location id

location
geo
reach-estimation
api

#1

this works just fine with data below
"data": { "product_type": "PROMOTED_TWEETS", "currency": "USD", "objective": "TWEET_ENGAGEMENTS", "campaign_daily_budget_amount_local_micro": 10000, "broad_keywords":"dog", }

but with this below, not working.
"data": { "product_type": "PROMOTED_TWEETS", "currency": "USD", "objective": "TWEET_ENGAGEMENTS", "campaign_daily_budget_amount_local_micro": 10000, "broad_keywords":"dog", "locations": "3b77caf94bfc81fe" }

3b77caf94bfc81fe is for Los Angeles city

this is what I got

Object
code
:
"NOT_FOUND"
message
:
“Location(s) 3b77caf94bfc81fe was not found”


#2

Hi, @zirho6.

For location, using the GET targeting_criteria/locations endpoint should return a targeting value of e4315a8602024dcb for “Los Angeles CA, CA, USA.”

$ twurl -H ads-api.twitter.com "/1/targeting_criteria/locations?q=Los Angeles" | jq .

{
  "data_type": "targeting_criterion",
  "data": [
    {
      "name": "Los Angeles CA, CA, USA",
      "country_code": "US",
      "location_type": "CITY",
      "targeting_value": "e4315a8602024dcb",
      "targeting_type": "LOCATION"
    },
    ...
  ],
  "request": {
    "params": {
      "q": "Los Angeles"
    }
  },
  "next_cursor": null
}

If there are still issues after replacing the location targeting value, please post your full request. We encourage you to do so using twurl.


#3

It turned out that I was looking at two different end points.

I thought ad api uses generic rest apis for them to consume too but it does not.

I think you happen to answered all my questions including other questions too.

Thank you a lot.


#4

Glad to hear it, @zirho6! Thanks for confirming.


#5

Hey @juanshishido,
I tried use twurl cli tool for testing it out. but getting an error
I followed instructions to authenticate it with twitter app.

But what I am getting is this

twurl -H ads-api.twitter.com “/1/targeting_criteria/locations?q=Los Angeles” | jq .

{
“errors”: [
{
“code”: “UNAUTHORIZED_CLIENT_APPLICATION”,
“message”: “The client application making this request does not have access to this API”
}
],
“request”: {
“params”: {}
}
}

I tried find solution in the forum but no luck.

I successfully made lots of api calls with the php library

They seem like using different auth method.

I can’t find any place to make a request for ads api permission.
Can you help me out with this?

FYI, I can successfully made an api request for stream api.

Thank you in advance!


#6

Hi @zirho6,

Have you applied for Ads API access before? Please view some general info here: https://dev.twitter.com/ads/overview

And apply here: https://dev.twitter.com/form/ads-api-access-developer

After that, I can review your application and whitelist!
Carmen


#7

@zirho6: This sounds like the application you are trying to use does not have Ads API access. Please follow up with @carmenjyuen if this is the case.

Otherwise, this information might be useful: Setting up twurl.

Thanks!


#8

Hi @carmenjyuen,

I am trying to figure out if we have.
The account is managed by someone else and being used with other people.

Is this because this tool twurl uses app to talk to ads-api?
because other libraries use access token to talk to ads-api without any approval of application.

Thanks both of you

@juanshishido


#9

Hi @zirho6,

Can you let me know what App ID you are using? I can check your access.
Carmen


#10

Hi @carmenjyuen

Here you go.

12733235

Thanks!


#11

Hi @zirho6,

So confirming that 12733235 app ID doesn’t have ads api access, but it looks like your company already has another application that has access. Can you email me at cyuen@twitter.com to discuss more in detail?
Carmen


#12

Sure I will.

Thank you so much for the help.


#13