"unauthorized_access",

api-access
ads
api

#1

Hi there,

I am starting with the Ads API but I get the “UNAUTHORIZED_ACCESS” error. I read in some posts here that I should sing-up to have ads access but once I have asked for access none has reply yet and I still get the same access. APP ID: 13212780. Please help.

Thanks in advance.
Sergio


#2

Hi @justplan_io,

We whitelist applications every 2-3 business days, so you are in the next round for today! Thanks for your patience.
Carmen


#3

All fine!! Thanks, Sergio


#4

Hello Carmen, Its me again, sorry to be annoying.

I am trying to get started on Ads API and is not working I still get the authorise error. For example the only thing can do is getting accounts.

{
“request”: {
“params”: {}
},
“data”: [
{
“name”: “Sergio”,
“business_name”: null,
“timezone”: “Europe/Madrid”,
“timezone_switch_at”: “2016-12-13T23:00:00Z”,
“id”: “XXXX”,
“created_at”: “2016-12-15T17:19:59Z”,
“salt”: “61be143f818736f0a9c9XXXX”,
“updated_at”: “2016-12-19T21:57:11Z”,
“business_id”: null,
“approval_status”: “ACCEPTED”,
“deleted”: false
}
],
“data_type”: “account”,
“total_count”: 1,
“next_cursor”: null
}

Any help please?

Thanks!
Sergio


#5

Also when I use Twurl I get something like:


#6

@justplan_io: Could you please provide example requests and responses (using twurl)—one for a successful call and one for an unsuccessful one?


#7

