Get Authorization token
Retrieves a JWT for authentication.
Uses client_id and client_secret
and returns a token.
The token should be used in
subsequent API requests. The expires_in field denotes the number of
seconds the token will remain valid.
Body·
required
application/json
Request body for obtaining an authorization token.
- Type: stringclient
_id requiredUnique identifier for the client application.
- Type: stringclient
_secret requiredSecret key for the client application.
- Type: stringgrant
_type requiredMust be 'client_credentials' for this flow.
Responses
- application/json
- application/json
- 401
Authorization failed - Invalid credentials provided.
Request Example for post/auth/oauth2/v1/token
curl https://api.pre.helthjem.no/auth/oauth2/v1/token \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"client_id": "xxx",
"client_secret": "xxx",
"grant_type": "client_credentials"
}'
{
"token": "eyJhbGciOiJIUzI1Ni...",
"expires_in": 86400,
"token_type": "Bearer"
}