API with Bearer Token

I am trying to setup a client side API using Bearer Token.

However whenever i try to define the API, i am getting an Bearer authorization issue.

However, the credentials are correct as i have tested them in Postman and it was successful. This does need to be a POST api query.

Is the Bearer Token setup differently?

i have removed the authorization token and just put the xxx

Also, shouldn’t the parameters appear in the Define API Scheme window too? They are not showing even though there is a Authorization header listed.

thoughts?

Hey @BWCWeb - I’m not 100% sure what you’re trying to achieve, but it seems like you’re exposing the authentication key on the client side this way.

(With the integrations I worked with) Exposing that key allows anyone to do whatever they want with your Fullcontact account.

I recommend using a server action and passing the header in there

I did originally set it up on the Server side as well with the same results. I only tried it on the client side to see if there was any difference.

I still can’t get the Bearer Token to process correctly


any help is appreciated.

first example is correct but you need bearer token. You need to get information about how it was created and then you need to make an api query with this token.
The bearer token is usually created with a different api query and used in subsequent queries. That’s why you need to read the documentation.(check fullcontact.com documantation )

wrong Bearer Token
image

The Bearer Token is on there…i only removed it prior to taking the screenshot for security reasons.
No in the Authorization field it does have Bearer and then my token number as the details of the API from Full Contact require.

It still has that error come up.

hi @BWCWeb
image
returned error code is 401 so incorrect username/password
you can check your credentials

@bwcweb Send your webhook to https://webhook.site/ and inspect it there. That way you can see what it’s receiving.

1 Like

thank you for helping here. I do appreciate it.

While i do agree it is an authorization issue…the odd thing is that if i go to Postman and put in the same credentials and URL call…i get a response without an issue…that is why i can’t understand why it is not working on Wappler side.

Hi @BWCWeb

Let me try to explain the problem to you this way. If it was a wappler-related problem, you would get a different error message than fullcontact. The answer you get is 401, that is, username and password issue.
If fullcontact has a postman library, there may be a demo username and password in this library. (i.e. you may need to check the library in postman)
If one of these explanations did not help you solve the problem you are experiencing, I recommend you to check the parameters you use on the wappler side. These types of errors are usually simple typo errors.

Also , for debug you can check what wappler sends as @karh mentioned . This is a good debug method.

okay, sounds good. I will double check everything and see. That makes sense on the PostMan side as well why its working.

Thank you again for all your help!!

1 Like

good luck :+1:

So, let's test if this is a Wappler bug.

Go to Beeceptor and create a free endpoint. Use the endpoint's URL in Wappler and try doing the request. See if the "Authorization: Bearer xxx" header is present on the request received by Beeceptor