Error when trying to get data from API


#1

Hello!

We have following error when we try to get data from advertiser API: {“errors”:[{“code”:“UNAUTHORIZED_ACCESS”,“message”:“This request is not properly authenticated”}]. Handle @KamaCasino. Please, help us to solve the issue.


#2

Hey @Murrow1990

Can you please provide the exact API request and responses, as well as your client app ID?

Thanks!


#3

Hello!

The request is https://ads-api.twitter.com/2/accounts
The response is Resp content: {“errors”:[{“code”:“UNAUTHORIZED_ACCESS”,“message”:“This request is not properly authenticated”}],“request”:{“params”:{}}}
Dir: [‘attrs’, ‘bool’, ‘class’, ‘delattr’, ‘dict’, ‘doc’, ‘format’, ‘getattribute’, ‘getstate’, ‘hash’, ‘init’, ‘iter’, ‘module’, ‘new’, ‘nonzero’, ‘reduce’, ‘reduce_ex’, ‘repr’, ‘setattr’, ‘setstate’, ‘sizeof’, ‘str’, ‘subclasshook’, ‘weakref’, ‘_content’, ‘_content_consumed’, ‘apparent_encoding’, ‘close’, ‘connection’, ‘content’, ‘cookies’, ‘elapsed’, ‘encoding’, ‘headers’, ‘history’, ‘is_permanent_redirect’, ‘is_redirect’, ‘iter_content’, ‘iter_lines’, ‘json’, ‘links’, ‘ok’, ‘raise_for_status’, ‘raw’, ‘reason’, ‘request’, ‘status_code’, ‘text’, ‘url’]

The app id is i108415

Thank you!


#4

Hey @Murrow1990

Looks like that client app hasn’t been granted access to the Ads API. You can apply for access here

Thanks!


#5

Hello,

We were integrated via API from April 2017, and we lost the access in December only. Can we restore
our access without a new application?

Thank you!


#7

Hi @Murrow1990,

I can’t seem to find a record of your application using app 108415. That app also has no record of ever being whitelisted. Can you confirm your company name?

If you don’t mind reapplying, please fill out this form here: https://twitter.twimg.com/LP=2289

Best,
Carmen


#8

Hello,

Our company name is Zotobi Management Ltd. we got the access to API in the beginning of April 2017.
We would rather to restore our access, as the application will be under review for some time and we would like to start new campaigns as soon as possible.

Thank you!


#9

Hi @Murrow1990,

Thanks for providing your company name. You never lost access - you were granted Read-only access on app 13596563.

Let me know if you have any questions.
Best,
Carmen


#10

Hello!

We solved the issue with API, thank you for your help.
However we have two more questions:

  1. Would you be so kind as to tell how we can check when our credentials (access_token, access_secret) expire?
  2. For connecting to Twitter API we use URLs that contain digit 1 (Example: https://ads-api.twitter.com/1/accounts)
    But in your manuals ( https://developer.twitter.com/en/docs/ads/general/guides/getting-started ) we see digit 2 everywhere (Example: https://ads-api.twitter.com/2/accounts/abc1/campaigns) . Is this for a new API version? Will you support the old API version or we will have to upgrade for the new API version in the nearest future? Should we do some changes in our code to transfer it from old to new version?

Thank you!


#11

@Murrow1990: Good questions.

  1. They do not expire.
  2. Yes, you should be using v2. Both v1 and v2 are currently supported. However, we plan to turn off v1 on 2018-01-10. Please migrate as soon as possible. See this announcement for more information.

#12

Thank you very much!