Error code 89 'Invalid or expired token'


#1

I am trying to use the search API with Node.

I used my Consumer Key and Consumer Secret to get hold of my access token

{ token_type: 'bearer',
  access_token: 'myaccesstokengoeshere' }

I then used the fetch module to fetch some tweets


fetch('https://api.twitter.com/1.1/search/tweets.json?q=javascript', {
  headers: {
  "Authorization": "Bearer myaccesstokengoeshere. Signing is not required."
}
})
.then(response => response.json())
.then(json => console.log(json));

Unfortunately I got the 89 ‘Invalid or expired token’ error.
What am I doing wrong?

I’ve been using the documentation here:
https://developer.twitter.com/en/docs/basics/authentication/overview/application-only