Live Channels

Create a live channel

POST https://api-v2.acrcloud.com/api/buckets/:bucket_id/channels

Path Parameters

NameTypeDescription

bucket_id

number

The bucket id

Headers

NameTypeDescription

Authorization

string

Bearer token

Request Body

NameTypeDescription

title

string

The channel title

url

string

The channel URL for ingesting the fingerprint from local server

user_defined

string

User-defined metadata. JSON format

timeshift

string

If enable the timeshifted fingerprint ingesting. 0 or 1. default is 0

{
    "data": {
        "uid": 1,
        "bucket_id": 8894,
        "acr_id": "b46ba66d2548b23611c6efabed035182",
        "state": 0,
        "title": "test",
        "url": "udp://192.168.1.10",
        "user_defined": {
            "city": "New York"
        },
        "timeshift": 0,
        "updated_at": "2020-12-25T05:05:17.000000Z",
        "created_at": "2020-12-25T05:05:17.000000Z",
        "id": 8,
        "bucket_type": "Live"
    }
}
curl --location --request POST 'https://api-v2.acrcloud.com/api/buckets/8894/channels' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{"title":"test", "url":"udp://192.168.1.10", "user_defined":{"city":"New York"}}'

List the channels

GET https://api-v2.acrcloud.com/api/buckets/:bucket_id/channels

Path Parameters

NameTypeDescription

bucket_id

number

The bucket id

Query Parameters

NameTypeDescription

search

string

The title name.

page

string

Page number

per_page

string

The results number per page.

string

asc or desc. Default is desc

sort

string

sort by id or status. default is id

Headers

NameTypeDescription

Authorization

string

Bearer token

{
    "data": [
        {
            "id": 8,
            "uid": 1,
            "bucket_id": 8894,
            "acr_id": "b46ba66d2548b23611c6efabed035182",
            "channel_id": "",
            "state": 1,
            "title": "test",
            "url": "udp://192.168.1.10",
            "user_defined": {
                "city": "New York"
            },
            "timeshift": 0,
            "created_at": "2020-12-25T05:05:17.000000Z",
            "updated_at": "2020-12-25T05:05:17.000000Z",
            "bucket_type": "Live"
        },
        {
            "id": 7,
            "uid": 1,
            "bucket_id": 8894,
            "acr_id": "3482b6e845a0fed8c129108d54ed9e20",
            "channel_id": "",
            "state": 1,
            "title": "123",
            "url": "123",
            "user_defined": {},
            "timeshift": 1,
            "created_at": "2020-09-16T03:36:59.000000Z",
            "updated_at": "2020-09-16T03:36:59.000000Z",
            "bucket_type": "Live"
        },
        {
            "id": 4,
            "uid": 1,
            "bucket_id": 8894,
            "acr_id": "f59e5c0e31a73db957b6c68fcda38c44",
            "channel_id": "",
            "state": 1,
            "title": "channel-4",
            "url": "http://127.0.0.1:123",
            "user_defined": {},
            "timeshift": 1,
            "created_at": "2019-06-25T07:46:24.000000Z",
            "updated_at": "2020-09-16T03:49:43.000000Z",
            "bucket_type": "Live"
        },
        {
            "id": 3,
            "uid": 1,
            "bucket_id": 8894,
            "acr_id": "6cc839537aa40b2854f4e520b7d0d58b",
            "channel_id": "",
            "state": 1,
            "title": "channel-3",
            "url": "http://127.0.0.1:123",
            "user_defined": {},
            "timeshift": 0,
            "created_at": "2019-06-25T07:46:21.000000Z",
            "updated_at": "2019-11-22T11:51:57.000000Z",
            "bucket_type": "Live"
        }
    ],
    "links": {
        "first": "https://api-v2.acrcloud.com/api/buckets/8894/channels?page=1",
        "last": "https://api-v2.acrcloud.com/api/buckets/8894/channels?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://api-v2.acrcloud.com/api/buckets/8894/channels",
        "per_page": 20,
        "to": 4,
        "total": 4
    }
}
curl --location --request GET 'https://api-v2.acrcloud.com/api/buckets/8894/channels' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'

Update a channel

PUT https://api-v2.acrcloud.com/api/buckets/:bucket_id/channels/:id

Path Parameters

NameTypeDescription

bucket_id

string

bucket id

id

string

channel id

Headers

NameTypeDescription

Authorization

string

Bearer token

Request Body

NameTypeDescription

title

string

The channel title

url

string

The channel URL for ingesting fingerprints on your local server

user_defined

string

User-define

timeshift

string

If enable the timeshifted fingerprint ingestring. 0 or 1.

{
    "data": {
        "uid": 1,
        "bucket_id": 8894,
        "acr_id": "b46ba66d2548b23611c6efabed035182",
        "state": 0,
        "title": "test",
        "url": "udp://192.168.1.10",
        "user_defined": {
            "city": "New York"
        },
        "timeshift": 0,
        "updated_at": "2020-12-25T05:05:17.000000Z",
        "created_at": "2020-12-25T05:05:17.000000Z",
        "id": 8,
        "bucket_type": "Live"
    }
}
curl --location --request PUT 'https://api-v2.acrcloud.com/api/buckets/8884/channels/8' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{"title":"test"}'

