Can we test sandbox api in our website?

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(‘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);
}
};


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

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

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

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