ARTICLE
How do I authenticate via the API?
Discover insights on key topics that enhance understanding and offer practical knowledge for everyday applications.
Authentication
The API uses OAuth2 with the password grant type.
Authorization URL: https://auth-dev.centtrip.com/connect/authorize
Token URL: https://auth-dev.centtrip.com/connect/token
Scope: api_public_v1
How to Authenticate
- Obtain an Access Token: Use your client credentials along with user credentials to request a token. For example, using cURL:
curl -X POST "https://auth-dev.centtrip.com/connect/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=password&username=YOUR_USERNAME&password=YOUR_PASSWORD&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&scope=api_public_v1" - Use the Token in API Requests: Include the access token in the Authorization header of your requests:
curl -X GET "https://api.centtrip.com/eu/v1/corporates" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"