This API endpoint returns the current download queue for a user's account. The information returned is required to start the media download process.
Example JSON Output
[
{
"artist": "Wiz Khalifa f./Tyga",
"bpm": 100,
"content_warn": false,
"dl_token": "b54a0d2168e7ffa3a635aa05432b2618",
"duration": 163,
"end": "Cold",
"explicit": 0,
"file_type": "mp3",
"genre": "Hip-Hop",
"label": "Atlantic",
"media_type": 2,
"mix": "PO Intro Edit - Clean",
"modified": 1586284932,
"queue_time": "2020-04-07 20:00:49",
"queueid": 12999,
"release": "Express Audio - DJ Tools April 2020: Week 2",
"release_image": "https://pomed.promoonly.com/issue_imgs/0420-ExpAud-wk2_web.png",
"releaseid": 56415,
"servers":
[
"dc03.promoonly.com",
"ny01.promoonly.com",
"sl02.promoonly.com"
],
"title": "Contact",
"titleid": 628212,
"trackid": 374378
},
{
"artist": "CYN",
"bpm": 71,
"content_warn": false,
"dl_token": "63a2c773c9bfed27a983d9c5534848cf",
"duration": 136,
"end": "Cold",
"explicit": 0,
"file_type": "mp3",
"genre": "Top 40",
"label": "Caroline/Capitol",
"media_type": 2,
"mix": "PO Quick Edit",
"modified": 1586284932,
"queue_time": "2020-04-07 20:00:49",
"queueid": 13003,
"release": "Express Audio - DJ Tools April 2020: Week 2",
"release_image": "https://pomed.promoonly.com/issue_imgs/0420-ExpAud-wk2_web.png",
"releaseid": 56415,
"servers":
[
"dc03.promoonly.com",
"ny01.promoonly.com",
"sl02.promoonly.com"
],
"title": "Drinks",
"titleid": 628211,
"trackid": 374377
}
]
PHP (using cURL):
<?php
$userid = 1;
$token = "8b26e1e4f3f5e00a888807e605565c47";
$queue_url = "https://api.promoonly.com/queue";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $queue_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer ".base64_encode($userid.":".$token)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$queue_result = curl_exec($ch);
curl_close($ch);
$remove_obj = json_decode($queue_result);
?>
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/queue",
headers: { "Authorization": auth_str },
dataType: "json",
success: function (data)
{
console.log(data);
}
});
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}
queue_url = "https://api.promoonly.com/queue"
result_return = requests.get(queue_url, headers=headers)
print(result_return.text)