Reporting: View Session

With the session ID from this call Paged Reported Sessions you can view an individual session with this endpoint.

View Session Specification

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

View Session Workflow

  1. URL: https://api.promoonly.com/tracktrends/session/[SESSION_ID]
  2. Header: Authorization: Bearer Base64(userid:token)
  3. Method: GET
  4. Returned: JSON

    Example JSON Output

    [
        {
            "id": 969261,
            "linkid": 0,
            "played": "2013-12-18 14:56:29-05:00",
            "reported_artist": "Adele",
            "reported_title": "Rumour Has It"
        },
        {
            "id": 969805,
            "linkid": 0,
            "played": "2013-12-18 15:01:42-05:00",
            "reported_artist": "Adele",
            "reported_title": "Rumour Has It"
        },
        {
            "id": 969666,
            "linkid": 0,
            "played": "2013-12-18 15:02:34-05:00",
            "reported_artist": "USHER",
            "reported_title": "CAUGHT UP"
        },
        {
            "id": 969473,
            "linkid": 0,
            "played": "2013-12-18 15:04:02-05:00",
            "reported_artist": "TONY TONI TONE",
            "reported_title": "FEELS GOOD"
        },
        {
            "id": 969212,
            "linkid": 0,
            "played": "2013-12-18 15:04:17-05:00",
            "reported_artist": "El Debarge",
            "reported_title": "Rhythm Of The Night"
        },
        {
            "id": 969394,
            "linkid": 0,
            "played": "2013-12-18 15:05:35-05:00",
            "reported_artist": "El Debarge",
            "reported_title": "Rhythm Of The Night"
        },
        {
            "id": 969702,
            "linkid": 0,
            "played": "2013-12-18 15:05:58-05:00",
            "reported_artist": "Tone Loc",
            "reported_title": "Funky Cold Medina"
        },
        {
            "id": 969158,
            "linkid": 0,
            "played": "2013-12-18 15:07:14-05:00",
            "reported_artist": "Brand Nubian",
            "reported_title": "Step to the Rear"
        }
    ]

Examples

  1. PHP (using cURL):

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

        $api_url = "https://api.promoonly.com/tracktrends/session/770772";

        $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/tracktrends/session/770772",
        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/tracktrends/session/770772"
    result_return = requests.get(api_url, headers=headers)

    print(result_return.text)