Delete ingesting channels

DELETE https://api-v2.acrcloud.com/api/buckets/:bucket_id/channels/:ids

Path Parameters

NameTypeDescription

bucket_id

string

The bucket id

ids

string

One or multiple ids, separated by ','

Headers

NameTypeDescription

Authorization

string

Bearer token

curl --location --request DELETE 'https://api-v2.acrcloud.com/api/buckets/8894/channels/8' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'

Import channels

POST https://api-v2.acrcloud.com/api/buckets/:bucket_id/rec-channels

Import channels to LiveRec bucket.

Path Parameters

NameTypeDescription

bucket_id

string

Bucket id

Headers

NameTypeDescription

Authorization

string

Bearer token

Request Body

NameTypeDescription

ids

string

One or multiple channels ids. Separated by ','

{
    "data": [
        {
            "id": 5,
            "acr_id": "a25b69e996f6f220ddb7a0c4a53a11c1",
            "title": "channel-5",
            "state": 0,
            "bucket_id": 8885,
            "original_bucket_id": 8882,
            "created_at": "2020-12-25 07:39:29",
            "updated_at": "2020-12-25 07:39:29",
            "bucket_type": "LiveRec",
            "user_defined": {}
        },
        {
            "id": 6,
            "acr_id": "08e491a33c5c1bb7418ce49254fc35ed",
            "title": "adf",
            "state": 0,
            "bucket_id": 8885,
            "original_bucket_id": 8882,
            "created_at": "2020-12-25 07:39:29",
            "updated_at": "2020-12-25 07:39:29",
            "bucket_type": "LiveRec",
            "user_defined": {
                "channel_name": "abc",
                "channel_type": "def"
            }
        }
    ]
}
curl --location --request POST 'https://api-v2.acrcloud.com/api/buckets/8885/rec-channels' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{"ids":[5,6]}'

Delete rec channels

DELETE https://api-v2.acrcloud.com/api/buckets/:bucket_id/rec-channels/:ids

Path Parameters

NameTypeDescription

bucket_id

number

The bucket id

ids

string

One or multiple channel ids. Separated by ','

Headers

NameTypeDescription

Authorization

string

Bearer token

curl --location --request DELETE 'https://api-v2.acrcloud.com/api/buckets/8895/rec-channels/5,6' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'

Create timeshift channels

POST https://api-v2.acrcloud.com/api/buckets/:bucket_id/timeshift-channels

Path Parameters

NameTypeDescription

bucket_id

number

The bucket id

Headers

NameTypeDescription

Authorization

string

Bearer token

Request Body

NameTypeDescription

time

number

The timeshift fingerprints keep-alive time (In hours). The default is 1 hour.

id

number

The live channel id

{
    "data": {
        "id": 5,
        "title": "channel-5",
        "state": 0,
        "bucket_id": 8893,
        "acr_id": "a25b69e996f6f220ddb7a0c4a53a11c1",
        "time": 24,
        "original_bucket_id": 8882,
        "created_at": "2020-12-25 07:57:52",
        "updated_at": "2020-12-25 07:57:52",
        "bucket_type": "LiveTimeshift",
        "user_defined": {}
    }
}
curl --location --request POST 'https://api-v2.acrcloud.com/api/buckets/8893/timeshift-channels' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{"id":5, "time":24}'

Delete timeshift channels

DELETE https://api-v2.acrcloud.com/api/buckets/:bucket_id/timeshift-channels/:ids

Path Parameters

NameTypeDescription

ids

string

One or multiple channel ids, Separated by ','

bucket_id

number

The bucket id

Headers

NameTypeDescription

Authorization

string

Bearer token

Get Live/Timeshift Channels status

GET https://api-v2.acrcloud.com/api/buckets/:bucket_id/channels-stat

Path Parameters

NameTypeDescription

bucket_id

number

The Live/Timeshift bucket id

Query Parameters

NameTypeDescription

date

datetime

For example: 2024-05-17

Headers

NameTypeDescription

Authorization

string

Bearer token

Response

id

number

The channel id

title

string

The channel name

acr_id

string

acr id

hour

string

Hour (24-hour clock) as a zero-padded decimal number. utf+0 

seconds

number

The fingerprint duration that the server side received.

This value has a certain margin of error (mainly due to the possibility of silence at the beginning or end of fingerprint fragments). We consider that if the total duration of fingerprints received in a complete hour is 3500 < seconds <= 3600, it indicates that the data received during this hour is normal.

[ {
            "id": 1800,
            "title": "channel1",
            "acr_id": "556ddb768bba7d38fa22fcb3eaf7b6ea",
            "stats": {
                "2024-05-17": [
                    {
                        "hour": "00", 
                        "seconds": 3578
                    },
                    {
                        "hour": "01",
                        "seconds": 3582
                    },
                    {
                        "hour": "02",
                        "seconds": 3578
                    },
                    {
                        "hour": "03",
                        "seconds": 288
                    }
                ]
            }
  },
……
]
curl --location 'https://ap-api-v2.acrcloud.com/api/buckets/12334/channels-stat?date=2024-05-17' \
--header 'Authorization: Bearer YOUR_TOKEN’ \
--header 'Accept: application/json'

Last updated