Listings: Specialty Tracks by Year

The API endpoint will return all tracks within a given year where there are tracks that are a part of a specialty release that the POOL user has access to through a purchase, subscription, or give away.

Specialty Tracks by Year Specification

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

Specialty Tracks by Year Workflow

  1. URL: https://api.promoonly.com/specialty/tracks/[YEAR YYYY]
  2. Header: Authorization: Bearer Base64(userid:token)
  3. Method: GET
  4. Returned: JSON

    Example JSON Output

    {
        "track_count": 3,
        "tracks":
        [
            {
                "artist": "Krokus",
                "bpm": 144,
                "content_warning": true,
                "downloaded": 0,
                "duration": 243,
                "end": "Cold",
                "explicit": 0,
                "genre": "Rock",
                "id": 150493,
                "label": "Arista",
                "media": 1,
                "mix": "",
                "modified": 1383832991,
                "release": "Best of Hair Bands Vol. 4",
                "release_date": "Thu, 07 Nov 2013 00:00:00 GMT",
                "release_image": "https://pomed.promoonly.com/issue_imgs/BestOfHairBands_v4.png",
                "releaseid": 13448,
                "title": "Midnight Maniac",
                "titleid": 392179,
                "track_order": null
            },
            {
                "artist": "Metal Gurus",
                "bpm": 138,
                "content_warning": false,
                "downloaded": 0,
                "duration": 190,
                "end": "",
                "explicit": 0,
                "genre": "",
                "id": 150729,
                "label": "Mercury",
                "media": 1,
                "mix": "",
                "modified": 1385148572,
                "release": "UK Best Of Christmas Video",
                "release_date": "Fri, 08 Nov 2013 00:00:00 GMT",
                "release_image": "https://pomed.promoonly.com/issue_imgs/christmasvideo.jpg",
                "releaseid": 3465,
                "title": "Merry Christmas Everybody",
                "titleid": 268200,
                "track_order": null
            },
            {
                "artist": "Mud",
                "bpm": 141,
                "content_warning": false,
                "downloaded": 0,
                "duration": 177,
                "end": "Fade",
                "explicit": 0,
                "genre": "",
                "id": 221333,
                "label": "RCA",
                "media": 1,
                "mix": "",
                "modified": 1457021615,
                "release": "UK Back To The Sixties & Seventies Vol 1",
                "release_date": "Wed, 02 Mar 2016 00:00:00 GMT",
                "release_image": "https://s3.amazonaws.com/pool.images/27328_rel.jpg",
                "releaseid": 27328,
                "title": "Dyna-mite",
                "titleid": 504634,
                "track_order":null
            }
        ]
    }

Examples

  1. PHP (using cURL):

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

        $specialty_url = "https://api.promoonly.com/specialty/tracks/1973";

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

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

        $specialty_obj = json_decode($specialty_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/specialty/tracks/1973",
        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}
    specialty_url = "https://api.promoonly.com/specialty/tracks/1973"
    result_return = requests.get(specialty_url, headers=headers)

    print(result_return.text)