Authentication: Sign In

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.

Sign In Specification:

Parameters: POST variables:
  1. email: Correctly formatted email address
  2. password: String
Header variables:
  1. None
Data returned:

Sign In Work Flow:

  1. URL: https://api.promoonly.com/user/authenticate/signin
  2. Header: none
  3. Method: POST
  4. POST Variables:
    • email: EMAIL ADDRESS
    • password: PASSWORD
  5. Returned: 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."
    }

Examples

  1. 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);
    ?>
  2. 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);
        }
    });
  3. 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)