api icon

Authentication

The AS2 Gateway API uses JWT token based authentication. Endpoint to obtain the token is as follows.

Get JWT Token

POST /:v/authorize
Content-Type: application/json

{
    "username": "<email>",
    "password": "<password>"
}
200 OK
Content-Type: application/json

{
    "token": "<token_string>",
    "expiry": <expiry_timestamp>
}

E.g.:

curl -XPOST https://api.as2gateway.com/v1/authorize \
    -H 'Content-Type: application/json' \
    --data '{"username":"email@domain.com","password":"pazzword"}'

The received authorization token should be added as an ​Authorization​ header for all other requests:

Authorization: <token_string>

Do not include any scheme part (Basic, Bearer etc.) on the header.

The token will generally be valid for ~24 hours (as indicated by the ​expiry​ field), so you can use it for multiple API calls without having to re-authenticate frequently.

In this topic
In this topic