Skip to main content

Authenticate (for authorized applications)

We utilize JSON Web Tokens to authenticate all requests sent to the API.

Step 1

Retrieve the admin credentials (username and password, appId, and verifyKey) that have been provided for your firm. You will need these credentials to authenticate with the API.

If you do not have these credentials, please contact your Account Manager for more information.

Step 2

API Reference: Login API

Create a POST request with your username and password.

curl -X 'POST' \
'https://gateway-api-demo.s2f.projectx.com/api/Auth/loginApp' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"userName": "yourUsername",
"password": "yourPassword",
"deviceId": "yourDeviceId",
"appId": "B76015F2-04D3-477E-9191-C5E22CB2C957",
"verifyKey": "yourVerifyKey"
}'

Step 3

Process the API response, and make sure the result is Success (0), then store your session token in a safe place. This session token will grant full access to the Gateway API.

{
"token": "your_session_token_here",
"success": true,
"errorCode": 0,
"errorMessage": null
}

Notes

All further requests will require you to provide the session token in the "Authorization" HTTP header using the Bearer method.

Session tokens are only valid for 24 hours. You must revalidate your token to continue using the same session.

The next step will explain how to extend / re-validate your session in case your token has expired.