Twurl get account info fail


#1

I am in a “developer” stage…

twurl authentication passed - OK

get accounts response with:

ubuntu@ip-10-0-0-61:~/bc-exp$ twurl accounts
best_conversion
W53p7GZTxxtIPOJdlCad1CqUk (default)

This response is not what I had expected ?! Is it OK???

Also after request the accounts info - I am getting an error:
twurl /0/accounts/W53p7GZTxxtIPOJdlCad1CqUk

Also when U am trying to get the account ID from twitter web UI URL
twurl /0/accounts/18ce53yn9ts

I am getting error …

who can help …
I am just starting to develop the integration - from our server to Ads-API…
It seems that the best is to start with twurl… but it does not work as documented,

Many thanks,
Amir


#2

@best_conversion have a look at twurl’s README for the right syntax that you should be using in order to make the requests. For example, the following will list all your accounts:

twurl -H ads-api.twitter.com /0/accounts/


#3

Thanks Andrs,

I did exactly what it is written in the README.

And also calls such as: twurl /1.1/statuses/home_timeline.json are working OK

Are working for me…

THE PROBLEM is that the Ads-API is is not working as expected…
twurl -H ads-api.twitter.com /0/accounts/

return:

{“errors”:[{“code”:“UNAUTHORIZED_CLIENT_APPLICATION”,“message”:“The client application making this request does not have access to this API”}],“request”:{“params”:{}}}ubuntu@ip-10-0-0-61:~$ ^C

The command:
twurl accounts

return::

@best_conversion
W53p7GZTxxtIPOJdlCad1CqUk
best_conversion
W53p7GZTxxtIPOJdlCad1CqUk (default)

I appreciate if you can go with me with my consumer key and secret and try to get the documented below format.

Many Thanks,
Amir

–consumer-key XXXX --consumer-secret XXXX

twurl -H ads-api-sandbox.twitter.com /0/accounts/
{
“data”: [
{
“created_at”: “2014-03-09T00:41:49Z”,
“currency”: “USD”,
“deleted”: false,
“id”: “xxxxxx”,
“name”: “Sandbox account for @AdsAPI”,
“timezone”: “America/Los_Angeles”,
“timezone_switch_at”: null,
“updated_at”: “2015-01-29T00:41:49Z”
}
],
“data_type”: “account”,
“next_cursor”: null,
“request”: {
“params”: {}
},
“total_count”: 1
}


#4

@best_conversion I hid your consumer key and secret - you shouldn’t be sharing those openly! What is your application id? Are you sure you have access to the Ads API? Have you requested and received access to the Ads API?


#5

Many thanks for quick response and the comments for the secret…

The API key (8351704)

I had this email from Twitter:
Anything else need to be done ?

Hi Amir,

Congratulations! We’ve decided to move forward with providing your team with developer access to the Ads API. We’ve gone ahead and whitelisted your API key (8351704). Please reference our API documentation which can be found at here. We’d greatly appreciate your active involvement in the support forums, which can be found here. The forums will also be your primary source of technical support so lean into them with questions!

Once you’ve completed development and meet the criteria for Basic Access, please re-apply here.

We look forward to staying abreast of your build! Please do send us updates as appropriate.


#6

Hi,

For our application (8309792) with developer access, Get Account is working:

