Reputation: 181
I have a OAuth2 (bearer token), but how do I pass it to the endpoint? More precisely, how do I include the bearer token in the URL.
Example URL:
https://api.twitter.com/1.1/search/tweets.json?q=%23superbowl&result_type=recent
Example Bearer Token:
AAAAA5n0w5n0w5n0wMyL0ngBe4r4rT0k4n
How do I use my bearer token to authorize my requests?
Example Incorrect Usage:
Upvotes: 18
Views: 119344
Reputation: 23
Follow these steps:
https://base.url
and set the request type.You are using the
OAuth 2.0
but there several moreAPI Key / Bearer Token / ..
none / form-data / raw / ..
Text / javascript / JSON / HTML / XML
Here is a quick explaination video:
Upvotes: 0
Reputation: 34643
You can do it in two equivalent ways:
by using the URL access_token
parameter:
https://base.url?access_token=f4f4994a875f461ca4d7708b9e027df4
or by adding the Authorization
header:
Authorization: Bearer f4f4994a875f461ca4d7708b9e027df4
Note: Whether two or only one of these methods works sometimes depends on the specific implementation of the web application (including the services and libraries used to create it).
Upvotes: 33
Reputation: 31
https://YourApiUrl?access_token=0db69822-0d02-4c17-8c39-d3b818bee184
Append the valid bearer token as value to the key "access_token". This worked for me.
Upvotes: 3
Reputation: 690
FYI,
https://Endpointurl?Authorization=Bearer 00D2w000000kc19!AQ0AQAXCu2pbsBn4YvKuvUbNieCGmG2CVL4lqVaJruAXKZYWuAQiuxtuMiOgvGw2KQ.E4CJtkOdUw0_Q7yUzQh_3XAgwWQfd
Hope you understood how to pass the token
Upvotes: -3
Reputation: 69
On Postman go to:
If you want it in the URL too like you mentioned, just pass it in as parameter in the GET request.
Upvotes: 2