C:\Users\srami>twurl -t -H “ads-api.twitter.com” "/1/accounts"
opening connection to ads-api.twitter.com:443
opened
starting SSL for ads-api.twitter.com:443
SSL established
<- “GET /1/accounts HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: /\r\nUser-Agent: OAuth gem v0.5.1\r\nContent-Type: application/x-www-form-urlencoded\r\nAuthorization: OAuth oauth_consumer_key=“c3V3hADNQyGZKqqWPngqdZJcG”, oauth_nonce=“Mi1hNcM9hFIbSb5Pg4CXInXR6KZsyRAjQp1xRRK43w”, oauth_signature=“xES1lYCp%2BClkOTVByy7981jqsK0%3D”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1482259011”, oauth_token=“802465619648061440-9FQXAHPPqAoyl4fGKuf84qssJy1o2n4”, oauth_version=“1.0”\r\nConnection: close\r\nHost: ads-api.twitter.com\r\nContent-Length: 0\r\n\r\n”
<- “”
-> “HTTP/1.1 200 OK\r\n”
-> “connection: close\r\n”
-> “content-disposition: attachment; filename=json.json\r\n”
-> “content-encoding: gzip\r\n”
-> “content-length: 291\r\n”
-> “content-type: application/json;charset=utf-8\r\n”
-> “date: Tue, 20 Dec 2016 18:36:50 GMT\r\n”
-> “server: tsa_f\r\n”
-> “set-cookie: guest_id=v1%3A148225901092541676; Domain=.twitter.com; Path=/; Expires=Thu, 20-Dec-2018 18:36:50 UTC\r\n”
-> “strict-transport-security: max-age=631138519\r\n”
-> “x-access-level: read-write-directmessages\r\n”
-> “x-api-version: 1.0\r\n”
-> “x-connection-hash: b92779ed12401226aa521f7df1138f4c\r\n”
-> “x-content-type-options: nosniff\r\n”
-> “x-frame-options: SAMEORIGIN\r\n”
-> “x-rate-limit-limit: 2000\r\n”
-> “x-rate-limit-remaining: 1999\r\n”
-> “x-rate-limit-reset: 1482259910\r\n”
-> “x-response-time: 118\r\n”
-> “x-runtime: 0.010274\r\n”
-> “x-transaction: 001ee90900152b31\r\n”
-> “x-xss-protection: 1; mode=block\r\n”
-> “\r\n"
reading 291 bytes…
-> “”
-> “\x1F\x8B\b\x00\x00\x00\x00\x00\x00\x00lPKO\x84@\f\xFE/=\xB3\x91\xF2Z\x98\x9BY\xF7hb”\xA7UC\xCAP\x94\r\xCB\x8C\xF3\xF0E\xF8\xEF\x0E\xE1\xA01&=L\xFB=:\xFDf0\xFC\xEA\xD9:\x103h2t\xB1\xE1\xB5,\x11t\xE4\b\xC4\xC3\f\x13]\x18\x04\xDC\xB3y\x1E\x14D\xD0z;Llm\xB3\x01\x93\x1F\xC7\b\xDCp\xE1/5\xAD\xC4\xA37J\xF3\xE3\xD5-uf\xE8\xE0\ak\xEC\xFB\xE0\xE4KCa\x19$1\x16;Lv\x98\xD6I*\xE28\xD4)p\x83@\x00\x96\x92\xF3\xAC\xD7\xE7\xF4\x1CF\xD209\xEE\xFE\xC8\xF2\x1A\xF7\x02+\x91W\xAB\xCC\xD2\xB8\xA2\x05\xB6\x8CY\xDA\x97X\xEE\xD3\xA2\x8F\xA9\x92\x95l1+\xAB\xACM\xB3\xAC\rL\xAF\xBB\x7F\xDC\xAA:A\x91\aC<\xFD\xBEp\xFD\xCDv\x1Fim\xD4\e\x8D\x8Du\xE4|\xC8\b\xAE\x0F\x87\xE3]}\xBC\t\xFC\x8EG\x0E\x9E z\x1A-/O[x\x8D\xFB\xD4k\x1E$\xA5\xF2\x93[\x83P.8l\x9D\xC0\b&\xFEp\x8D\xF4\xC6*\xB3\xEDY\xBE\x01\x00\x00\xFF\xFF\x03\x00\xA5\xB8\x12~\x8F\x01\x00\x00”
{“request”:{“params”:{}},“data”:[{“name”:“Sergio”,“business_name”:null,“timezone”:“Europe/Madrid”,“timezone_switch_at”:“2016-12-13T23:00:00Z”,“id”:“18ce54fpj3j”,“created_at”:“2016-12-15T17:19:59Z”,“salt”:“61be143f818736f0a9c9cb14894b344b”,“updated_at”:“2016-12-19T21:57:11Z”,“business_id”:null,“approval_status”:“ACCEPTED”,“deleted”:false}],“data_type”:“account”,“total_count”:1,“next_cursor”:null}read 291 bytes
Conn close

=====

C:\Users\srami>twurl -H ads-api.twitter.com /118ce54f/accounts/18ce53yytmv/campaign
{“errors”:[{“code”:“ROUTE_NOT_FOUND”,“message”:“The requested resource could not be found”}],“request”:{“params”:{}}}
C:\Users\srami>twurl -H ads-api.twitter.com /0/accounts/18ce54fpj3j/campaigns
{“errors”:[{“code”:“INVALID”,“message”:“Version 0.0 is not available.”}],“request”:{“params”:{}}}
C:\Users\srami>twurl -H ads-api.twitter.com /1/accounts/18ce54fpj3j/campaigns
{“errors”:[{“code”:“ACCOUNT_LOCKED_OUT”,“message”:“Account is locked out”}],“request”:{“params”:{}}}
C:\Users\srami>twurl -t -H ads-api.twitter.com /1/accounts/18ce54fpj3j/campaigns
opening connection to ads-api.twitter.com:443
opened
starting SSL for ads-api.twitter.com:443
SSL established
<- “GET /1/accounts/18ce54fpj3j/campaigns HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: /\r\nUser-Agent: OAuth gem v0.5.1\r\nContent-Type: application/x-www-form-urlencoded\r\nAuthorization: OAuth oauth_consumer_key=“c3V3hADNQyGZKqqWPngqdZJcG”, oauth_nonce=“eRBjbMytHjORBz8Fx7Oalr0junQsDibD92fe1AmI4”, oauth_signature=“C3ubOBL6Fjz7tvyfC99UoXEKptI%3D”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1482259937”, oauth_token=“802465619648061440-9FQXAHPPqAoyl4fGKuf84qssJy1o2n4”, oauth_version=“1.0”\r\nConnection: close\r\nHost: ads-api.twitter.com\r\nContent-Length: 0\r\n\r\n”
<- “”
-> “HTTP/1.1 403 Forbidden\r\n”
-> “connection: close\r\n”
-> “content-disposition: attachment; filename=json.json\r\n”
-> “content-encoding: gzip\r\n”
-> “content-length: 122\r\n”
-> “content-type: application/json;charset=utf-8\r\n”
-> “date: Tue, 20 Dec 2016 18:52:17 GMT\r\n”
-> “server: tsa_f\r\n”
-> “set-cookie: guest_id=v1%3A148225993758713362; Domain=.twitter.com; Path=/; Expires=Thu, 20-Dec-2018 18:52:17 UTC\r\n”
-> “strict-transport-security: max-age=631138519\r\n”
-> “x-access-level: read-write-directmessages\r\n”
-> “x-api-version: 1.0\r\n”
-> “x-connection-hash: 83f96602ba05185db2f0fd66aead36a6\r\n”
-> “x-content-type-options: nosniff\r\n”
-> “x-frame-options: SAMEORIGIN\r\n”
-> “x-rate-limit-limit: 2000\r\n”
-> “x-rate-limit-remaining: 1997\r\n”
-> “x-rate-limit-reset: 1482260812\r\n”
-> “x-response-time: 120\r\n”
-> “x-runtime: 0.013018\r\n”
-> “x-transaction: 004c3a790050c08f\r\n”
-> “x-xss-protection: 1; mode=block\r\n”
-> "\r\n"
reading 122 bytes…
-> “”
-> “\x1F\x8B\b\x00\x00\x00\x00\x00\x00\x00\xAAVJ-*\xCA/*V\xB2\x8A\xAEVJ\xCEOIU\xB2Rrtv\xF6\x0F\xF5\v\x89\xF7\xF1w\xF6vu\x89\xF7\x0F\rQ\xD2Q\xCAM-.NL\aK’’\xE7\x97\xE6\x95(d\x16+\xE4\xE4’g\xA7\xA6(\xE4\x97\x96(\xD5\xC6\xEA(\x15\xA5\x16\x96\xA6\x16\x97(YU+\x15$\x16%\xE6\x02M\xAD\xAE\xAD\xAD\x05\x00\x00\x00\xFF\xFF\x03\x00W\xF6\xC7\xF4d\x00\x00\x00”
{“errors”:[{“code”:“ACCOUNT_LOCKED_OUT”,“message”:“Account is locked out”}],“request”:{“params”:{}}}read 122 bytes
Conn close

Now this is the first time I received a locked out message.

Thanks Juan.
Sergio


#8

Thanks, @justplan_io. This is helpful.

Looks like you worked through several issues, such as the ROUTE_NOT_FOUND error and the version 0.0 issue.

We’ll have to look into why the account was locked out.


#9

@justplan_io: Please log into ads.twitter.com and click “Help” on the top right to open a support case for the issue with your account. Twitter’s Ads Support team can unlock your account.


#10

Thank you Juan, I will let you know when is fixed.

Cheers,
Sergio