sprinklr-inc/twitter4j-ads

401:Authentication credentials were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.

Closed this issue · 0 comments

I am getting 401 error, I cross-checked with keys and it works fine manually using twurl. I tried working with master branch itself and I was able to succeed with Audience creation and OAuth 1.0 works fine. I just compiled the master branch as jar, I used that jar in my project. I am facing the below issues.

Note: When I use the maven repository jar I am getting error like {"errors":[{"code":"INVALID","message":"Version 5.0 is not available."}],"request":{"params":{}}} . So I was trying the above approach.

Error Log:
TwitterTest > createAudience() FAILED
401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
{"errors":[{"code":"UNAUTHORIZED_ACCESS","message":"This request is not properly authenticated"}],"request":{"params":{}}}

Relevant discussions can be found on the Internet at:
    http://www.google.co.jp/search?q=55c999c1 or
    http://www.google.co.jp/search?q=26fad2eb
TwitterException{exceptionCode=[55c999c1-26fad2eb], statusCode=401, message=This request is not properly authenticated, code=-1, retryAfter=-1, rateLimitStatus=null, version=5.0, headers= {date=[Sat, 08 Aug 2020 05:24:34 GMT], null=[HTTP/1.1 401 Authorization Required], server=[tsa_k], content-length=[139], x-tsa-request-body-time=[1], x-response-time=[178], x-frame-options=[SAMEORIGIN], content-encoding=[gzip], x-transaction=[005a3ee4003c5d4c], strict-transport-security=[max-age=631138519], x-api-warn=[Warning: You're using a deprecated version of this API. Upgrade your API: https://developer.twitter.com/en/docs/ads/general/overview/versions.], set-cookie=[guest_id=v1%3A159686427463700307; Max-Age=63072000; Expires=Mon, 8 Aug 2022 05:24:34 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None, personalization_id="v1_pe6/NXuCXTiGw5XywhbBdg=="; Max-Age=63072000; Expires=Mon, 8 Aug 2022 05:24:34 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None], x-xss-protection=[0], x-content-type-options=[nosniff], content-disposition=[attachment; filename=json.json], x-connection-hash=[4421425c3c40f407abc0552e7a4fc6ad], x-current-api-version=[7.0], x-runtime=[8.4E-5], x-api-version=[6.0], content-type=[application/json;charset=utf-8], cache-control=[no-cache, no-store, max-age=0]}}
    at twitter4jads.internal.http.HttpClientImpl.request(HttpClientImpl.java:186)
    at twitter4jads.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:62)
    at twitter4jads.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:89)
    at twitter4jads.TwitterAdsClient.post(TwitterAdsClient.java:323)
    at twitter4jads.TwitterAdsClient.postRequest(TwitterAdsClient.java:157)
    at twitter4jads.TwitterAdsClient.executeHttpRequest(TwitterAdsClient.java:131)
    at twitter4jads.impl.TwitterAdsAudienceApiImpl.createTailoredAudience(TwitterAdsAudienceApiImpl.java:127)