Refresh Token
The refresh endpoint is used to generate a new API Access Token from a previously obtained refresh token. A new refresh token will be generated as well.
https://api.ploogins.com/v1/auth/refresh
Body Params
The parameters passed to the auth/refresh
endpoint need to be passed as formData.
Name | Type | Description | Example |
---|---|---|---|
service_name * | string | Your service name, provided by the Ploogins team | Ploogins |
license_key * | string | Your license key, provided by the Ploogins team | D97B07B7-0955-4B2B-A9FD-9C685716DC19 |
refresh_token * | string | The previously generated refresh token | eyJhbGciOiJIUzUxMiIsI... |
Request Example
In order to call this endpoint, it is necessary to use the POST method with the three required parameters
- CURL
- Javascript
- Python
curl --location 'api.ploogins.com/v1/auth/token' \
--form 'service_name="Ploogins"' \
--form 'license_key="D97B07B7-0955-4B2B-A9FD-9C685716DC19"' \
--form 'refresh_token="eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzaWQiOjEsInJvbGUiOiJzZXJ2aWNlIiwic2NvcGUiOiJyZWZyZXNoIiwiZXhwIjoxNzIwNzk5NzE4LCJpYXQiOjE3MjA3OTk0MTh9.CTt4-6fMerqM7QzwJrt0y4EpzA9w4UQYTgbxaRXgwmQy4rxgdbn8eQdz6K-pHJKX8m6L05MeOMrbk3Gpw0EK7w"'
const form_data = new FormData();
form_data.append("service_name", "Ploogins");
form_data.append("license_key", "D97B07B7-0955-4B2B-A9FD-9C685716DC19");
form_data.append("refresh_token", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzaWQiOjEsInJvbGUiOiJzZXJ2aWNlIiwic2NvcGUiOiJyZWZyZXNoIiwiZXhwIjoxNzIwNzk5NzE4LCJpYXQiOjE3MjA3OTk0MTh9.CTt4-6fMerqM7QzwJrt0y4EpzA9w4UQYTgbxaRXgwmQy4rxgdbn8eQdz6K-pHJKX8m6L05MeOMrbk3Gpw0EK7w");
var requestOptions = {
method: 'POST',
body: form_data,
redirect: 'follow'
};
fetch("api.ploogins.com/v1/auth/token", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
import requests
url = "api.ploogins.com/v1/auth/token"
payload = {
'service_name': 'Ploogins',
'license_key': 'D97B07B7-0955-4B2B-A9FD-9C685716DC19',
'refresh_token': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzaWQiOjEsInJvbGUiOiJzZXJ2aWNlIiwic2NvcGUiOiJyZWZyZXNoIiwiZXhwIjoxNzIwNzk5NzE4LCJpYXQiOjE3MjA3OTk0MTh9.CTt4-6fMerqM7QzwJrt0y4EpzA9w4UQYTgbxaRXgwmQy4rxgdbn8eQdz6K-pHJKX8m6L05MeOMrbk3Gpw0EK7w'
}
files = []
headers = {}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
Response Example
warning
The generated access token will only be valid for 5 minutes. After this time, another token will need to be generated.
The refresh token will be valid for 7 days, or until a new refresh token is requested.
{
"access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzaWQiOjEsInJvbGUiOiJzZXJ2aWNlIiwic2NvcGUiOiJhY2Nlc3MiLCJleHAiOjE3MjA3OTk3MTgsImlhdCI6MTcyMDc5OTQxOH0.Hcl-qci9qGwhMNroVw1ubQimP5xyLMazqnXLmIxVA58gHp_h0vCyadkVc9J2BQOi0bxpEuJqRv8JzY_6Hap-VA",
"refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzaWQiOjEsInJvbGUiOiJzZXJ2aWNlIiwic2NvcGUiOiJyZWZyZXNoIiwiZXhwIjoxNzIwNzk5NzE4LCJpYXQiOjE3MjA3OTk0MTh9.CTt4-6fMerqM7QzwJrt0y4EpzA9w4UQYTgbxaRXgwmQy4rxgdbn8eQdz6K-pHJKX8m6L05MeOMrbk3Gpw0EK7w"
}