# Can we test sandbox api in our website?

**URL:** <https://discuss.dwolla.com/t/can-we-test-sandbox-api-in-our-website/8688>\
**Category:** General\
**Created:** [January 14, 2023, 9:38pm UTC](https://discuss.dwolla.com/t/can-we-test-sandbox-api-in-our-website/8688 "2023-01-14T21:38:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hkiran2k](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@hkiran2k](https://discuss.dwolla.com/u/hkiran2k)\
**Post date:** [January 14, 2023, 9:38pm UTC](https://discuss.dwolla.com/t/can-we-test-sandbox-api-in-our-website/8688/1 "2023-01-14T21:38:59Z")

</div>

Wish to know how to test the sandbox api in my website.

it is woking in postman, but i tried to use HTML xmlhttprequest , but it is failing

code

* * *

var authorizationBasic = window.btoa(clientId + ‘:’ + clientSecret);  
//alert(authorizationBasic);

var request = new XMLHttpRequest();  
request.open(‘POST’, URL, true);  
request.setRequestHeader(“Content-type”, “application/x-www-form-urlencoded”);  
request.setRequestHeader(‘Authorization’, 'Basic ’ + authorizationBasic);  
request.setRequestHeader(‘Accept’, ‘_/_’);  
request.setRequestHeader(‘Connection’, ‘keep-alive’);  
[//request.setRequestHeader](https://request.setRequestHeader)(‘accept-encoding’, ‘gzip, deflate, br’);  
request.send(“{grant\_type: "client\_credentials"}”);

request.onreadystatechange = function () {  
if (request.readyState == 4 && request.status == 200) {  
debugger;  
alert(request.responseText);  
}  
};

* * *

---

<div class="post-metadata">

**Author:** ![Muneeb\_Shoukat](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/muneeb_shoukat/32/3759_2.png) [@Muneeb\_Shoukat](https://discuss.dwolla.com/u/Muneeb_Shoukat)\
**Post date:** [January 17, 2023, 11:55am UTC](https://discuss.dwolla.com/t/can-we-test-sandbox-api-in-our-website/8688/2 "2023-01-17T11:55:07Z")

</div>

Hi @hkiran2k For postman, there is already a collection available. You can use it. And also you can see how they are testing. The link is below:-

[https://www.postman.com/dwolladev/workspace/dwolla/documentation/5009345-7f6c2764-c1f0-4837-8cf3-5e2abf41b0d4](https://www.postman.com/dwolladev/workspace/dwolla/documentation/5009345-7f6c2764-c1f0-4837-8cf3-5e2abf41b0d4)

Regarding the code, can you explain what error are you getting? Thank you

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [January 17, 2023, 11:11pm UTC](https://discuss.dwolla.com/t/can-we-test-sandbox-api-in-our-website/8688/3 "2023-01-17T23:11:04Z")

</div>

Hi @hkiran2k! Our API can only accept calls coming from your backend server and will block any calls from the Client side with a CORS error.

I would recommend using one of our official SDKs for making calls to the Dwolla API via your application’s server if it’s written in one of the languages that we have an SDK for. Check out our collection - [SDKs & Tools | Dwolla Payments Platform](https://developers.dwolla.com/sdks-tools)

Hope that helps. Let us know if you have any questions!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/dwolla/original/2X/1/1b70808226fb9abeaaf7386224caffb453efb690.png) [@system](https://discuss.dwolla.com/u/system)\
**Post date:** [January 14, 2024, 9:39pm UTC](https://discuss.dwolla.com/t/can-we-test-sandbox-api-in-our-website/8688/4 "2024-01-14T21:39:54Z")

</div>

This topic was automatically closed after 365 days. New replies are no longer allowed.