twurl -H ads-api.twitter.com “/0/accounts/18ce53vqr1u” | python -m “json.tool”
{
“data”: {
“approval_status”: “ACCEPTED”,
“created_at”: “2014-04-11T09:15:55Z”,
“deleted”: false,
“id”: “18ce53vqr1u”,
“name”: “Mysocialdatabase.com”,
“salt”: “deadbeefdeadbeefdeadbeefdeadbeef”,
“timezone”: “Europe/Amsterdam”,
“timezone_switch_at”: “2013-05-21T22:00:00Z”,
“updated_at”: “2015-06-15T18:06:38Z”
},
“data_type”: “account”,
“request”: {
“params”: {
“account_id”: “18ce53vqr1u”
}
}
But get account info (campaigns, funding source, etc) is NOT working:

twurl -H ads-api.twitter.com “/0/accounts/18ce53vqr1u/campaigns” | python -m “json.tool”
{
“errors”: [
{
“code”: “UNAUTHORIZED_CLIENT_APPLICATION”,
“message”: “The client application making this request does not have access to this API”
}
],
“request”: {
“params”: {}
}
}

I hope someone can help me with this error, we have tried many different things. Thank you in advance!


#7

Yes still not working:

This fails
twurl -H ads-api.twitter.com authorize --consumer-key XXXX --consumer-secret YYYY
Authorization failed. Check that your consumer key and secret are correct, as well as username and password.

This is working:
twurl authorize --consumer-key XXXX --consumer-secret YYYY
Go to https://api.twitter.com/oauth/authorize?oauth_consumer_key=XXXX&oauth_nonce=*&oauth_signature=n6l6IAoxa2OIWrz%252Fin%252Fe28meI9I%253D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1436857649&oauth_token=&oauth_version=1.0 and paste in the supplied PIN
4615151
Authorization successful <-- OK

ubuntu@ip-10-0-0-61:~$ twurl accounts
@best_conversion
W53p7GZTxxtIPOJdlCad1CqUk
best_conversion
W53p7GZTxxtIPOJdlCad1CqUk (default)
1glSU7seqNOTFNmFF8mnlzf5L

both accounts mark below are not authorized to use the API
ubuntu@ip-10-0-0-61:~$ twurl accounts
@best_conversion
W53p7GZTxxtIPOJdlCad1CqUk
best_conversion
W53p7GZTxxtIPOJdlCad1CqUk (default)

twurl /0/accounts/:W53p7GZTxxtIPOJdlCad1CqUk
-> getting some HTML with errors

twurl /0/accounts/:1glSU7seqNOTFNmFF8mnlzf5L
-> getting some HTML with errors


#8

@best_conversion Can you please clarify what your question is here?

I just checked your app and there are no missing permissions. Have you tried using this oauth tool? http://quiet-retreat-1002.herokuapp.com/


#9

HI,

I am trying to use “ADS-API” - IT IS A DIFFERENT API than the other APIs.

Can u confirm that you can get correct response from accounts api call (as part of the ADS-API)
(also stated here again)

  • This is working:

twurl authorize --consumer-key XXXX --consumer-secret YYYY
Go to https://api.twitter.com/oauth/authorize?oauth_consumer_key=XXXX&oauth_nonce=*&oauth_signature=n6l6IAoxa2OIWrz%252Fin%252Fe28meI9I%253D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1436857649&oauth_token=&oauth_version=1.0 and paste in the supplied PIN
4615151
Authorization successful <-- OK

  • This is working:
    ubuntu@ip-10-0-0-61:~$ twurl accounts
    @best_conversion
    W53p7GZTxxtIPOJdlCad1CqUk
    best_conversion
    W53p7GZTxxtIPOJdlCad1CqUk (default)
    1glSU7seqNOTFNmFF8mnlzf5L

This is not working - here there is a problem… and the question - how to resolve!!!
twurl /0/accounts/:W53p7GZTxxtIPOJdlCad1CqUk
-> getting some HTML with errors

twurl /0/accounts/:1glSU7seqNOTFNmFF8mnlzf5L
-> getting some HTML with errors


#10

I understand that you are trying to access the Ads API. From what you’ve pasted above, I don’t think you’re using the right account_id. See the description of the parameter here: https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id


#11

Thanks, jillblaz …

But the this account_id - I am getting from the previous call from twurl?!
so the twurl response with account_id that is not valid? - See below.

I also tried to use the account_id from the twitter web UI

jillblaz - please note that I am getting correctly the “non-ads” api - of tweeter… so teh authentication is works well… (e.g. /1.1/statuses/home_timeline.json)

I just get UNAUTHORIZED_ACCESS for ads-api call…

The authentication works - meaning I can be identified by the server …
BUT I am not ALLOWED to access the API.

How we can expedite this ? It is for long long time - I am trying to pass this first step…

Can we have a short session which I will give you access to the consumer-key/consumer-secret - so u can see for yourself? and after the session I can recreate and change them … so no problem …

I really think that something with the authorization setting with my account prevent my access to the specific ads-api …

Amir

ubuntu@ip-10-0-0-61:~$ twurl accounts
@best_conversion
W53p7GZTxxtIPOJdlCad1CqUk
best_conversion
W53p7GZTxxtIPOJdlCad1CqUk (default)