I’m trying to use OAuth 1.0a to authorize a V2 pinned_lists but get a Unauthorized error 401.
I’m wrong or how to do?
Thanks for reaching out here. How are you making this request? Do you have a code sample?
Hi,
I have used a page in internet.
I can’t post the link, because they have precluded the functionality and I’m afraid of violating some policy.
You can find it with “authorizing-twitter-api-calls-in-javascript” in a blog.
I followed all the details but it doesn’t work. I don’t know if I’m folio for the API 1, because for pinned_lists there is written to use even the auth 1.
ty.
does it work if you make a call with twurl for example? with the same keys? GitHub - twitter/twurl: OAuth-enabled curl for the Twitter API
twurl is a serial process, do it have a other via?
Oh, I just suggested using twurl to try and debug: to eliminate anything else that might be wrong, if it works in twurl but not in your code the bug must be somewhere in your code, but if twurl also fails it might be something else
1 Like
I get my key from project key and tokens.
consumerKey
consumerSecret
accessToken
accessTokenSecret

Do it is correct?
Ah looks like a bit of a bug, in the introduction docs say can use OAuth1.0a, but in API reference only OAuth2.0 supports
@jessicagarson
https://developer.twitter.com/en/docs/twitter-api/lists/pinned-lists/introduction
@Diamanti Have you tried using OAuth2.0?
@gauloics, I think this endpoint does support OAuth 1.0a, but we’ve been making some updates to make OAuth 2.0 more prominent in our docs, so I wonder if that’s part of it.
I checked in with some coworkers to confirm that you can use OAuth 1.0a with this endpoint.
1 Like
You can tell me a precise page to instruction to use OAuth2.0 to authorize API V2 request with vanilla Javascript.
It is difficult to find.
Thanks, @Diamanti. I did confirm that Lists does, in fact, support OAuth 1.0a and OAuth 2.0. While we don’t have a vanilla JavaScript example for OAuth 2.0a we do have this code sample that shows how to call Bookmarks endpoint with our Typescript SDK.
here have a clear step to step to Authorizing a request Using OAuth 1.0a.
Do it have a corresponding page for OAuth 2.0a?
But process in this link is the same that I use to authenticate access, that work.
What distinguishes in this process access authentication and request authentication?
I tryed new “API Playground” and see the Authorization header OAuth 2.0a.
I tryed:
GET /2/users/XXX/pinned_lists?list.fields=description&expansions=owner_id&user.fields=description
and
GET /2/tweets/XXX
I see that the “API Playground” use same Authorization header and work.
But if I use same Authorization header with my script “tweets” works but pinned_lists not. Why?
{“title”:“Forbidden”,“type”:“about:blank”,“status”:403,“detail”:“Forbidden”}
Again pinned_lists work but return 0 count but I have a pinned list. Why?
I was able to make it work pined_list because missing list.read.
But why it return {“result_count”:0} ?
I have a pinned list “private” in my setting and i’m able to list it with api.