Api call HTTP Headers

Schermafbeelding 2022-02-06 om 22.38.40.png

Hello guys,

I'm desperate.. 3 days and it still doesn't work.. 

So: 
I simply want to make an post api call from my app to factuursturen.be. 
Easy as that.. But is still get a 401. 

So i think i did something wrong... I try the connection in the terminal an evertything works perfect  (curl) 
 what do i nee to set in my HTTP Headers (i just copy and pasted it..(his is not my real key., but it is demo code) 
Authorization: "Basic JGJhc2U2NGVuY29kZWRTdHJpbmcgPSBiYXNlNjRfZW5jb2RlKCdjYXJnb3ZpbGxUcnVja3dhc2g6alZaRzhwT1MzVXBNc3VExUklldicpOw=="

(his is not my real key., but it is demo code) 

This is the documentation of factuusturen.

Schermafbeelding 2022-02-06 om 22.18.25.png

so can somebody say what i do wrong? Because it works in curl/terminal.. 

thank you so mutch guys! 

Solved Solved
1 5 660
1 ACCEPTED SOLUTION

You should just encode the actual username and password string itself, the rest of that is PHP code.

 

Marc_Dillon_0-1644416562634.png

 

View solution in original post

5 REPLIES 5

Marc_Dillon_0-1644291429721.png

Enter it like that.

Thank you i  don't get an error this time. 
Is you api and username also build with encode 64? 
I read online that somethimes it works with "==" and somethimes without "=="

But the client wasn't created in my other program... 
I use the body template from factuursturen.nl (so i think that is correct.) 

Is it possible to make a "real" API call ? like making a client directly in to a program. Or do you still need a program like webhook.site or anthing like that? 

Because i think i understand that wrong..  
the real different between an api call and call a webhook

There is no error? So does it work now or not?

 

Yes my auth is a base 64 encoded string. My example is for a printnode webhook. The main point was just to show you the format for how to enter it.

I have no idea about "==".

 

Webhook vs API is a hard concept for many to understand, you are not alone. You may try googling this for lots more info. But basically, an API can be interacted with in many different ways, a "webhook" is just a subset of a few different ways to interact with an API, involving only the sending of information.

Hello, 

sorry that was not clear of me. 
So i don't get an error when I "Save" the app (not like a build error) 
But when i go to the test tab. i get: 

Schermafbeelding 2022-02-09 om 10.29.38.png

So the steps that i made to setup the api call are: 
1) encode 

Schermafbeelding 2022-02-09 om 10.35.31.png

Schermafbeelding 2022-02-09 om 10.33.40.png

Putting this inside appsheet:  

(Body = Demo data from factuursturen) 

Schermafbeelding 2022-02-09 om 10.36.49.pngSchermafbeelding 2022-02-09 om 10.37.36.png


3) Save = No error


4) test = 401 

So i don't know what i did wrong, i follow the script.. 

You should just encode the actual username and password string itself, the rest of that is PHP code.

 

Marc_Dillon_0-1644416562634.png

 

Top Labels in this Space