Skip to content

Authentication

API Endpoints

yaml
# Sandbox:
https://staging.api.ultra.io/graphql
# Production:
https://api.ultra.io/graphql

Get your access token

Once you have your credentials you can retrieve your access token manually thanks to the curl command below :

curl \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "grant_type=client_credentials" \
  "https://auth.staging.ultra.io/auth/realms/ultraio/protocol/openid-connect/token"

Then, the response will be like this :

{
    "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJCdTRsMi12RzVZaDdqUFBuSWNSNlZEakxCRzVOQjVlZUdqV2ZfWmlhTVlvIn0.eyJleHAiOjE2ODkyNTM3NzUsImlhdCI6MTY4OTI1MDE3NSwianRpIjoiZjYzNTB```mZTAtYzg4YS00MTE1LTkyYmQtNGZlMjlhMWRkNGI2IiwiaXNzIjoiaHR0cHM6Ly9hdXRoLmRldi51bHRyYS5pby9hdXRoL3JlYWxtcy91bHRyYWlvIiwiYXVkIjpbInVsdHJhV2ViYXBwIiwicmVhbG0tbWFuYWdlbWVudCIsInVsdHJhQ2xvdWRXZWJhcHAiLCJhY2NvdW50IiwicGxhdGZvcm0iXSwic3ViIjoiOTg3YTlhODctMWYyYS00MDIwLWJhNjUtOTE3NjA2OWIyMjM1IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoidGVzdCIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJlYmEiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidWx0cmFXZWJhcHAiOnsicm9sZXMiOlsidXNlciJdfSwicmVhbG0tbWFuYWdlbWVudCI6eyJyb2xlcyI6WyJtYW5hZ2UtdXNlcnMiLCJ2aWV3LXVzZXJzIiwicXVlcnktZ3JvdXBzIiwicXVlcnktdXNlcnMiXX0sInVsdHJhQ2xvdWRXZWJhcHAiOnsicm9sZXMiOlsidXNlciJdfSw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not-before-policy": 1608643774,
    "scope": "some access"
}

Extract the access_token field and use it as a bearer token inside the your graphql queries/mutations :

{
    "headers": {
        "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJCdTRsMi12RzVZaDdqUFBuSWNSNlZEakxCRzVOQjVlZUdqV2ZfWmlhTVlvIn0.eyJleHAiOjE2ODkyNTM3NzUsImlhdCI6MTY4OTI1MDE3NSwianRpIjoiZjYzNTB```mZTAtYzg4YS00MTE1LTkyYmQtNGZlMjlhMWRkNGI2IiwiaXNzIjoiaHR0cHM6Ly9hdXRoLmRldi51bHRyYS5pby9hdXRoL3JlYWxtcy91bHRyYWlvIiwiYXVkIjpbInVsdHJhV2ViYXBwIiwicmVhbG0tbWFuYWdlbWVudCIsInVsdHJhQ2xvdWRXZWJhcHAiLCJhY2NvdW50IiwicGxhdGZvcm0iXSwic3ViIjoiOTg3YTlhODctMWYyYS00MDIwLWJhNjUtOTE3NjA2OWIyMjM1IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoidGVzdCIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJlYmEiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidWx0cmFXZWJhcHAiOnsicm9sZXMiOlsidXNlciJdfSwicmVhbG0tbWFuYWdlbWVudCI6eyJyb2xlcyI6WyJtYW5hZ2UtdXNlcnMiLCJ2aWV3LXVzZXJzIiwicXVlcnktZ3JvdXBzIiwicXVlcnktdXNlcnMiXX0sInVsdHJhQ2xvdWRXZWJhcHAiOnsicm9sZXMiOlsidXNlciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19LCJwbGF0Zm9ybSI6eyJyb2xlcyI6WyIwMDFHIiwiMDAxVSIsIjAwMUEiLCJ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