First API Call
Step-by-step instructions for setting a request to the CargoDocs API
Step 1: Retrieve Authorization Token
Refer to Authentication and retrieve your API authentication token by passing the user credentials to the OAuth authorization URL at https://api.domain.cargodocs.com/v3/common/auoth2/token
Here is how a token is generated
curl --location --request GET 'https://api.cargodocs.com/v3/common/oauth2/token' \
--header 'Password: vH3OJ4xS$5' \
--header 'Username: Bumblebee'
The above request generates a token as follows.
{
"token": "eyJraWQiOiJ3YitJMjNzOWRCNUh0cjBhQXVwTHVjeFwvUFhWREhlVEcyQWpTNnkyNFBjYz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJiMjNmMDNlNi1lNDIwLTRjODEtOGIzZS1hOGM5MmYzZGQ0OTQiLCJkZXZpY2Vfa2V5IjoiZXUtd2VzdC0xXzMzODMxNzlmLTAyNTQtNDE4MC1hZWM4LWNhN2Q3ZTVmZTkyNCIsImV2ZW50X2lkIjoiODQ3NGEyZWQtZTYzZC00NmY5LWJlNmMtMWViNTc0YzcwZGNjIiwidG9rZW5fdXNlIjoiYWNjZXNzIiwic2NvcGUiOiJhd3MuY29nbml0by5zaWduaW4udXNlci5hZG1pbiIsImF1dGhfdGltZSI6MTY0NTUzMjIwNywiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLmV1LXdlc3QtMS5hbWF6b25hd3MuY29tXC9ldS13ZXN0LTFfSnN6bUZoejRoIiwiZXhwIjoxNjQ1NTM1ODA3LCJpYXQiOjE2NDU1MzIyMDcsImp0aSI6ImNkODlhMDBhLTg3MWUtNDkzYy1hNTIwLWM3OWU2ZGEwOTUxMCIsImNsaWVudF9pZCI6IjNwZHZrbWEzdDM5bnNxamFyamlmM2k0ZmlkIiwidXNlcm5hbWUiOiJWb2x0cm9uIn0.banOsyWt57Um_XdqteVBuRDIim8Q_KG1IMRLc7bsXJNoI_fmQi95sc7a2-fCyjFG4z4ryA5dmYaXGdX3Gk7PFUyr5EYhJavt18OY7jbdU1IUNRhiI4zlngev4ibCWiTp6HSwDk9NOao8v8qgjUVwWVuNcbnNbmjnyIs0-m8NS3FtkoeC4_V5HVWYrd2XCQJFheG50qu2I2RXHmd-JfiJAGa9ALSDVIUYElkm4m0xUucHqXybwzRHszhCyDVpmR4Iz0BI8EMe5AAkJtN-rW_UJTMDlQeL7qCJJsasoeMcHWLgr3Dqq0Y21FgQu2K7JE0ZpvnRGjAE0YD4X3quXEW4NA"
}
Step 2: Consume Endpoint
Below is a sample URL with the appropriate authorization code and body.
curl --location --request GET 'https://api-test.cargodocs.com/v3/exchange/employees?customerId=0a2b38f1-44e4-11e9-9ed6-0a24491b68de' \
--header 'Authorization: Bearer eyJraWQiOiJPUUJmaXR6KzBWOFlxWFp3N2lHc1hlWjB5T2I3RTNyekpGWGZUYm9cL0M0Yz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjODU2NzIxZC0wMmEyLTQ0MzItYWRhMy0xNDVjMGYxZTY4ZjIiLCJldmVudF9pZCI6IjQ4YjI0MjY1LWNmODUtNDUxMi04ODIxLTE5OWViZjI2MzQ4ZCIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiYXdzLmNvZ25pdG8uc2lnbmluLnVzZXIuYWRtaW4iLCJhdXRoX3RpbWUiOjE2NDk3NTUxNTksImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWlkcC5ldS13ZXN0LTEuYW1hem9uYXdzLmNvbVwvZXUtd2VzdC0xX1drRmF1Q2tnUSIsImV4cCI6MTY0OTc1ODc1OSwiaWF0IjoxNjQ5NzU1MTU5LCJqdGkiOiI2NDBkZGE3Mi03NTAzLTRmMDgtOTY3Yi0wMjEzMzA3Y2EwZjYiLCJjbGllbnRfaWQiOiI3bzh0dDI4OWNvNHU5NnQ5bHQ1MnFyMnZxYSIsInVzZXJuYW1lIjoiekxpbmVyUGlsVXNlcjEifQ.eAh_Fq6FJhqWxtCcYCkOKdqb_4QCWEkSJqTh1Jbh-NyZQPZ_x-QPRxj1S9FnzJ3JXtb7F15Perfml58-uUsKl9BWImwuS87n5ivaLxpgPYo1cWIpKmzmj30slVuCV6_1Kb54CW_rB3W22VeMqHwMX4D_POe-PxUn9FqeEwj_R-6kYjjqlB0x28X6EbBoVrtm5uzTg21wflOBOKO4wuI8vDyb_9ZsLsZWxyxP1Dg-6Q49nPH-xXEsPgF-3NnpJbq53mxI0Qeb0N-XJxBKLQCrWdVTpq2FqyS06UVgQz9eBUa_JcLetTA7mmG-FtnZdN_NJyj-WOGLnsySX6sXOz2ziQ'
Multi-Languages Support
Here at CargoDocs API documentation; we will always give out sample codes in different development languages to support the majority of the developers. The API References endpoints have more than 20 programming languages.
This request is responded by a 200
Response Code with the following JSON.
[
{
"employeeId": "31de1ad3-acfd-48e4-b182-d0d70a387ad6",
"firstName": "PIL",
"lastName": "APIUSER1",
"username": "PIL/APIUSER1",
"email": "[email protected]"
},
{
"employeeId": "de027c2d-ef60-11e9-8d4f-0a0569bd186a",
"firstName": "test user:",
"lastName": "zLinerPilUser1",
"username": "zLinerPilUser1",
"email": "[email protected]"
}
]
Updated over 2 years ago