Authentication Before you can use the available API methods, you must first get an authentication token. Additionally, many methods require the use of a token for a specific application context.
The procedure to get this token is as follows:
Logon
Logon application context
Use the application context token to call any methods your task requires.
Logout (optional)
Except for the logon method or unless otherwise specified, you must include an authentication token in the request header Token
of all API method calls.
Logon To authenticate, you must provide the following credentials:
Username: <username>
Password: <password>
Customer reference: <customer>
API-Key: <apiKey>
If you do not have the required information, please contact your administrator or Externis support.
Replace all <values>
in the example request with your own credentials.
Method:
POST /Auth/Logon
Request:
curl -X 'POST' \
'https://apiv2.ecos2.externis.com/Auth/Logon' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'username=<username>&password=<password>&customer=<customer>&apiKey=<apiKey>'
Response:
{
"id": 47,
"deliveryLocationHomeId": 150,
"username": "john.doe",
"password": null,
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@externis.com",
"locale": "fr-FR",
"timezone": "Romance Standard Time",
"application": "ECOS",
"roleId": 1,
"role": "User",
"customer": "TEST",
"customerCode": "TEST",
"organisationId": 1,
"organisationLabel": "NATIONAL",
"token": "<token>",
"isAdmin": true,
"modifiedDate": "2022-05-27T11:23:42.74Z",
"lastLogonDate": "2023-01-11T14:46:22.087Z"
}
The "token"
field in the response, which holds the value <token>
contains the authentication token.
Logon application context You typically use a token for a specific application context when calling methods, so this procedure should be done right after the initial logon using the <token>
you received.
The example request uses the SALBO
context, which is the most common one for calling "Sales" methods.
Available contexts include:
Name
Description
SALBO
Sales back office
ASSBO
Assort back office
DOCBO
Docs back office
Replace <token>
in the example request with the token obtained from the Logon response.
Method:
POST /Auth/LogonApplication
Request:
curl -X 'POST' \
'https://apiv2.ecos2.externis.com/Auth/LogonApplication' \
-H 'accept: application/json' \
-H 'Token: <token>' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'application=SALBO'
Response:
{
"id": 47,
"deliveryLocationHomeId": 150,
"username": "john.doe",
"password": null,
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@externis.com",
"locale": "fr-FR",
"timezone": "Romance Standard Time",
"application": "SALBO",
"roleId": 3,
"role": "Admins",
"customer": "TEST",
"customerCode": "TEST",
"organisationId": 1,
"organisationLabel": "NATIONAL",
"token": "<token>",
"isAdmin": true,
"modifiedDate": "2022-05-27T11:23:42.74Z",
"lastLogonDate": "2024-10-17T08:34:26.947Z"
}
Logout Logout is optional, but it is recommended that you call log out to invalidate the authentication token(s) after using the API.
Replace <token>
in the example request with the token to be invalidated.
Method:
POST /Auth/Logout
Request:
curl -X 'POST' \
'https://apiv2.ecos2.externis.com/Auth/Logout' \
-H 'Token: <token>' \
-d ''
Response:
200 Ok
Last modified: 29 octobre 2024