This endpoint accepts an access token string and a POOL User ID as POST arguments and returns whether or not that access token is still valid for POOL API calls.
Example JSON Output:
{
"token": "valid"
}
- OR -
{
"token": "invalid"
}
PHP (using cURL):
<?php
$post_fields = "userid=1&token=8b26e1e4f3f5e00a888807e605565c47";
$validation_url = "https://api.promoonly.com/user/token/validate";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $validation_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$validation_result = curl_exec($ch);
curl_close($ch);
$result_obj = json_decode($validation_result);
?>
Javascript (using jQuery):
$.ajax({
type: "POST",
url: "https://api.promoonly.com/user/token/validate",
data: { userid: 1, token: "8b26e1e4f3f5e00a888807e605565c47" },
dataType: "json",
success: function (data)
{
console.log(data);
}
});
Python (using requests):
#!/usr/bin/env python
import requests
import urllib
user_data = { "userid": 1, "token": "8b26e1e4f3f5e00a888807e605565c47" }
validate_url = "https://api.promoonly.com/user/token/validate"
validation_result = requests.post(validate_url, data=user_data)
print(validation_result.text)