Authentication
Obtain a JWT for use as a Bearer token on any Qvalia API
Exchange an API key for a short-lived JWT access token, authenticating as accountRegNo (a Partner uses its own partnerRegNo here). The returned token can be used as a Bearer token (Authorization: Bearer <token>) on any Qvalia API endpoint as an alternative to the API key.
GET always authenticates as self; use POST if you need to act on behalf of a child account (actingAs: parent).
Tokens expire after one hour.
Account registration number issued by Qvalia. A Partner uses its own partnerRegNo here.
""API key for the account, sent as Authorization: ApiKey <api_key>
1234567890ABCDEFOK
Bearer3600Unauthorized
Unprocessable Entity
Internal Server Error
GET /token/{accountRegNo} HTTP/1.1
Host: api-qa.qvalia.com
Authorization: text
Accept: */*
{
"access_token": "text",
"token_type": "Bearer",
"expires_in": 3600
}Create access token (JWT) for accountRegNo, or on behalf of a child account
Exchange an API key for a short-lived JWT access token, authenticating as accountRegNo (a Partner uses its own partnerRegNo here).
actingAs: self(default) — issue a token foraccountRegNoitself.actingAs: parent— a Partner issues a token to act on behalf of a child account;forChildRegNois required and the Partner must be authorized for that child. The token'ssubclaim will be the child account.
The request body may be omitted entirely, which is equivalent to {"actingAs": "self"}.
Tokens expire after one hour.
Account registration number issued by Qvalia. A Partner uses its own partnerRegNo here.
""Optional, defaults to "self". If "parent", forChildRegNo is required and the caller must be authorized to act on behalf of that child.
selfExample: selfPossible values: Required when actingAs is "parent"; the child account to act for.
SE1234567890OK
Bearer3600Unauthorized
Unprocessable Entity
Internal Server Error
POST /token/{accountRegNo} HTTP/1.1
Host: api-qa.qvalia.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 50
{
"actingAs": "self",
"forChildRegNo": "SE1234567890"
}{
"access_token": "text",
"token_type": "Bearer",
"expires_in": 3600
}Exchange client_id (your accountRegNo) and client_secret (your API key) for a short-lived JWT access token. Use this as an alternative to POST /token/{accountRegNo} when you'd rather not put accountRegNo in the URI and the API key in the Authorization header - for example, if your client is built around an OAuth2-style client-credentials exchange.
actingAs: self(default) — issue a token forclient_iditself.actingAs: parent— a Partner issues a token to act on behalf of a child account;forChildRegNois required and the Partner (client_id) must be authorized for that child. The token'ssubclaim will be the child account.
There is no bodyless GET /token equivalent - GET always requires accountRegNo in the URI, see GET /token/{accountRegNo}.
Tokens expire after one hour.
Optional, defaults to "self". If "parent", forChildRegNo is required and the caller must be authorized to act on behalf of that child.
selfExample: selfPossible values: Required when actingAs is "parent"; the child account to act for.
SE1234567890Your accountRegNo (a Partner uses its own partnerRegNo here).
SE5567321707Your API key.
OK
Bearer3600Unauthorized
Unprocessable Entity
Internal Server Error
POST /token HTTP/1.1
Host: api-qa.qvalia.com
Content-Type: application/json
Accept: */*
Content-Length: 100
{
"actingAs": "self",
"forChildRegNo": "SE1234567890",
"client_id": "SE5567321707",
"client_secret": "text"
}{
"access_token": "text",
"token_type": "Bearer",
"expires_in": 3600
}Last updated
Was this helpful?

