The first step in establishing communication with the Younium API is to acquire an access token. Access tokens are issued by Younium Identity Server and are in the form of JWT tokens. To obtain the access token, make an HTTP POST to the following URL:
Acquiring a JWT access token
The following example is using Postman for sending an authentication request to the Sandbox environment.
username: [Younium username]
scope: openid youniumapi profile
legal_entity: [legal entity name or uuid]
If the Younium tenant you're authenticating to has multiple legal entities, specify the legal entity you want to authenticate to by including the legal entity in the body:
If the credentials provided are valid, a successful JSON response contains:
access_token: [JWT token]
If the the credentials provided are not valid an JSON response will be returned containing:
error: [Error message]
Making Authenticated calls to the Younium API
The access token received from a successful authentication will then be used to make authenticated calls to the Younium API.
All requests to the Younium API should have the following HTTP Headers:
Authorization: Bearer [JWT token]
api-version : [version](optional)
Example of headers for a request to Younium API:
The header api-version may be set to specify which version of the api to be called. By default version 2.1 will be called.
If Authorization fails a 401 Unauthorized response will be returned.