Authentication

The Cube.JS endpoint accepts a signed JWT with the following properties:

  "iat": 1636738215,
  "sub": "admin@example.com",
  "jti": "b4483192-f451-466a-991e-0b66c34d5ba7",
  "exp": 2636738275,
  "id": 1,
  "org": 8,
  "superuser": true,
  "global_perms": [
    "view_analytics"
  ]

You may obtain a JWT from the SD Elements API endpoint /api/v2/users/me/auth-token/

Please note that by default, generated JWTs will expire after 1 minute.

Authentication Steps:

API Token

In order to get an API access token through SD Elements, you can use the Token Authentication section under API v2 Introduction

JWT Token

Next we can use the API access token to request a token from the SD Elements API.

GET /api/v2/users/me/auth-token/ HTTP/1.1
Accept: application/json
Authorization: Token 44f1cd6c82254533c22990c612efa6c810d23845

Once we have the token, we can send queries to the Cube js API!

A complete HTTP query looks like this:

GET /cubejs-api/v1/load HTTP/1.1
Accept: application/json
Authorization: YOUR_JWT
params: {
          query: {
            schema: "application",
            dimensions: ["Application.name"],
            measures: ["Project.count"],
            filters: [
              member: "Application.name",
              operator: "equals",
              values: ["My Application"],
            ]
          },
        }

results matching ""

    No results matching ""