Generate an admin access token
Use your client credentials to generate a short-lived admin access token for authenticating with WLL’s admin API.
Last updated
curl --request POST \
--url https://auth.wlloyalty.net/oauth/token \
--header 'content-type: application/json' \
--data '{
"client_id":"$YOUR_ID",
"client_secret":"$YOUR_SECRET",
"audience":"wlloyalty.net",
"grant_type":"client_credentials"
}'const request = require('request');
request(
{
method: 'POST',
url: 'https://auth.wlloyalty.net/oauth/token',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
client_id: '$YOUR_ID',
client_secret: '$YOUR_SECRET',
audience: 'wlloyalty.net',
grant_type: 'client_credentials'
}),
},
(error, response, body) => {
if (error) throw new Error(error);
console.log(body);
}
);curl --request POST \
--url https://auth.wlloyalty.net/oauth/token \
--header 'content-type: application/json' \
--data '{
"client_id":"$YOUR_ID",
"client_secret":"$YOUR_SECRET",
"audience":"staging.wlloyalty.net",
"grant_type":"client_credentials"
}'curl --request POST \
--url https://auth.wlloyalty.net/oauth/token \
--header 'content-type: application/json' \
--data '{
"client_id":"$YOUR_ID",
"client_secret":"$YOUR_SECRET",
"audience":"production.wlloyalty.net",
"grant_type":"client_credentials"
}'