GraphQL Endpoint and Access Token

GraphQL Endpoint

All the Analytics Queries in DingoQL will be executed against a grahql Endpoint which can be found in the Tenant Setting tab.

GraphQL Endpoint

Access Token

To execute an analytics query on DingoQL from your application, each network call should contain a header ACCESS-TOKEN. ACCESS-TOKEN header should be set to the access token which will be generated as follows.

Generating Access Token

Step 1

Copy Secret Key by clicking "Click Here To Copy Encryption Key".

Step 2

Create a json with all the secured filters you want to apply on client's visualisation. For example

{
  "filters": [{
      "column": "username",
      "value": "anunay.biswas"
  }]
}

Step 3

Your application server should encrypt the json string using the secret key acquired in step 1. To do this in NodeJS crypto-js module can be used.

const CryptoJS = require('crypto-js')
const secretKey = "xg4f8dw45m3trz7u"
const accessTokenData = {
  "filters": [{
      "column": "username",
      "value": "anunay.biswas"
  }]
};
const accessToken = CryptoJS.AES.encrypt(JSON.stringify(accessTokenData), secretKey);
console.log('ENCRYPTED ACCESS-TOKEN', ciphertext.toString());

Step 4

Server should provide this access token to client. While making any query to DingoQL's graphql endpoint client should set this access token in ACCESS-TOKEN header.

Client should not become aware of the secret key at any point. This will result in a severe security bug.