Buckets

post
Create a bucket

https://api-v2.acrcloud.com/api/buckets
Create an empty bucket, then you can upload audio files or add channels to this bucket to create your fingerprint database.
Request
Response
Request
Headers
Authentication
required
string
Bearer token
Form Data Parameters
name
required
string
The bucket name
region
required
string
eu-west-1,us-west-2,ap-southeast-1
type
required
string
File,Live,LiveRec,LiveTimeshift
net_type
optional
number
0,1,2
labels
optional
array
The labels for the bucket. For examples: ["Music", "Comercial"]
metadata_template
optional
string
Metadata template
Response
201: Created
{
"data": {
"id": 8881,
"uid": 1,
"name": "bucket_music",
"type": "File",
"node": "127.0.0.1-871",
"state": 1,
"region": "ap-southeast-1",
"metadata_template": "{\"artist\":{\"default\":\"abc\"}, \"album\":{\n\"type\":\"select\", \"default\":\"334\", \"options\":[\"123\", \"334\"]}}",
"labels": [
"Music",
"Video"
],
"net_type": 1,
"created_at": "2019-03-01 15:31:25",
"updated_at": "2019-08-16 07:17:32",
"num": 10,
"size": "300000",
"access_permission": "private"
}
}
Curl
Python
PHP
Nodejs
Curl
curl --location --request POST 'https://api-v2.acrcloud.com/api/buckets' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{
"name":"avbucket",
"type":"File",
"labels":["Music", "Video"],
"net_type":1,
"region":"ap-southeast-1"
}'
Python
import requests
url = "https://api-v2.acrcloud.com/api/buckets"
data={"name":"avbucket",
"type":"File",
"labels":["Music", "Video"],
"net_type":1,
"region":"ap-southeast-1"
}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.post(url, headers=headers, json=data)
print(response.text)
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-v2.acrcloud.com/api/buckets',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('name' => 'testbucket','region' => 'ap-southeast-1','type' => 'File'),
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Bearer token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Nodejs
var axios = require('axios');
var data = JSON.stringify({"name":"avbucket","type":"File","labels":["Music","Video"],"net_type":1,"region":"ap-southeast-1"});
var config = {
method: 'post',
url: 'https://api-v2.acrcloud.com/api/buckets',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer token',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});

get
List Buckets

https://api-v2.acrcloud.com/api/buckets
Return a list of your buckets.
Request
Response
Request
Headers
Authentication
optional
string
Bearer token
Query Parameters
page
optional
number
The page number
per_page
optional
number
The results number per page. Default is 20
region
optional
string
eu-west-1,us-west-2,ap-southeast-1
type
optional
string
File,Live,LiveRec,LiveTimeshift
Response
200: OK
{
"data": [
{
"id": 14791,
"uid": 19,
"name": "test",
"type": "Live",
"state": 1,
"region": "eu-west-1",
"metadata_template": null,
"labels": [
"TV"
],
"net_type": 1,
"created_at": "2020-07-16 11:09:20",
"updated_at": "2020-07-16 11:09:20",
"num": 0,
"size": 0,
"access_permission": "private"
},
{
"id": 14556,
"uid": 19,
"name": "adsfasdf",
"type": "LiveTimeshift",
"state": 1,
"region": "eu-west-1",
"metadata_template": "",
"labels": [
""
],
"net_type": 1,
"created_at": "2020-06-24 11:07:00",
"updated_at": "2020-06-24 11:07:00",
"num": 0,
"size": 0,
"access_permission": "private"
},
{
"id": 12310,
"uid": 19,
"name": "eu_shared_bucket2",
"type": "LiveRec",
"state": 1,
"region": "eu-west-1",
"metadata_template": "",
"labels": [
"Radio"
],
"net_type": 1,
"created_at": "2019-10-30 07:54:56",
"updated_at": "2019-10-30 07:54:56",
"num": 0,
"size": 0,
"access_permission": "private"
},
{
"id": 12309,
"uid": 19,
"name": "eu_shared_bucket",
"type": "LiveRec",
"node": "",
"state": 1,
"region": "eu-west-1",
"metadata_template": "",
"labels": [
"Radio"
],
"net_type": 1,
"created_at": "2019-10-30 07:53:58",
"updated_at": "2019-10-30 07:53:58",
"num": 0,
"size": 0,
"access_permission": "private"
},
{
"id": 1159,
"uid": 19,
"name": "us_bucket",
"type": "File",
"state": 1,
"region": "global",
"metadata_template": "",
"labels": [
"Music"
],
"net_type": 0,
"created_at": "2016-05-11 06:49:55",
"updated_at": "2017-07-17 11:48:06",
"num": 7,
"size": "1487",
"access_permission": "private"
},
{
"id": 1116,
"uid": 19,
"name": "offline-bucket",
"type": "File",
"node": "10.12.12.236-850",
"state": 1,
"region": "eu-west-1",
"metadata_template": "",
"labels": [
"Music"
],
"net_type": 2,
"created_at": "2016-05-01 07:10:16",
"updated_at": "2018-01-05 16:41:15",
"num": 0,
"size": 0,
"access_permission": "private"
}
],
"links": {
"first": "https://api-v2.acrcloud.com/api/buckets?page=1",
"last": "https://api-v2.acrcloud.com/api/buckets?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://api-v2.acrcloud.com/api/buckets",
"per_page": 20,
"to": 6,
"total": 6
}
}
Curl
Python
PHP
Nodejs
Curl
equest GET 'https://api-v2.acrcloud.com/api/buckets?region=eu-west-1' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'
Python
import requests
url = "https://api-v2.acrcloud.com/api/buckets?region=eu-west-1"
payload={}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-v2.acrcloud.com/api/buckets?region=eu-west-1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Bearer token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Nodejs
var data = qs.stringify({
});
var config = {
method: 'get',
url: 'https://api-v2.acrcloud.com/api/buckets?region=eu-west-1',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});

