Skip to main content

Authenticate (with API key)

We utilize JSON Web Tokens to authenticate all requests sent to the API. This process involves obtaining a session token, which is required for future requests.

Step 1

To begin, ensure you have the following:

  • An API key obtained from your firm. If you do not have these credentials, please contact your firm.
  • The connection URLs, obtained here.

Step 2

API Reference: Login API

Create a POST request with your username and API key.

curl -X 'POST' \
'https://gateway-api-demo.s2f.projectx.com/api/Auth/loginKey' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"userName": "string",
"apiKey": "string"
}'

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.