Getting Started
We allow our customers and partners to fully integrate with our services. The Digicust API is extensive, well-documented, and easy to get started with.
- You have an active customer account
- You have a user account with email-password authentication
- Your execution strategy is properly set up. An execution strategy defines how customs cases are being processed. You can manage your execution strategies in our web app.
If you do not fulfill the above prerequisites, please create a new account with https://app.digicust.com/
You need an access token for all requests. Fetch your access token with the following code:
CURL
JavaScript (fetch)
JavaScript (axios)
Visual Basic.NET
Python
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);
}
};
const axios = require('axios');
const authenticate = async () => {
const data = {
username: '<YOUR USERNAME>',
password: '<YOUR PASSWORD>',
};
try {
const response = await axios.post('https://api.digicust.com/generic/api/auth/authenticate', data, {
headers: {
'Content-Type': 'application/json',
},
});
const accessToken = response.data.access_token;
console.log(accessToken);
// Save accessToken in some variable, or use directly
// ...
} catch (err) {
console.error('Error:', err);
}
};
Imports System.Net.Http
Imports System.Text
Imports System.Threading.Tasks
Imports Newtonsoft.Json
Public Async Function Authenticate() As Task
Dim url As String = "https://api.digicust.com/generic/api/auth/authenticate"
Dim client As HttpClient = New HttpClient()
Dim user = New With {Key .username = "<YOUR USERNAME>", Key .password = "<YOUR PASSWORD>"}
Dim json As String = JsonConvert.SerializeObject(user)
Dim data As New StringContent(json, Encoding.UTF8, "application/json")
Dim response As HttpResponseMessage = Await client.PostAsync(url, data)
Dim result As String = Await response.Content.ReadAsStringAsync()
Dim tokenResponse As Dictionary(Of String, String) = JsonConvert.DeserializeObject(Of Dictionary(Of String, String))(result)
Dim accessToken As String = tokenResponse("access_token")
Console.WriteLine(accessToken)
' Save accessToken in some variable, or use directly
' ...
End Function
import requests
import json
def authenticate():
data = {
'username': '<YOUR USERNAME>',
'password': '<YOUR PASSWORD>',
}
headers = {
'Content-Type': 'application/json',
}
try:
response = requests.post(
'https://api.digicust.com/generic/api/auth/authenticate', headers=headers, data=json.dumps(data))
if response.status_code != 200:
raise Exception(
'Request failed with status {}'.format(response.status_code))
response_data = response.json()
access_token = response_data['access_token']
print(access_token)
# Save accessToken in some variable, or use directly
# ...
except Exception as e:
print('Error:', e)
authenticate()
Find detailed documentation on available endpoints here:
Upload API | |
Generic API | |
Types |
Last modified 2mo ago