API Authentication
Learn how to authenticate requests to the Hands In API
1. Obtain your API key
To send a request to the Hands In API, you need to obtain your API key from the dashboard. Navigate to Dashboard > Developers > API keys (shown below).
Now copy your Sandbox API key and store it somewhere safe as this is a sensitive credential.
2. Add header to request
Each request made to the Hands In API requires the API key to be passed in the header field x-api-key
. Depending on your programming language/HTTP request library this can look different. An example in Node JS using the native fetch
library is given below.
const url = "https://sandbox.handsin.com/v1"
try {
const response = await fetch(url, {
headers: {
"x-api-key": "<your_api_key>",
"Content-Type": "application/json",
}
})
if (!response.ok) {
throw new Error(`Response status: ${response.status}`);
}
const json = await response.json();
console.log(json);
} catch (error) {
console.error(error.message);
}
Updated 3 days ago