get
Get a bucket

https://api-v2.acrcloud.com/api/buckets/:id
Get the details of a bucket.
Request
Response
Request
Path Parameters
id
required
number
The bucket id
Headers
Authentication
required
string
Bearer token
Response
200: OK
{
"data": {
"id": 8881,
"uid": 1,
"name": "bucket_music",
"type": "File",
"node": "127.0.0.1-871",
"state": 1,
"region": "ap-southeast-1",
"metadata_template": "{\"artist\":{\"default\":\"abc\"}, \"album\":{\n\"type\":\"select\", \"default\":\"334\", \"options\":[\"123\", \"334\"]}}",
"labels": [
"Music",
"Video"
],
"net_type": 1,
"created_at": "2019-03-01 15:31:25",
"updated_at": "2019-08-16 07:17:32",
"num": 10,
"size": "300000",
"access_permission": "private"
}
}
Curl
Python
PHP
Nodejs
Curl
curl --request GET 'https://api-v2.acrcloud.com/api/buckets/8881' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer your_access_token'
Python
import requests
url = "https://api-v2.acrcloud.com/api/buckets/966"
payload={}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer your_access_token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-v2.acrcloud.com/api/buckets/966',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Bearer your_access_token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios');
var config = {
method: 'get',
url: 'https://api-v2.acrcloud.com/api/buckets/966',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer your_access_token'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Nodejs
var axios = require('axios');
var config = {
method: 'get',
url: 'https://api-v2.acrcloud.com/api/buckets/966',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer your_access_token'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});

put
Update a bucket

https://api-v2.acrcloud.com/api/buckets/:id
Update the details of the bucket.
Request
Response
Request
Path Parameters
id
required
number
The bucket id
Headers
Authentication
required
string
Bearer token
Form Data Parameters
metadata_template
optional
string
Update the metadata_template
labels
optional
string
Update the labels
name
optional
string
Update the bucket name
Response
200: OK
{
"data": {
"id": 8881,
"uid": 1,
"name": "bucket_music",
"type": "File",
"node": "127.0.0.1-871",
"state": 1,
"region": "ap-southeast-1",
"metadata_template": "{\"artist\":{\"default\":\"abc\"}, \"album\":{\n\"type\":\"select\", \"default\":\"334\", \"options\":[\"123\", \"334\"]}}",
"labels": [
"Music",
"Video"
],
"net_type": 1,
"created_at": "2019-03-01 15:31:25",
"updated_at": "2019-08-16 07:17:32",
"num": 10,
"size": "300000",
"access_permission": "private"
}
}
Curl
Curl
curl --location --request PUT 'https://api-v2.acrcloud.com/api/buckets/8881' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{"name":"bucket-music"}'

delete
Delete the bucket

https://api-v2.acrcloud.com/api/buckets/:id
Before you delete the bucket, you need to clean the bucket first.
Request
Response
Request
Path Parameters
id
required
number
The bucket id
Headers
Authentication
optional
string
Bearer token
Response
204: No Content