# API is confusing

**URL:** https://forum.adalo.com/t/api-is-confusing/22616
**Category:** External Collections, Custom Actions & Collections
**Created:** [January 26, 2022, 8:35pm UTC](https://forum.adalo.com/t/api-is-confusing/22616 "2022-01-26T20:35:53Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![m-mrh](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@m-mrh](https://forum.adalo.com/u/m-mrh)
#### Post date: [January 26, 2022, 8:35pm UTC](https://forum.adalo.com/t/api-is-confusing/22616/1 "2022-01-26T20:35:53Z")

</div>

Hello everyone,

I am trying to use this API using custom action in a button. It should create a wizard when activated.  
I tried every possible solution to receive a successful test result but I keep getting an error 401.

This is the API I should add:

 ![4](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/1/13d7e625ff970910b2bf729530aa554d09068626.jpeg)

This is how I am adding the API in custom action:

 ![1](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/7/73c02554adc2b5e3045ba6e6424637dff13ee4ce.jpeg)  
 ![2](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/c/ce984e20410ddbdb9e78ad81fac261e9718e1237.jpeg)

This is the result when running the test:

 ![3](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/b/b1bf1d5fb718ef085b58173ff2362ce938f36928.jpeg)

What I am doing wrong? Can anyone help, please?

Thanks!

---

<div class="post-metadata">

### Author: ![theadaloguy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/theadaloguy/32/8023_2.png) [@theadaloguy](https://forum.adalo.com/u/theadaloguy)
#### Post date: [January 27, 2022, 5:52am UTC](https://forum.adalo.com/t/api-is-confusing/22616/2 "2022-01-27T05:52:25Z")

</div>

One thing is the Content-Type header is missing from your custom action.

---

<div class="post-metadata">

### Author: ![theadaloguy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/theadaloguy/32/8023_2.png) [@theadaloguy](https://forum.adalo.com/u/theadaloguy)
#### Post date: [January 27, 2022, 8:18am UTC](https://forum.adalo.com/t/api-is-confusing/22616/3 "2022-01-27T08:18:48Z")

</div>

The email address part should be your email address plus your API key. email address + api key, not the word ‘email-address’. I think it also needs to be a header, rather than a query parameter.

I haven’t really played with this API but try setting up a Header like this

Header Name:  
Authorization

Header Value:  
[youremailaddress@example.com](mailto:youremailaddress@example.com):YOURAPIKEY

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/c/c976c01e454185433be61a409f3ca53fc5c6e0ef.jpeg)

