DOCS

Getting Started

Welcome to the Chorus Pro API documentation. This guide will help you get started with the API, understand authentication methods, and make your first request.

Base URLs

The Chorus Pro API is available on the following environments:

Production

API:https://api.piste.gouv.fr/cpro
OAuth:https://oauth.piste.gouv.fr

Production environment for live requests with real data.

Sandbox

API:https://sandbox-api.piste.gouv.fr/cpro
OAuth:https://sandbox-oauth.piste.gouv.fr

Sandbox environment for development and testing.

Authentication Methods

The Chorus Pro API requires 2 authentication methods:

OAuth 2.0 (Bearer Token)

OAuth 2.0 token obtained via client_credentials grant. Required for all API requests.

Authorization: Bearer YOUR_OAUTH_TOKEN

cpro-account Header

Chorus Pro account credentials encoded in base64 as 'login:password'.

cpro-account: base64(login:password)

1. Get an OAuth 2.0 Token

Before making requests, you must obtain an OAuth 2.0 token:

# Production
curl -X POST "https://oauth.piste.gouv.fr/api/oauth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "scope=openid resource.READ"

# Sandbox
curl -X POST "https://sandbox-oauth.piste.gouv.fr/api/oauth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "scope=openid resource.READ"

2. Making Your First Request

Here's an example request to check the API health:

# Production
curl -X GET "https://api.piste.gouv.fr/cpro/transverses/v1/health-check" \
  -H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
  -H "cpro-account: $(echo -n 'login:password' | base64)" \
  -H "Content-Type: application/json"

# Sandbox
curl -X GET "https://sandbox-api.piste.gouv.fr/cpro/transverses/v1/health-check" \
  -H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
  -H "cpro-account: $(echo -n 'login:password' | base64)" \
  -H "Content-Type: application/json"

⚠️ Important: All requests require TWO authentications: the OAuth 2.0 token AND the cpro-account header.

Important Notes

πŸ“‹ POST Method for Everything

The Chorus Pro API uses the POST method for almost all operations, even for data retrieval. Badge colors help you identify the operation type (read in green, create in blue).

πŸ” Dual Authentication

Each request requires both an OAuth 2.0 token (Authorization Bearer) and a cpro-account header with your credentials encoded in base64.

⚑ Response Format

Responses typically include a 'codeRetour' field (0 = success) and a 'libelle' field with the message. Check the response examples for each endpoint.

Support & Resources

Need help? Check out these resources: