[program-l] Re: How can I test an API using a bearer token?

  • From: hamidreza abroshan <hamidreza.abroshan@xxxxxxxxx>
  • To: Eric Brinkman <eric.brinkman1@xxxxxxxxx>
  • Date: Wed, 2 Nov 2022 15:39:37 +0330

It does support api authentication.
open up any request in a collection and press on auth and then choose your
authentication method like bearer and paste the bearer token there.
It also supports automatic authentication pre request, but it is a little
bit tricky.
For now, You can first run the authentication first, and copy the token and
paste it on the auth field of next requests.
I'll check the automatic one and will let you know later if I can figure it
out.
Regards.

On Wed, Nov 2, 2022 at 2:11 PM Eric Brinkman <eric.brinkman1@xxxxxxxxx>
wrote:

I've imported my co-worker's Postman collection in Thunder Client, but
cannot figure out how to set up a pre-request script to obtain the token.
My co-worker does not think Thunder Client supports API key authentication.

On Tue, Nov 1, 2022 at 10:19 PM hamidreza abroshan <
hamidreza.abroshan@xxxxxxxxx> wrote:

Hi,
if you installed thunder client,
open vscode and press ctrl+shift+r and hit new request.
if you could not find it, press tab or shift +tab until find thunder
client page.
in the main page, you can navigate the window by pressing up and down
keys.
If your coworkers use postman, you can get their postman collection and
import it into thunder client.
hit collections and go down to find the menu. press enter and press
import collection.
I hope this helps.
Best.

On Wed, Nov 2, 2022 at 4:17 AM James Scholes <james@xxxxxxxxxxxxxxxx>
wrote:

A bearer token is almost always sent in an "authorization" header with
the request.  So anything that can send HTTP requests with custom headers
will work, e.g. curl on the command line, requests in Python, another HTTP
library in a programming language you're comfortable with, etc.  If you're
specifically looking for a graphical tool that's accessible, someone else
will have to provide suggestions in that area.

Example of curl usage:

curl https://reqbin.com/echo/get/json -H "Accept: application/json" -H
"Authorization: Bearer {token}"

Regards,

James Scholes

On 01/11/2022 at 18:16, Eric Brinkman wrote:
I'm being asked to test a MuleSoft endpoint by authenticating with a
key and secret, obtaining a bearer token, and then using the token to log
in and send data to the endpoint.  My co-workers are using Postman to do
this, but that app is not accessible.  I've installed Thunder Client for VS
Code but can not figure out how to get it to do this.  Reading my
co-worker's Postman script just confuses me.  I've been told I need to use
an app that supports API key authentication.  Do any of you know how to do
this?

Thanks,
Eric
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq



--
hamidreza



-- 
hamidreza

Other related posts: