How can lawcode Suite customers generate an API token to gain secure access to the API?

The API of the lawcode Suite provides secure access to data and functions. Customers can generate an API token and use the API to manage suppliers, products and batches.

Access & Authentication

To authenticate yourself to our API, it is necessary to generate an API token via the system settings of the suite and use this token in the header of the requests.

Generate API Token

To generate an API Token you need to have access to the lawcode Suite and Suite Administrator user role or at least Administrator user role in Supplier Manager.

Navigate into the Dashboard and take a look at the Sidenav and go to Settings → System → Tokens. Now you can click on “Generate token” Button.

After the click the token will be generated and displayed as follows.

Copy and store this token somewhere safe.

Usage API Token

The API token must be part of the header in a request as follows.

Authorization: Token <your-token>

You must replace <your-token> e.g. by fb50495467a77ce863df043cf94c951adadd99dd so it looks like:

Authorization: Token fb50495467a77ce863df043cf94c951adadd99dd

Your first API request

For your first API request you can use cUrl via command line or e.g. Postman.

Example request

curl -X GET https://<your-domain>/api/suma/suppliers/ \

--header 'Authorization: Token <your-token>'

You must replace:

  • <your-domain> e.g. with customer.lawcode.cloud

  • <your-token> e.g. with fb50495467a77ce863df043cf94c951adadd99dd

Example response

 {
    "count": 3,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "bb677635-c6d3-4167-8631-a9f3c2b7eb59",
            "name": "Kakaobohnen Inc.",
            "type": "direct",
            "state": "OB",
            "number_id": 10217,
            "values": {},
            "created_at": "2024-10-28T13:59:49.139111Z",
            "assignee": null,
            "calculated_risk": 2.62625,
            "user_defined_risk": null,
            "reports": [],
            "last_email_notification_sent": "2024-10-28T14:37:59.787097Z",
            "progress": 63
        },
        {
            "id": "853f184e-135f-4c9b-883b-3c22d665c1cc",
            "name": "Soja GmbH",
            "type": "direct",
            "state": "AC",
            "number_id": 10212,
            "values": {},
            "created_at": "2024-07-25T15:09:28.817904Z",
            "assignee": null,
            "calculated_risk": 1.4965,
            "user_defined_risk": 0.5,
            "reports": [],
            "last_email_notification_sent": null,
            "progress": 56
        },
        {
            "id": "9d09d4eb-30eb-4260-96e6-a724c28b2523",
            "name": "Coffee LLC",
            "type": "direct",
            "state": "AC",
            "number_id": 10211,
            "values": {},
            "created_at": "2024-07-25T15:09:28.389320Z",
            "assignee": null,
            "calculated_risk": 3.359125,
            "user_defined_risk": 2.0,
            "reports": [],
            "last_email_notification_sent": null,
            "progress": 56
        }
    ]
}