Authentication

How to Authenticate and obtain a valid JWT


Authenticating

The API uses a Json Web Token (JWT) as authentication/authorization mechanism, usually our JWT expires in 24 hours, so we recommend you repeat this process each day to ensure a new JWT which will add new features as we go forward on our roadmap.

Once you have an account created and active you can obtain a valid JWT and also the ACCOUNT_ID

Entry-point

POST /login/:FACEBOOK_ID
  token=:FACEBOOK_ACCESS_TOKEN
Parameters Description Sample
FACEBOOK_ID Your Facebook User ID 557905121
FACEBOOK_ACCESS_TOKEN Your Facebook Access Token, when accepting Socialmetrix Quantum App CAAGZBqihd9k... yBrwQGzdsoZBSlyK85jWmoykZD

Sample Request:

curl -XPOST "https://api.quantum.socialmetrix.com/login/557905121?token=CAAGZBqihd9k...yBrwQGzdsoZBSlyK85jWmoykZD"

Sample Response:

{
  "jwt": "eyJhbciOiJIUzI1NiJ9.e....uZcUaxQquE",
  "user": {
    ...
    ...
    ...
    "account_id": 668,
    "project_ids": [198]
  }
}

Tip

In order to follow the samples below, you gonna need your JWT, we will use curl to illustrate those commands. To avoid long cut & paste you can declare a variable and use it on the samples:

export TOKEN='YOUR-TOKEN-GOES-HERE'
export ACCOUNT_ID=668