Generate Token
The token endpoint is used to generate an API Access Token which can be used later to search using the Ploogins Search Engine, and a Refresh Token.
https://api.ploogins.com/v1/auth/token
Body Params
The parameters passed to the auth/token
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 |
Request Example
In order to call this endpoint, it is necessary to use the POST method with the two 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"'
const form_data = new FormData();
form_data.append("service_name", "Ploogins");
form_data.append("license_key", "D97B07B7-0955-4B2B-A9FD-9C685716DC19");
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'
}
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.eyJzaWQiOjEsInJvbGUiOiJzZXJ2aWNlIiwic2NvcGUiOiJyZWZyZXNoIiwiZXhwIjoxNzIxNDA0MjE4LCJpYXQiOjE3MjA3OTk0MTh9.iK_sYNIaoWVk6AIQk55j3oLH7R7Q4Ee8-dRkFfrNwCgniWnYzzzot3CX8H8lmbTdw7mScD58tBxcIRAVpy1ptA"
}