# Prerequisites

This page takes you from credentials to your first successful call.

## 1. Get credentials

Ask Trace One for API credentials (see [Support](/fr/getting-started/support)). You receive:

- **`client_id`** — identifies your application
- **`client_secret`** — proves it is your application. Keep it on your server only.


Your client is set up for your company. Each API returns only the data your company can access in Trace One.

There is one environment: **production**.

## 2. Base URLs

Every API is an API product with its own prefix and version:

| API | Base URL |
|  --- | --- |
| Specification (with the packaging library) | `https://apis.traceone.com/spec/v2` |
| Reference Data | `https://apis.traceone.com/reference-data/v2` |
| Quality Portal Spec Bridge (legacy) | `https://apis.traceone.com/spec-bridge/v1.0` |


The paths in the [API catalog](/apis/) are relative to these base URLs.

## 3. Get a token

Trace One APIs use the **OAuth 2.0 client credentials** flow: server-to-server, no end user.

```http
POST https://ws-users.traceone.com/default/connect/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&scope=t1_api
```

Send the `access_token` of the response in every call:

```http
Authorization: Bearer eyJhbGci...
```

[Authentication](/fr/getting-started/authentication) explains how long a token lives and how to renew it.

## 4. Make your first call

List the countries, in French:

```http
GET https://apis.traceone.com/reference-data/v2/countries?languageCode=fr-FR
Authorization: Bearer YOUR_TOKEN
```

In Python:

```python
import requests

token = requests.post(
    "https://ws-users.traceone.com/default/connect/token",
    data={
        "grant_type": "client_credentials",
        "client_id": "YOUR_CLIENT_ID",
        "client_secret": "YOUR_CLIENT_SECRET",
        "scope": "t1_api",
    },
).json()["access_token"]

response = requests.get(
    "https://apis.traceone.com/reference-data/v2/countries",
    params={"languageCode": "fr-FR"},
    headers={"Authorization": f"Bearer {token}"},
)
response.raise_for_status()
print(response.json())
```

In JavaScript (Node.js):

```javascript
const tokenRes = await fetch("https://ws-users.traceone.com/default/connect/token", {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: new URLSearchParams({
    grant_type: "client_credentials",
    client_id: "YOUR_CLIENT_ID",
    client_secret: "YOUR_CLIENT_SECRET",
    scope: "t1_api",
  }),
});
const { access_token } = await tokenRes.json();

const res = await fetch(
  "https://apis.traceone.com/reference-data/v2/countries?languageCode=fr-FR",
  { headers: { Authorization: `Bearer ${access_token}` } }
);
const countries = await res.json();
```

## 5. Recommended tools

| Tool | Purpose |
|  --- | --- |
| [Postman](https://www.postman.com/) or [Bruno](https://www.usebruno.com/) | Explore and test the APIs by hand |
| [OpenAPI Generator](https://openapi-generator.tech/) | Generate a typed client from our OpenAPI documents |
| Any HTTP client library | `requests` (Python), `fetch` or `axios` (JavaScript), `HttpClient` (.NET) |


Download the OpenAPI documents from the [API catalog](/apis/).

## Next steps

- [Authentication](/fr/getting-started/authentication) — token lifetime, renewal, 401 and 403
- [Coding practices](/fr/getting-started/coding-practices) — pagination, batch reads, enums, languages
- [Errors](/fr/getting-started/errors) — status codes and the error body
- [Rate limits](/fr/getting-started/rate-limits) — the limit and how to retry