# Twitter Api returning Invalid or expired token

**URL:** <https://community.auth0.com/t/twitter-api-returning-invalid-or-expired-token/45021>\
**Category:** Get Help\
**Created:** [June 21, 2020, 11:41am UTC](https://community.auth0.com/t/twitter-api-returning-invalid-or-expired-token/45021 "2020-06-21T11:41:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marektea](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marektea/32/12776_2.png) [@marektea](https://community.auth0.com/u/marektea)\
**Post date:** [June 21, 2020, 11:41am UTC](https://community.auth0.com/t/twitter-api-returning-invalid-or-expired-token/45021/1 "2020-06-21T11:41:42Z")

</div>

Hi, I am trying to use Auth0 with twitter api using nodejs. What I did:

1. Setup up Twitter connect, tried it. Twitter user was added successfully to the Auth0.
2. I retrieved use profile / identity by calling POST /oauth/token/
3. I retrieved access\_token (.identities[0].access\_token)
4. I’ve used this access\_token to call “[https://api.twitter.com/1.1/followers/list.json](https://api.twitter.com/1.1/followers/list.json)”,

Code:

```auto

            var options = {
                method: "GET",
                url: "https://api.twitter.com/1.1/followers/list.json",
                headers: {
                    Authorization: `Bearer ${myUser.identities[0].access_token}`,
                },
            };

            request(options, function (error, response, body) {
                console.log(body);
            });

```

I am getting error {“errors”:[{“code”:89,“message”:“Invalid or expired token.”}]}. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![marektea](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marektea/32/12776_2.png) [@marektea](https://community.auth0.com/u/marektea)\
**Post date:** [June 21, 2020, 11:45am UTC](https://community.auth0.com/t/twitter-api-returning-invalid-or-expired-token/45021/2 "2020-06-21T11:45:33Z")

</div>

PS: one thing which seems odd that according to twitter the bearer token should look like something like  
`AAAAAAAAAAAAAAAAAAAAAMLheAAAAAAA0%2BuSeid%2BULvsea4JtiGRiSDSJSI%3DEUifiRBkKG5E2XzMDjRfl76ZC9Ub0wnz4XsNiRVBChTYbJcE3F`

in my case it looks more like 18504007-jgQkuLFzwEd

---

<div class="post-metadata">

**Author:** ![raymondcamden](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/raymondcamden/32/38661_2.png) [@raymondcamden](https://community.auth0.com/u/raymondcamden)\
**Post date:** [July 10, 2022, 7:05pm UTC](https://community.auth0.com/t/twitter-api-returning-invalid-or-expired-token/45021/3 "2022-07-10T19:05:12Z")

</div>

I’m running into this myself - although trying to hit v2 endpoints. Anyone got a solution?
