Custom Streams Projects
Create Custom Streams Project
POST
https://api-v2.acrcloud.com/api/bm-cs-projects
Headers
Authorization
string
Bearer token
Accept
string
application/json
Content-Type
string
application/json
Request Body
external_ids
string
spotify,deezer,isrc,upc,musicbrainz
metadata_template
string
The streams metadata template
region
string
eu-west-1,us-west-2,ap-southeast-1
name
string
Project name
buckets
string
Bucket ids array
type
string
BM-ACRC or BM-LOCAL BM-ACRC: Ingesting the streams audio data on our server. BM-LOCAL: ingesting the streams audio data on your local server. Please refer to Local monitoring Tool
{
"data":{
"uid":1,
"access_key":"************",
"type":"BM-ACRC",
"state":1,
"name":"bm-test",
"region":"ap-southeast-1",
"bucket_group":"8881",
"external_id":"",
"updated_at":"2021-01-04 10:42:24",
"created_at":"2021-01-04 10:42:24",
"id":13528,
"buckets":[
{
"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":{
"type":"select", "default":"334", "options":["123", "334"]}}",
"labels":[
"Music",
"Video"
],
"net_type":1,
"created_at":"2019-03-01 15:31:25",
"updated_at":"2020-12-24 08:26:35",
"num":1,
"size":"300000",
"access_permission":"private"
}
],
"status_check":2,
"external_ids":[
"spotify","deezer","isrc"
],
"metadata_template":"StreamId,City,FM",
"monitoring_num":0
}
}
curl --location --request POST 'https://api-v2.acrcloud.com/api/bm-cs-projects' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your token}' \
--header 'Content-Type: application/json' \
--data-raw '{"name":"test", "region":"eu-west-1", "buckets":[8881,8883],"type":"BM-ACRC", "external_ids":["spotify", "isrc", "deezer"]}'
List the projects
GET
https://api-v2.acrcloud.com/api/bm-cs-projects
Query Parameters
page
string
region
string
types
string
per_page
string
Headers
Accept
string
application/json
Authorization
string
Bearer token
{
"data":[
{
"id":12345,
"name":"test",
"uid":1,
"type":"BM-ACRC",
"region":"ap-southeast-1",
"state":1,
"access_key":"************",
"bucket_group":"8891,8880",
"external_id":"",
"noise":1,
"created_at":"2020-07-20 15:56:21",
"updated_at":"2020-07-21 03:43:01",
"buckets":[
{
"id":8891,
"uid":1,
"name":"vue-bucket",
"type":"File",
"node":"127.0.0.1-871",
"state":1,
"region":"ap-southeast-1",
"metadata_template":"album",
"labels":[
"Music",
"Video"
],
"net_type":1,
"created_at":"2019-07-30 09:02:43",
"updated_at":"2019-08-16 07:17:32",
"num":2,
"size":"600",
"access_permission":"private",
"access_users":[
"olym.yin@gmail.com"
]
},
{
"id":8880,
"uid":0,
"name":"ACRCloud Music",
"type":"ACRCloudFile",
"node":"127.0.0.1-890",
"state":1,
"region":"ap-southeast-1",
"metadata_template":"",
"labels":[
"Music"
],
"net_type":1,
"created_at":"2019-03-01 15:31:25",
"updated_at":"-0001-11-30 00:00:00",
"num":10000,
"size":10000,
"access_permission":"private"
}
],
"status_check":2,
"external_ids":[
],
"metadata_template":"city,country",
"monitoring_num":0
}
],
"links":{
"first":"https://api-v2.acrcloud.com/api/bm-cs-projects?page=1",
"last":"https://api-v2.acrcloud.com/api/bm-cs-projects?page=1",
"prev":null,
"next":null
},
"meta":{
"current_page":1,
"from":1,
"last_page":1,
"path":"https://api-v2.acrcloud.com/api/bm-cs-projects",
"per_page":"20",
"to":1,
"total":1
}
}
curl --location --request GET 'https://api-v2.acrcloud.com/api/bm-cs-projects' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your token}'
Update a project
PUT
https://api-v2.acrcloud.com/api/bm-cs-projects/:id
Path Parameters
id
number
The project id
Headers
Accept
string
application/json
Authorization
string
Bearer token
Request Body
name
string
buckets
string
external_ids
string
metadata_template
string
{
"data":{
"uid":1,
"access_key":"**************",
"type":"BM-ACRC",
"state":1,
"name":"bm-test",
"region":"ap-southeast-1",
"bucket_group":"8881",
"external_id":"",
"updated_at":"2021-01-04 10:42:24",
"created_at":"2021-01-04 10:42:24",
"id":13528,
"buckets":[
{
"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":{
"type":"select", "default":"334", "options":["123", "334"]}}",
"labels":[
"Music",
"Video"
],
"net_type":1,
"created_at":"2019-03-01 15:31:25",
"updated_at":"2020-12-24 08:26:35",
"num":1,
"size":"300000",
"access_permission":"private"
}
],
"status_check":2,
"external_ids":[
"spotify","deezer","isrc"
],
"metadata_template":"StreamId,City,FM",
"monitoring_num":0
}
}
import requests
import json
url = "http://127.0.0.1:8080/api/bm-cs-projects/13528"
payload = json.dumps({
"name": "test",
"buckets": [
8881,
8883
],
"external_ids": [
"spotify",
"isrc",
"deezer"
]
})
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer token',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
Delete a project
DELETE
https://api-v2.acrcloud.com/api/bm-cs-projects/:id
Path Parameters
id
number
The project id
Headers
Authorization
string
Bearer token
Set result callback url
POST
https://api-v2.acrcloud.com/api/bm-cs-projects/:id/result-callback
Path Parameters
id
number
The project id
Headers
Authorization
string
Bearer token
Accept
string
application/json
Content-Type
string
application/json
Request Body
result_callback_url
string
{
"data":{
"id":13528,
"name":"bm-test",
"uid":1,
"type":"BM-ACRC",
"region":"ap-southeast-1",
"state":1,
"access_key":"***********",
"bucket_group":"8881",
"external_id":"",
"noise":1,
"created_at":"2021-01-04 10:42:24",
"updated_at":"2021-01-04 10:42:24",
"buckets":[
{
"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":{
"type":"select", "default":"334", "options":["123", "334"]}}",
"labels":[
"Music",
"Video"
],
"net_type":1,
"created_at":"2019-03-01 15:31:25",
"updated_at":"2020-12-24 08:26:35",
"num":1,
"size":"300000",
"access_permission":"private"
}
],
"status_check":2,
"external_ids":[
],
"metadata_template":"StreamId,City,FM",
"result_callback_url":"https://callback.acrcloud.com",
"result_callback_send_type":"JSON",
"result_callback_send_noresult":"NO",
"result_callback_retry":0,
"monitoring_num":0
}
}
curl --location --request POST 'https://api-v2.acrcloud.com/api/bm-cs-projects/12345/result-callback' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your token}' \
--header 'Content-Type: application/json' \
--data-raw '{"result_callback_url":"{your callback URL}"}'
The following is the example of the results of the monitoring system posting to your results callback URL
{
"stream_url": "xxxx",
"stream_id": "s-Ixxxxd",
"status": 1,
"data": {
"status": {
"msg": "Success",
"version": "1.0",
"code": 0
},
"result_type": 0,
"metadata": {
"music": [{
"album": {
"name": "Creedence Clearwater Revival - Best Of"
},
"play_offset_ms": 75500,
"sample_begin_time_offset_ms": 6440,
"title": "Proud Mary",
"result_from": 3,
"release_date": "2008-01-01",
"sample_end_time_offset_ms": 9420,
"genres": [{
"name": "Country"
}, {
"name": "Pop"
}, {
"name": "Rock"
}, {
"name": "Rock & Roll/Rockabilly"
}],
"label": "Universal Music",
"duration_ms": 186506,
"score": 100.0,
"db_begin_time_offset_ms": 72200,
"artists": [{
"name": "Creedence Clearwater Revival"
}],
"db_end_time_offset_ms": 75180,
"external_ids": {
"isrc": "USFI86900049",
"upc": "888072308701"
},
"acrid": "463aeeb5840215833abe6bf7b02304f6",
"external_metadata": {
"spotify": {
"track": {
"name": "Proud Mary",
"id": "5Op2Ra4kgzlTpEmD9NUanY"
},
"album": {
"name": "Creedence Clearwater Revival - Best Of"
},
"artists": [{
"name": "Creedence Clearwater Revival"
}]
},
"lyricfind": {
"lfid": "001-1188346"
},
"youtube": {
"vid": "5hid10EgMXE"
},
"musicstory": {
"track": {
"id": "9258633"
},
"album": {
"id": "677371"
},
"release": {
"id": "1640721"
}
},
"musicbrainz": {
"track": {
"id": "1632ee2b-4f4b-42eb-909f-8279e66dc1ce"
}
},
"deezer": {
"track": {
"name": "Proud Mary",
"id": "883642"
},
"album": {
"name": "Creedence Clearwater Revival - Best Of"
},
"artists": [{
"name": "Creedence Clearwater Revival"
}]
}
}
}],
"timestamp_utc": "2022-02-22 12:19:28",
"played_duration": 173,
"type": "delay"
}
}
}
Set state notification callback
POST
https://api-v2.acrcloud.com/api/bm-cs-projects/:id/state-notification
Path Parameters
id
string
The project id
Headers
Authorization
string
Bearer token
Accept
string
application/json
Content-Type
string
application/json
Request Body
state_notification_email
string
state_notification_email: if the streams' states change, we will send a notification to the email you set.
state_notification_email_frequency
string
state_notification_email_frequency: 0:High 1:Low 2:None
state_notification_url
string
state_notification_url: if the streams' states change, we will post a request to this url you set.
{
"data":{
"id":13528,
"name":"bm-test",
"uid":1,
"type":"BM-ACRC",
"region":"ap-southeast-1",
"state":1,
"access_key":"***************",
"bucket_group":"8881",
"external_id":"",
"noise":1,
"created_at":"2021-01-04 10:42:24",
"updated_at":"2021-01-04 10:42:24",
"buckets":[
{
"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":{
"type":"select", "default":"334", "options":["123", "334"]}}",
"labels":[
"Music",
"Video"
],
"net_type":1,
"created_at":"2019-03-01 15:31:25",
"updated_at":"2020-12-24 08:26:35",
"num":1,
"size":"300000",
"access_permission":"private"
}
],
"status_check":2,
"external_ids":[
],
"metadata_template":"StreamId,City,FM",
"result_callback_url":"https://callback.acrcloud.com",
"result_callback_send_type":"JSON",
"result_callback_send_noresult":"NO",
"result_callback_retry":0,
"state_notification_url":"http://test.notification.com",
"state_notification_email":"olym@acrcloud.com",
"state_notification_email_frequency":"LOW",
"monitoring_num":2
}
}
Last updated