Authentication
POST
/api/v1/auth-service/auth/login
This endpoint is used for login. It authenticates a partner using a username and password, and returns an access_token (Bearer) that must be included in the Authorization header of all subsequent Flight API requests.
- cURL
- Request
- Response
- Request Details
- Response Details
- Errors
curl --location 'https://api.etscore.com/api/v1/auth-service/auth/login' \
--header 'Accept-Language: en-US' \
--header 'Content-Type: application/json' \
--data '{
"username": "etscore.royalapi",
"password": "*****"
}'
{
"username": "etscore.royalapi",
"password": "*****"
}
{
"access_token": "eyJhbGciOiJSUzI1Ni...",
"expires_in": 43200,
"refresh_expires_in": 108000,
"refresh_token": "eyJhbGciOiJSUzI1Ni...",
"token_type": "bearer"
}
| Name | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | The 'username' created and sent for your company by Etscore. |
| password | string | Yes | The 'password' created and sent for your company by Etscore. |
| Name | Type | Required | Description |
|---|---|---|---|
| access_token | string | Yes | The authentication token used for authorization (in JWT format). Send as Bearer <access_token>. |
| expires_in | int | Yes | The number of seconds until the access token expires. (43200 = 12 hours) |
| refresh_expires_in | int | Yes | The number of seconds until the refresh token expires. (108000 = 30 hours) |
| refresh_token | string | Yes | The token used to obtain a new access token. |
| token_type | string | Yes | The type of token (typically "bearer"). |
Errors specific to Authentication (13 codes). Common gateway and authentication errors apply to all endpoints and are listed once in the central reference.
🔎
Validation— fix the request and retry
| Group | Code | Message | Description |
|---|---|---|---|
| Validation | 905033 | Invalid request. Please check your input and try again. | Returned when login payload parameters (username or password) are malformed, null, or contain disallowed whitespace. |
Auth— obtain a new token and retry
| Group | Code | Message | Description |
|---|---|---|---|
| Auth | 901001 | Authentication Failed ! | Returned by Gateway when request authentication fails or credentials are not recognized. Verify your credentials or token. |
| Auth | 901002 | Token is invalid, please check bearer token and try again. | Returned by Gateway when the provided bearer token is invalid, tampered with, or expired. Re-authenticate to get a fresh token. |
| Auth | 901003 | Token not found, please check your authorization header in your request. | Returned by Gateway when the Authorization header is missing or empty. Include Authorization: Bearer <token> in the header. |
| Auth | 901004 | Missing Authorization Header, Token Not Found | Returned when the Authorization header is completely absent from the HTTP request. |
| Auth | 901005 | Request body is empty. Please send authentication information in the request body! | Returned during login when the authentication request body is missing or empty. |
| Auth | 901006 | Authentication failed, please check your username or password | Returned when the username or password provided does not match any registered partner credentials. |
| Auth | 901009 | Authorization Failed ! | Returned when the authenticated token does not have permission to access the requested flight API service. |
| Auth | 902012 | Authentication Validation Error | Returned by auth-service when partner credentials or parameters fail validation. |
| Auth | 902013 | Please check email address or password | Returned when the username or password entered is incorrect. |
| Auth | 905032 | Authentication failed, please check your username or password. | Returned during login when credentials cannot be verified. |
Timeout— restart the flow or session
| Group | Code | Message | Description |
|---|---|---|---|
| Timeout | 901011 | Request timed out. | Returned when Gateway times out while waiting for a response from the downstream flight service. Retry the request. |
Rate limit— slow down and retry later
| Group | Code | Message | Description |
|---|---|---|---|
| Rate limit | 901010 | You have exceeded the limit of requests sent per unit time. You can send {1} requests in {0} seconds. | Returned when the rate limit configured for your sales channel / IP is exceeded. Slow down your request rate and retry after the specified window. |
Common errors not shown here. Gateway, authentication and header errors apply to every endpoint. → See the central Error Codes reference.