Preferences: Get User Information

This endpoint returns User and Profile information for the POOL User account.

Get User DJ Types Specification

Parameters: Header variables:
  1. userid: integer
  2. token: string
JSON returned:

Get User DJ Types Workflow

  1. URL: https://api.promoonly.com/user/dj_types
  2. Header: Authorization: Bearer Base64(userid:token)
  3. Method: GET
  4. Returned: JSON

    Example JSON Output

    {
        "caps_space": "0,0,0,0,0,0",
        "company": "Promo Only",
        "dj_alias": "POOL Test DJ",
        "dj_program": 1,
        "dj_types":
        [
            {
                "id": 9,
                "selected": 0,
                "type": "Bars"
            },
            {
                "id": 3,
                "selected": 1,
                "type": "Bowling Alleys"
            },
            {
                "id": 6,
                "selected": 0,
                "type": "Clubs"
            },
            {
                "id": 7,
                "selected": 0,
                "type": "Corporate Events"
            },
            {
                "id": 10,
                "selected": 0,
                "type": "Festivals"
            },
            {
                "id": 14,
                "selected": 0,
                "type": "Gentlemen's Clubs"
            },
            {
                "id": 8,
                "selected": 0,
                "type": "Mitzvahs"
            },
            {
                "id": 1,
                "selected": 1,
                "type": "Mobile DJ"
            },
            {
                "id": 11,
                "selected": 0,
                "type": "Radio"
            },
            {
                "id": 5,
                "selected": 1,
                "type": "School Dances"
            },
            {
                "id": 2,
                "selected": 1,
                "type": "Skating Rinks"
            },
            {
                "id": 13,
                "selected": 0,
                "type": "Social Events"
            },
            {
                "id": 12,
                "selected": 1,
                "type": "Sporting Events"
            },
            {
                "id": 4,
                "selected": 0,
                "type": "Weddings"
            }
        ],
        "dj_types_indexes": "3,1,5,2,12",
        "download_location": "/Users/User/Music/pool",
        "duplicate_files_index": 1,
        "duplicate_option": 1,
        "file_naming": "2,1,1,0,3,3,1,0,0,1,0,0,0",
        "format_audio": 1,
        "format_video": 1,
        "hide_singles": 0,
        "industry": "Radio/Broadcast",
        "last_login": "Mon, 06 Apr 2020 16:51:12 GMT",
        "last_update": "Mon, 06 Apr 2020 16:51:21 GMT",
        "name_first": "POOL",
        "name_last": "User",
        "no_duplicates": 0,
        "notify_frequency": 2000,
        "phone": "407-331-3600",
        "report_opt": 1,
        "session_location": "/Users/User/Music/_Serato_/History/Sessions",
        "title": "POOL Test User",
        "userid": 1
    }

Examples

  1. PHP (using cURL):

    <?php
        $userid = 1;
        $token = "8b26e1e4f3f5e00a888807e605565c47";

        $api_url = "https://api.promoonly.com/user/info";

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $api_url);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer ".base64_encode($userid.":".$token)));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        $api_result = curl_exec($ch);
        curl_close($ch);

        $api_obj = json_decode($api_result);
    ?>
  2. Javascript (using jQuery):

    function b64EncodeUnicode(str)
    {
        return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
            function toSolidBytes(match, p1)
            {
                return String.fromCharCode('0x' + p1);
            }));
    }

    var userid = 1;
    var token = "8b26e1e4f3f5e00a888807e605565c47";
    var auth_str = "Bearer " + b64EncodeUnicode(userid + ":" + token);

    $.ajax({
        type: "GET",
        url: "https://api.promoonly.com/user/info",
        headers: { "Authorization": auth_str },
        dataType: "json",
        success: function (data)
        {
            console.log(data);
        }
    });
  3. Python (using requests):

    #!/usr/bin/env python

    import requests
    import base64
    import urllib

    userid = 1
    token = "8b26e1e4f3f5e00a888807e605565c47"

    b64_key = base64.b64encode("%s:%s" % (userid, token))
    headers = {"Authorization": "Bearer %s" % b64_key}
    api_url = "https://api.promoonly.com/user/info"
    result_return = requests.get(api_url, headers=headers)

    print(result_return.text)