Getting Started
Prerequisites
Authentication
curl -X 'POST' \
'https://api.digicust.com/generic/api/auth/authenticate' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"username": "<YOUR USERNAME>",
"password": "<YOUR PASSWORD>"
}'const authenticate = async () => {
const data = {
username: '<YOUR USERNAME>',
password: '<YOUR PASSWORD>',
};
try {
const response = await fetch('https://api.digicust.com/generic/api/auth/authenticate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
});
const jsonData = await response.json();
if (!response.ok) {
throw new Error(jsonData.error || 'Something went wrong');
}
const accessToken = jsonData.access_token;
console.log(accessToken);
// Save accessToken in some variable, or use directly
// ...
} catch (err) {
console.error('Error:', err);
}
};Documentation
Last updated