Listings: View Formats by Date - Paginated

This is one of four ways to display POOL distribution paginated by date. This view will show all Promo Only release formats arranged in order by date, in a paginated view. The default view will show 15 dates in descending order (most recent dates displayed first).

View Formats by Date - Paginated Specification

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

View Formats by Date - Paginated Workflow

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

    Example JSON Output

    [
        {
            "date": "2020-04-08",
            "releases":
            [
                {
                    "artist": "Promo Only",
                    "downloaded" :0,
                    "formatid": 63,
                    "genre": "Compilation",
                    "id": 56414,
                    "image_url": "https://pomed.promoonly.com/issue_imgs/0420-ExpAu-wk2.png",
                    "label": "Promo Only Issue",
                    "label_url": "https://loop.promoonly.com/assets/po_small.png",
                    "modified": 1586362937,
                    "release": "Express Audio DFF April 2020: Week 2",
                    "tracks": 34,
                    "type":2
                },
                {
                    "artist": "Promo Only",
                    "downloaded": 0,
                    "formatid": 7,
                    "genre": "Compilation",
                    "id": 56218,
                    "image_url": "https://pomed.promoonly.com/issue_imgs/MRV_0520.jpg",
                    "label": "Promo Only Issue",
                    "label_url": "https://loop.promoonly.com/assets/po_small.png",
                    "modified": 1586344942,
                    "release": "Modern Rock Video May 2020",
                    "tracks": 24,
                    "type": 1
                }
            ],
            "ts": 1586304000
        },
        {
            "date": "2020-04-07",
            "releases":
            [
                {
                    "artist": "Promo Only",
                    "downloaded": 29,
                    "formatid": 93,
                    "genre": "Compilation",
                    "id": 56415,
                    "image_url": "https://pomed.promoonly.com/issue_imgs/0420-ExpAud-wk2_web.png",
                    "label": "Promo Only Issue",
                    "label_url": "https://loop.promoonly.com/assets/po_small.png",
                    "modified": 1586284932,
                    "release": "Express Audio - DJ Tools April 2020: Week 2",
                    "tracks": 29,
                    "type": 2
                },
                {
                    "artist": "Promo Only",
                    "downloaded": 0,
                    "formatid": 14,
                    "genre": "Compilation",
                    "id": 56296,
                    "image_url": "https://pomed.promoonly.com/issue_imgs/0420-ExpVid-wk3.jpg",
                    "label": "Promo Only Issue",
                    "label_url": "https://loop.promoonly.com/assets/po_small.png",
                    "modified": 1586294533,
                    "release": "Express Video April 2020: Week 3",
                    "tracks": 23,
                    "type": 1
                }
            ],
            "ts": 1586217600
        }
    ]

Examples

  1. PHP (using cURL):

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

        $date_formats_url = "https://api.promoonly.com/formats/date/1";

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

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

        $date_formats_obj = json_decode($date_formats_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/formats/date/1",
        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}
    date_formats_url = "https://api.promoonly.com/formats/date/1"
    result_return = requests.get(date_formats_url, headers=headers)

    print(result_return.text)