> **[Escrow API Documentation - Basics - Escrow.com](https://www.escrow.com/api/docs/basics)**
>
> Escrow.com provides the best online escrow transaction services and accounts that facilitate and accelerate e-commerce by assuring a secure settlement.

---

<div class="post-metadata">

### Author: ![m-mrh](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@m-mrh](https://forum.adalo.com/u/m-mrh)
#### Post date: [January 27, 2022, 11:55am UTC](https://forum.adalo.com/t/api-is-confusing/22616/4 "2022-01-27T11:55:44Z")

</div>

Hi @theadaloguy thank you very much for your reply.

I have tried your suggestion and it is still not working. I think I am missing something, so I contacted the company for help. I will post my reply when it is solved. 👍

---

<div class="post-metadata">

### Author: ![theadaloguy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/theadaloguy/32/8023_2.png) [@theadaloguy](https://forum.adalo.com/u/theadaloguy)
#### Post date: [January 27, 2022, 11:56am UTC](https://forum.adalo.com/t/api-is-confusing/22616/5 "2022-01-27T11:56:55Z")

</div>

OK let us know what the solution was when they get back. I think it’s to do with that authorization field but not sure on the format.

---

<div class="post-metadata">

### Author: ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)
#### Post date: [January 28, 2022, 5:05am UTC](https://forum.adalo.com/t/api-is-confusing/22616/6 "2022-01-28T05:05:03Z")

</div>

I’m not sure if I did it correctly. But test was successful.

In the Docs my eyes went here and

> Note that the rest of the documentation and guides will simply includeemail-address and api-keyfor the examples. You must include your authentication header for all requests.

here.

> Most clients will implement basic authentication for you, however if you need to implement it yourself, you need to base64 encode your email address and password or API key seperated by a colon. For example, if your email address is [keanu.reeves@test.escrow.com](mailto:keanu.reeves@test.escrow.com) and your API key is myhorseisamazing, then you would base64 encode [keanu.reeves@test.escrow.com](mailto:keanu.reeves@test.escrow.com):myhorseisamazing, which would result in a2VhbnUucmVldmVzQGVzY3Jvdy5jb206bXlob3JzZWlzYW1hemluZw==. Using this value, you would then pass the Authorizationheader with the value: Basic a2VhbnUucmVldmVzQGVzY3Jvdy5jb206bXlob3JzZWlzYW1hemluZw==

And under the docs the 401 error code :

![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/5/5c6639093ab143264c81bb7410034b03cd1cdfc3.png)

Then I searched about that in the forum and I found this post that Colin posted.

> [@Basic authentication for custom action API header](https://forum.adalo.com/t/basic-authentication-for-custom-action-api-header/7798/2):
>
> Can you give some further info on this without me diving in to their docs fully? I have used basic auth successfully on Adalo several times. I used this site to generate the base64 code: [Basic Authentication Header Generator](https://www.blitter.se/utils/basic-authentication-header-generator/)

And I clicked that link and then I gave the email and the password there that I gave on Escrow and it gave me Authorization: Basic and a ID. Then I copied the Basic with the ID and I created a Header first and added Authorization and added the Basic and ID to the value. Then I added a query and I put -u for name and to the value I entered the email address that gave to escrow and entered the API key that created in escrow and added a space between com and API key starting word/number .

Then I created the 2nd query and added Content-Type as name and application/json as the value. Then I pasted the JSON in the Body section and created the inputs and renamed the JSON body with that inputs. And finally I got Test Successful.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/0/0c44da87a486dc5599c7491834cc7df64523dd49.png)

 ![pay](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/8/8b301715135e0b69b38fe0b619b9700bd38c2d07.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/3/3352fa55528f4c90217026e803fc2f64a4a24b0e.png)

I’m not so much good at working with API’s. Have a little a knowledge about it. Not sure if I did it correctly 🙂

Thank you

---

<div class="post-metadata">

### Author: ![m-mrh](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@m-mrh](https://forum.adalo.com/u/m-mrh)
#### Post date: [January 28, 2022, 4:32pm UTC](https://forum.adalo.com/t/api-is-confusing/22616/7 "2022-01-28T16:32:06Z")

</div>

Thank you so much for the help @Dilon

I have followed all the instructions you mentioned precisely, but I am still getting an error 401

Below is what I inserted so far

 ![1](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/f/ff3c221fa02d81296d615ddaec965e0db65b5b15.jpeg)  
 ![1-1](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/6/65a66d88e03fad6888c7fbed8a1947908ce60320.jpeg)

I used my sandbox email, and API Key created inside that account. I am not sure what I am doing different from you for the authentication. Any suggestions would be really appreciated, thanks again!

---

<div class="post-metadata">

### Author: ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)
#### Post date: [January 28, 2022, 4:47pm UTC](https://forum.adalo.com/t/api-is-confusing/22616/8 "2022-01-28T16:47:02Z")

</div>

Your Welcome!

You have got the value for the header from here right?

> **[Basic Authentication Header Generator](https://www.blitter.se/utils/basic-authentication-header-generator/)**
>
> Generate a basic authentication header from username and password with this Basic Authentication Header Generator.

And you have put your escrow email and password right? Because when I tested with a fake one it didn’t worked and received the 401 error. I think you have to put the email and password that you used for login to escrow. And If I’m correct you need to use this value as for your every escrow API integration.

---

<div class="post-metadata">

### Author: ![m-mrh](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@m-mrh](https://forum.adalo.com/u/m-mrh)
#### Post date: [January 28, 2022, 7:20pm UTC](https://forum.adalo.com/t/api-is-confusing/22616/9 "2022-01-28T19:20:48Z")

</div>

Hi @Dilon

I just refreshed the page and repeated the same process you did. I used the same link for basic authentication, added my email and password, and everything similar to the images I attached previously.

Could it be something related to the body? I basically added an input for everything between {"…"} and example values are similar to the API documentation in JSON.

---

<div class="post-metadata">

### Author: ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)
#### Post date: [January 29, 2022, 9:27am UTC](https://forum.adalo.com/t/api-is-confusing/22616/10 "2022-01-29T09:27:33Z")

</div>

But you get the same error? ( 401 )

You entered your correct email and password on creating the header right? The email and password that you gave on escrow to signup.

If you get the same error ( 401 ) I think it may not related to your JSON Body.

---

<div class="post-metadata">

### Author: ![m-mrh](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@m-mrh](https://forum.adalo.com/u/m-mrh)
#### Post date: [January 29, 2022, 12:17pm UTC](https://forum.adalo.com/t/api-is-confusing/22616/11 "2022-01-29T12:17:47Z")

</div>

yes, I entered the correct email and password for the sandbox. I keep getting the same error (401).

I am still waiting for a reply from [escrow.com](http://escrow.com) their support is slow. I’ll keep you updated on a solution they will propose by next week.

---

<div class="post-metadata">

### Author: ![m-mrh](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@m-mrh](https://forum.adalo.com/u/m-mrh)
#### Post date: [January 29, 2022, 1:19pm UTC](https://forum.adalo.com/t/api-is-confusing/22616/12 "2022-01-29T13:19:52Z")

</div>

After discussing this matter privately with @Dilon he proposed that I use this URL instead because I was using a sandbox account.

[https://api.escrow-sandbox.com/integration/pay/2018-03-31](https://api.escrow-sandbox.com/integration/pay/2018-03-31)

It finally worked thanks to him. I am so thankful for your help! So much appreciated! 🙂

---

<div class="post-metadata">

### Author: ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)
#### Post date: [January 29, 2022, 1:23pm UTC](https://forum.adalo.com/t/api-is-confusing/22616/13 "2022-01-29T13:23:00Z")

</div>

Yeah the problem is he is using a Sandbox email. So the Base URL has to be changed like this ( Image added 👇 )

For me the test was successful first because I didn’t use a sandbox email. And after I tried with a sandbox email I got the same error ( 401 ) and after reading the Docs it says if you are using a sandbox email the Base URL has to be like this. ( Image added 👇). And tried changing the Base URL and the test was successful!

[![](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/2/28b51c5cd9122a1b4905b2d67add711e176ec8af.png) ](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/2/28b51c5cd9122a1b4905b2d67add711e176ec8af.png)

> **[Escrow API Documentation - Basics - Escrow.com](https://www.escrow.com/api/docs/basics)**
>
> Escrow.com provides the best online escrow transaction services and accounts that facilitate and accelerate e-commerce by assuring a secure settlement.

---

<div class="post-metadata">

### Author: ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)
#### Post date: [January 29, 2022, 1:23pm UTC](https://forum.adalo.com/t/api-is-confusing/22616/14 "2022-01-29T13:23:22Z")

</div>

Great and Your Welcome!
