This endpoint allows you to submit a username (account email) and password via POST. If authentication is successful, the POOL User ID, the account API Key, API Secret, a valid access token, an expiration timestamp for the access token, and the current server timestamp will be returned via JSON.
Example JSON Output:
{
"result": "Authenticated",
"api_key": "a8246dd6a835b1df4qwd8503b3b5fa817",
"api_secret": "718a24nvmbha235faud23dv8ndwhcy23n",
"userid": 1,
"token": "8b26e1e4f3f5e00a888807e605565c47",
"expiration": 1585080310,
"server_time": 1585079710
}
- OR -
{
"result": "Invalid email and password combination."
}
- OR -
{
"result": "Invalid account setup."
}
PHP (using cURL):
<?php
$post_fields = "email=test@promoonly.com&password=testpassword";
$userid_url = "https://api.promoonly.com/user/authenticate/signin";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $userid_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$signin_result = curl_exec($ch);
curl_close($ch);
$signin_obj = json_decode($userid_result);
?>
Javascript (using jQuery):
$.ajax({
type: "POST",
url: "https://api.promoonly.com/user/authenticate/signin",
data: { email: "test@promoonly.com", password: "testpassword" },
dataType: "json",
success: function (data)
{
console.log(data);
}
});
Python (using requests):
#!/usr/bin/env python
import requests
import urllib
user_data = { "email": "test@promoonly.com", "password": "testpassword" }
signin_url = "https://api.promoonly.com/user/authenticate/signin"
signin_result = requests.post(signin_url, data=user_data)
print(signin_result.text)