Obtaining an Access Token
To interact with the Pricka API, you first need to obtain an access token. Pricka API uses OAuth 2.0 Client Credentials flow for authentication och authorization.
Steps to Acquire the Token
Follow these steps to make a post request and receive your access token:
- Make a POST request to https://api.pricka.se/oauth/token.
- Use
x-www-form-urlencoded
as the body type in your request. - Include these keys in your request body:
client_id
: Use the client ID from your generated client credentials.client_secret
: Use the client secret from your generated client credentials.grant_type
: This should be set toclient_credentials
.
Example request with curl to obtain an access token
curl -X POST https://api.pricka.se/oauth/token -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=client_credentials" -d "client_id=<Replace with your client id>" -d "client_secret=<Replace with your client secret>"
Receiving the Access Token
Upon making the request, you will receive a response containing the access token:
- The access token can be found in the
access_token
field within the response body.
Using the Access Token
With the access token, you're now ready to make authenticated requests to the Pricka API:
- Include the access token as a Bearer token in the Authorization header for your requests to the API.
This token is essential for accessing and interacting with the various endpoints provided by Pricka API.