Documents of a Process via API in Trackline
Export documents from a Trackline process using API queries
How can I retrieve documents from a process via the Trackline API?
Trackline is a functionality of the Code Contract platform that automates information collection from start to finish without changing workflows or requiring manual input.
To integrate Trackline and export additional process data, queries must be performed via the API (Application Programming Interface). Below are the steps to follow.
Step 1: Get the authentication token
To obtain a JWT token for subsequent queries, send a POST request to the /login endpoint with your username and password.
Sample request
POST /login HTTP/1.1
Host: api.codecontractplattform.com
Content-Type: application/json
{
"email": "myusername",
"password": "mypassword"
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmV..."
}
This token must be included in the Authorization header:Authorization: Bearer {token}
Step 2: Query documents
Once authenticated, you can use the API to retrieve process data and attached files.
👉 Base endpoint:https://api.codecontractplattform.com/api/
Step 3: Query documents from a process
To download an attachment, use its identifier:
Sample request
GET /track-line/ext/attachment/file?attachment_id=xxx