Authentication
Authentication is currently done through api_key
authentication. You can retrieve these keys from the
dashboard. You can then provide the api_key
in the x-vital-api-key
header of your
request. For instance:
1 2 3
curl --request GET --url 'https://api.tryvital.io/v2/providers' --header 'x-vital-api-key: <YOUR-API-KEY>'
Legacy
Authentication was previously handled using Bearer tokens.
To generate a token use your
client_id
and client_secret
and make a call to the respective auth endpoint.
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
Response
1 2 3 4 5 6
{ "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6....5taYq45_BU7Wts37cRCjHazA", "scope": "client-grant", "expires_in": 86400, "token_type": "Bearer" }
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.