Authentication

All authentication is currently done using Bearer tokens. To generate a token use yourclient_id and client_secret and make a call to the respective auth endpoint. .

Auth Endpoints

Sandbox
https://auth.sandbox.tryvital.io/oauth/token
Production
https://auth.tryvital.io/oauth/token
We have both NodeJs and Python Clients which handle authentication and refresh tokens. In the case you want to request these yourself you can make the request as outlined below.
client_id
string
Private Identifier for your team
client_secret
string
Private Identifier for your team
audience
string
API you are trying to access, api.sandbox.tryvital.io or api.tryvital.io
Generate Bearer Token
1
2
3
4
5
6
7
curl --request POST
  --url 'https://auth.sandbox.tryvital.io/oauth/token'
  --header 'content-type: application/x-www-form-urlencoded' 
  --data grant_type=client_credentials 
  --data client_id=** 
  --data client_secret=** 
  --data audience=https://api.sandbox.tryvital.io
access_token
string
Bearer Token
scope
string
Scope of token
expires_in
int
How long in seconds token is valid for
token_type
string
Bearer token
Response
1
2
3
4
5
6
{
 "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IktPQVV4M0ZCaTNsQ21FaXBKcG1ZMiJ9.eyJpc3MiOiJodHRwczovL2F1dGguc2FureJveC50cnl2aXRhbC5pby8iLCJzdWIiOiI1ODJ2VWZ3elhJQ3llWjBkTDl6eU5KYk1VenlrNzBhM0BjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC50cnl2aXRhbC5pbyIsImlhdCI6MTYzMTI4ODg5NiwiZXhwIjoxNjMxMzc1Mjk2LCJhenAiOiI1ODJ2VWZ3elhJQ3llWjBkTDl6eU5KYk1VenlrNzBhMyIsInNjb3BlIjoiY2xpZW50LWdyYW50IiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.mG-ZM-pYo7PnNPNL0_rZHOc-R2NnmkhqDg-ITTfWQdyysIhAslMeDjLwKFxQlljmijwoS7YPF6TWHxo6k0BKVnPXNQAj4sDDUiJ5qIJ9a9ofKjmd4X8jtI4jc5VKCG8Sfi2c54kjs2aRBR-kmFRi2lpA86XrKVl2gEW4uTQ0NJVOnfOfn_Wjw7XDtoEapICL5OkOKuUznDsuVR2YMLr5tPjNwpnhYktZKhS3YAtApqXqr_DJFW3rdBMch99gf89lPWaDZTAQ7HAzQw9LUPwmwF3a61ji7zY9nzLdsIt4LiE8rIvJJRpRE23IUxjrrX5taYq45_BU7Wts37cRCjHazA",
 "scope": "client-grant",
 "expires_in": 86400,
 "token_type": "Bearer"
}