Skip to content
On this page

Action: Authenticate

Before being able to execute any operations, such as subscribing to a market data channel, you need to authenticate yourself. This is done by sending an authenticate action to the server as described below. For this action, you need an API key which you can create in the Developer section of the ConfluenceCode website.

Operation

In order to authenticate you should send an "authenticate" action with an object with an "apiKey" property as body, like so:

json
{
  "action": "authenticate",
  "body": {
    "apiKey": "{api-key}"
  }
}

If the provided API key is valid, the server will respond with a successful "authenticate" action-response:

json
{
  "action": "authenticate",
  "success": true
}

If the API key is invalid, the server will respond as such:

json
{
  "action":"authenticate",
  "success":false,
  "message":"Invalid API key"
}