eCOS® API Help

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:

  1. Logon

  2. Logon application context

  3. Use the application context token to call any methods your task requires.

  4. Logout (optional)

Logon

To authenticate, you must provide the following credentials:

Username: <username> Password: <password> Customer reference: <customer> API-Key: <apiKey>

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" }

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