We'll create your Organisation in our Sandbox environment so you can create Apps & Locations to use during development.
Each App you develop has it's own Client ID and Client Secret for use with HTTP Basic Auth.
Here's a simple cURL on the
/locations endpoint (in the sandbox environment).
curl -i \ -u DOSHII_CLIENT_ID:DOSHII_CLIENT_SECRET \ -X GET \ -H 'Content-Type: application/json' \ -H 'Accept:application/json' \ https://sandbox.doshii.co/partner/v3/locations
Note that the Client ID and Secret are separated by a colon (
cURL is great in that when you send a
-u parameter, it will automatically base64 encode the values for you. Neat! Unfortunately, that luxury is not extended to most programming languages. So, you'll need to base64 encode the values together before sending them to Doshii. In NodeJS, you could use the library btoa to do this for you.
var btoa = require('btoa'); var authorizationHeader = 'Basic ' + btoa(DOSHII_CLIENT_ID + ':' + DOSHII_CLIENT_SECRET);
Now it's just a matter of setting your
Authorization request header to the
authorizationHeader variable and you're ready to use Doshii!