StraaS APIs Documentation

Quick Start

To get started, you should have a StraaS account for your service. If you haven’t had an account, please contact us to create one for you.

Create an Application

Before using any StraaS APIs, you have to create a server application in StraaS CMS for obtaining client_id and client_secret which are used to get an application token.

If you create an application whose application type is Browser, You can use client_id and signature(FQDN) to get an application token. For safety, access right of browser application token is lower than server application token. Browser application token is passed to frontend for Straas web player SDK to use.

Please refer to the session Authentication - Create an application in our Technical Document for more details.

Make a API Call

StraaS API is designed as the following structure:

https://app.straas.net/api/<API_VERSION>/<API_TYPE>/<RESOURCE>

And is applied to the token base authentication.

Given an example:

curl -X GET -H "Authorization: Bearer <APP_TOKEN>" "https://app.straas.net/api/v1/app/videos?page=2"

Please refer to the Technical Document for more development details.

AppToken

Create Browser Application Token

Create an application token for your browser application.

Endpoint

POST /api/v1/app/token

Parameters

Name Description Type
client_id required

Application client id.

String
signature required

Application signature(FQDN).

String

Request

Route

POST /api/v1/app/token

Headers

Content-Type: application/json

Body

{
  "client_id": "0300c39aa354264b",
  "signature": "bashirian.info"
}

Response

Response Fields

Name Description Type
account_id The id of the account which the resource belongs to. String
token JSON Web Token. A app token can be alive in 24 hours. After it is expired or invalid, you have to get a new one. String

Status

201

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 207
ETag: W/"135790d96e867ea0fa2f60c1c3e1c187"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 33f86b30-d552-4ccc-8812-fa5ab8d0dfcb
X-Runtime: 0.018340

Body

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEzMywiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc3M30.rImvOXVRbJc9VA7LIlbm68a8bXD-NAbDJb6zLiBjx5M",
  "account_id": "straas-dev-test"
}

Create Server Application Token

Create an application token for your server application.

Endpoint

POST /api/v1/app/token

Parameters

Name Description Type
client_id required

Application client id.

String
client_secret required

Application client secret.

String

Request

Route

POST /api/v1/app/token

Headers

Content-Type: application/json

Body

{
  "client_id": "197e77de813b17f1",
  "client_secret": "t3LmUQybTj6vMbRX"
}

Response

Response Fields

Name Description Type
account_id The id of the account which the resource belongs to. String
token JSON Web Token. A app token can be alive in 24 hours. After it is expired or invalid, you have to get a new one. String

Status

201

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 207
ETag: W/"cfe00c8ce60d31bffd597700b3d6076b"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: f83ebd10-2b82-4063-a58f-e20c28e887f4
X-Runtime: 0.025143

Body

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEzMiwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc3M30.4ogptgyjEw0_0pffa2jVl68JmPYLZMpUHVCVD8Ls6yI",
  "account_id": "straas-dev-test"
}

Category

Get Categories

Get the categories.

Endpoint

GET /api/v1/app/categories

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer
parent_ids

Filter the subcategories contained in the parent category. Use null to filter the root categories (i.e., parent_ids=null.)

String

Request

Route

GET /api/v1/app/categories?page=2&per_page=5

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjMsImFjY291bnRfaWQiOiJzdHJhYXMtZGV2LXRlc3QiLCJleHAiOjE1OTQzNzE2OTJ9.cPRPm_SqD5GswTJnRWUVecGhxOPS0vKRECv4Qt_dNiM
Content-Type: application/json

Query Parameters

page=2
per_page=5

Response

Response Fields

Name Description Type
id The category id. Integer
default This category is a default category if this field is true. Every account has a default category. Boolean
name The category name. String
description The category description. String
videos_count The number of videos which are contained in the category. Integer
lives_count The number of lives which are contained in the category. Integer
parent_id The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

Link: <http://example.org/api/v1/app/categories?page=1&per_page=5>; rel="first", <http://example.org/api/v1/app/categories?page=1&per_page=5>; rel="prev", <http://example.org/api/v1/app/categories?page=5&per_page=5>; rel="last", <http://example.org/api/v1/app/categories?page=3&per_page=5>; rel="next"
Total: 21
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 1312
ETag: W/"e4acf6239212ebdcc2db8afc43040e95"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: f765840d-7f1b-4fdb-99ac-d1b7defe5afd
X-Runtime: 0.026385

Body

[
  {
    "id": 9,
    "default": false,
    "name": "category-6",
    "description": "Et perferendis vel sed quo.",
    "videos_count": 1,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 1,
    "parent_id": null,
    "created_at": "2020-07-09T09:01:32Z",
    "updated_at": "2020-07-09T09:01:32Z"
  },
  {
    "id": 10,
    "default": false,
    "name": "category-7",
    "description": "Et repellat minima consequatur.",
    "videos_count": 1,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 1,
    "parent_id": null,
    "created_at": "2020-07-09T09:01:32Z",
    "updated_at": "2020-07-09T09:01:32Z"
  },
  {
    "id": 11,
    "default": false,
    "name": "category-8",
    "description": "Sapiente quis minus commodi inventore.",
    "videos_count": 1,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 1,
    "parent_id": null,
    "created_at": "2020-07-09T09:01:32Z",
    "updated_at": "2020-07-09T09:01:32Z"
  },
  {
    "id": 12,
    "default": false,
    "name": "category-9",
    "description": "Est doloremque natus et dolores magnam sunt eum.",
    "videos_count": 1,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 1,
    "parent_id": null,
    "created_at": "2020-07-09T09:01:32Z",
    "updated_at": "2020-07-09T09:01:32Z"
  },
  {
    "id": 13,
    "default": false,
    "name": "category-10",
    "description": "Quibusdam odit ut nihil consequuntur est molestiae architecto.",
    "videos_count": 1,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 1,
    "parent_id": null,
    "created_at": "2020-07-09T09:01:32Z",
    "updated_at": "2020-07-09T09:01:32Z"
  }
]

Get Subcategories of the Category

Get the subcategory list of the target category.

Endpoint

GET /api/v1/app/categories/:id/subcategories

Parameters

Name Description Type
id required

The category id.

Integer

Request

Route

GET /api/v1/app/categories/46/subcategories

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjUsImFjY291bnRfaWQiOiJzdHJhYXMtZGV2LXRlc3QiLCJleHAiOjE1OTQzNzE2OTN9.I8zNaPdTOjo-5mQHQwNdhzeG8s2bA-Brj03Vf78XP2o
Content-Type: application/json

Response

Response Fields

Name Description Type
id The category id. Integer
default This category is a default category if this field is true. Every account has a default category. Boolean
name The category name. String
description The category description. String
videos_count The number of videos which are contained in the category. Integer
lives_count The number of lives which are contained in the category. Integer
parent_id The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

Total: 2
Per-Page: 10
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 513
ETag: W/"d9d12d3ecd40715c4f12f6958cd1a70a"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 49a43e96-f31e-4f7c-8c67-6f9ca5b09102
X-Runtime: 0.038048

Body

[
  {
    "id": 47,
    "default": false,
    "name": "category-42",
    "description": "Nihil nostrum distinctio aut ea.",
    "videos_count": 1,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 1,
    "parent_id": 46,
    "created_at": "2020-07-09T09:01:33Z",
    "updated_at": "2020-07-09T09:01:34Z"
  },
  {
    "id": 48,
    "default": false,
    "name": "category-43",
    "description": "Vitae et soluta et repellendus delectus.",
    "videos_count": 1,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 1,
    "parent_id": 47,
    "created_at": "2020-07-09T09:01:33Z",
    "updated_at": "2020-07-09T09:01:34Z"
  }
]

Get an Category

Get the target category.

Endpoint

GET /api/v1/app/categories/:id

Parameters

Name Description Type
id required

The category id.

Integer

Request

Route

GET /api/v1/app/categories/25

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjQsImFjY291bnRfaWQiOiJzdHJhYXMtZGV2LXRlc3QiLCJleHAiOjE1OTQzNzE2OTN9.Eqi-EJjsZ-civZnxOnHgI0B7ta_YgP6lL6Rg4lSPwBs
Content-Type: application/json

Response

Response Fields

Name Description Type
id The category id. Integer
default This category is a default category if this field is true. Every account has a default category. Boolean
name The category name. String
description The category description. String
videos_count The number of videos which are contained in the category. Integer
lives_count The number of lives which are contained in the category. Integer
parent_id The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
created_at The data created time. String
updated_at The data last updated time. String
children The subcategories which are contained in the target category. Object

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 837
ETag: W/"f20191f86656556ba24a2fdfac86aad3"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: adf12417-8f31-4f73-b171-6371efe1280e
X-Runtime: 0.026703

Body

{
  "id": 25,
  "default": false,
  "name": "category-21",
  "description": "Quo pariatur repellat facilis non officiis.",
  "videos_count": 1,
  "lives_count": 0,
  "playlists_count": 0,
  "total_count": 1,
  "parent_id": null,
  "created_at": "2020-07-09T09:01:33Z",
  "updated_at": "2020-07-09T09:01:33Z",
  "children": [
    {
      "id": 26,
      "default": false,
      "name": "category-22",
      "description": "Iure voluptates dolor optio fugit ex corrupti exercitationem magnam.",
      "videos_count": 1,
      "lives_count": 0,
      "playlists_count": 0,
      "total_count": 1,
      "parent_id": 25,
      "created_at": "2020-07-09T09:01:33Z",
      "updated_at": "2020-07-09T09:01:33Z",
      "children": [
        {
          "id": 27,
          "default": false,
          "name": "category-23",
          "description": "Est quae explicabo illum.",
          "videos_count": 1,
          "lives_count": 0,
          "playlists_count": 0,
          "total_count": 1,
          "parent_id": 26,
          "created_at": "2020-07-09T09:01:33Z",
          "updated_at": "2020-07-09T09:01:33Z",
          "children": [

          ]
        }
      ]
    }
  ]
}

Chatroom

Delete Chatroom

Delete the chatroom.

Endpoint

DELETE /api/v1/app/chatrooms

Parameters

Name Description Type
name required

The chatroom name.

String

Request

Route

DELETE /api/v1/app/chatrooms

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjgsImFjY291bnRfaWQiOiJzdHJhYXMtZGV2LXRlc3QiLCJleHAiOjE1OTQzNzE2OTV9.0MIIRDnpVOSKqXg9azP7uXNdeMFmhQU_qVHu7GCu5eA
Content-Type: application/json

Body

{
  "name": "chatroom-4"
}

Response

Response Fields

Name Description Type
account_id The id of the account which the resource belongs to. String
name The chatroom name which must be unique under the account scope. Integer
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 124
ETag: W/"b7685105ad540497274e71f15fafc982"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 46520322-656b-47fe-a9d8-62fade4f631c
X-Runtime: 0.084681

Body

{
  "account_id": "straas-dev-test",
  "name": "chatroom-4",
  "created_at": "2020-07-09T09:01:35Z",
  "updated_at": "2020-07-09T09:01:35Z"
}

Get Chatrooms

Get the chatroom list. The list is sorted by created_at in ascending order.

Endpoint

GET /api/v1/app/chatrooms

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer

Request

Route

GET /api/v1/app/chatrooms?page=1&per_page=5

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjYsImFjY291bnRfaWQiOiJzdHJhYXMtZGV2LXRlc3QiLCJleHAiOjE1OTQzNzE2OTR9.4ci3FmecR2iU_yBIRAaUIZ64FUCZxJZ47q34xL3soRA
Content-Type: application/json

Query Parameters

page=1
per_page=5

Response

Response Fields

Name Description Type
account_id The id of the account which the resource belongs to. String
name The chatroom name which must be unique under the account scope. Integer
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

Total: 2
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 251
ETag: W/"348e12718d3024be6256c2642c47c0f3"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: bfbd60b4-f56f-48ab-84c3-fa9f19a8d8c9
X-Runtime: 0.021675

Body

[
  {
    "account_id": "straas-dev-test",
    "name": "chatroom-1",
    "created_at": "2020-07-09T09:01:34Z",
    "updated_at": "2020-07-09T09:01:34Z"
  },
  {
    "account_id": "straas-dev-test",
    "name": "chatroom-2",
    "created_at": "2020-07-09T09:01:34Z",
    "updated_at": "2020-07-09T09:01:34Z"
  }
]

CustomDomain

Create Custom Domain

Create a custom domain.

Endpoint

POST /api/v1/app/custom_domains

Parameters

Name Description require Type
type

The custom domain type.{live,vod,live_event_listener,collector,cover_image,thumbnail_image,thumbnail_custom_image}

true String
host

The custom domain host.

true String

Request

Route

POST /api/v1/app/custom_domains

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEzLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNjk2fQ.6j7LWgJIVkbLuS8dvVETmB71HtPCcgwSf83Lkci3VXU
Content-Type: application/json

Body

{
  "type": "live",
  "host": "custom_domain.com"
}

Response

Response Fields

Name Description Type
id The custom domain id. String
type The custom domain type. String
host The custom domain host. String
created_at The data created time. String
updated_at The data last updated time. String

Status

201

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 121
ETag: W/"2a7418f179cb89959c9a0d1781a7f308"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: abc7501c-a93c-41ac-9ed1-1ed4eddc1f78
X-Runtime: 0.041107

Body

{
  "id": 2,
  "type": "live",
  "host": "custom_domain.com",
  "created_at": "2020-07-09T09:01:36Z",
  "updated_at": "2020-07-09T09:01:36Z"
}

Delete Custom Domain

Delete a custom domain.

Endpoint

DELETE /api/v1/app/custom_domains/:id

Parameters

Name Description Type
id required

The custom domain id.

String

Request

Route

DELETE /api/v1/app/custom_domains/7

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE5LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNjk4fQ.mBMQL-DemmkYTreHpXIIXM_HR2SUzsKfkXHcwUAV5Go
Content-Type: application/json

Response

Response Fields

Name Description Type
id The custom domain id. String
type The custom domain type. String
host The custom domain host. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 114
ETag: W/"be3f58488a70b08ba3f3bb967adba51e"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 366da541-dc11-43bd-906a-a85ceec0f852
X-Runtime: 0.026858

Body

{
  "id": 7,
  "type": "live",
  "host": "hudson.com",
  "created_at": "2020-07-09T09:01:38Z",
  "updated_at": "2020-07-09T09:01:38Z"
}

Get Custom Domain

Get the custom domain details.

Endpoint

GET /api/v1/app/custom_domains/:id

Parameters

Name Description Type
id required

The custom domain id.

String

Request

Route

GET /api/v1/app/custom_domains/3

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE1LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNjk3fQ.UZm9lQYIRxjEapGYeaASaDQ0jTygQHtAumAi5Dp8L0w
Content-Type: application/json

Response

Response Fields

Name Description Type
id The custom domain id. String
type The custom domain type. String
host The custom domain host. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 119
ETag: W/"befb762f41c13cb5bbeef64628a92445"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 1fe12d7a-9b5f-4a46-afc6-00318c42ab7f
X-Runtime: 0.024808

Body

{
  "id": 3,
  "type": "live",
  "host": "auersanford.biz",
  "created_at": "2020-07-09T09:01:37Z",
  "updated_at": "2020-07-09T09:01:37Z"
}

Get Custom Domains

Get the custom domain list.

Endpoint

GET /api/v1/app/custom_domains

Request

Route

GET /api/v1/app/custom_domains

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjExLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNjk2fQ.vcYJVvrdpvnKm--IO_2ANQ9P9VF7d2ZMA7t6MqI5EaY
Content-Type: application/json

Response

Response Fields

Name Description Type
id The custom domain id. String
type The custom domain type. String
host The custom domain host. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 117
ETag: W/"e7418b6c77bfd1bda21514cba3bf8dd7"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 84116181-6f6c-42b5-923b-b5e466f28bcc
X-Runtime: 0.024203

Body

[
  {
    "id": 1,
    "type": "live",
    "host": "flatley.com",
    "created_at": "2020-07-09T09:01:36Z",
    "updated_at": "2020-07-09T09:01:36Z"
  }
]

Update Custom Domain

Update details of a custom domain.

Endpoint

PUT /api/v1/app/custom_domains/:id

Parameters

Name Description Type require
id required

The custom domain id.

String
host

The custom domain host.

String true

Request

Route

PUT /api/v1/app/custom_domains/5

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE3LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNjk4fQ.KcUc83qeRtHZ3auRsN7fbt9Hmv17XIWG7iErkUhFzKU
Content-Type: application/json

Body

{
  "host": "new_host.net"
}

Response

Response Fields

Name Description Type
id The custom domain id. String
type The custom domain type. String
host The custom domain host. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 116
ETag: W/"c235f5d5756e24029c7a3221352cd2b5"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: a5b27e19-c86d-4d5a-af84-e6a3ff9af8ec
X-Runtime: 0.031374

Body

{
  "id": 5,
  "type": "live",
  "host": "new_host.net",
  "created_at": "2020-07-09T09:01:38Z",
  "updated_at": "2020-07-09T09:01:38Z"
}

Live

(Deprecated) Get Live's WebRTC TURN Credential

Get live’s WebRTC TURN credential used in RTCPeerConnection. Please refer to WebRTC in Browser for more details.

Endpoint

GET /api/v1/app/lives/:id/webrtc/turn

Parameters

Name Description Type
id required

The live id.

String

Request

Route

GET /api/v1/app/lives/WLRnq8yD/webrtc/turn

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjMzLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzA1fQ.SskUnXg1SjwL1hm1DuzUgnScxYtLnExcWdvR3aTx2Uw
Content-Type: application/json

Response

Response Fields

Name Description Type
username Username is composed of credential expiration timestamp and live id. String
password Password is HMAC(username, shared secret key between HTTP and TURN servers). String
ttl The TTL of credential. Integer
uris The URI of TURN server. Array

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 129
ETag: W/"b0c1c81c645663a734febbbe255c8959"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 3a28b090-eadf-4cfb-b008-3d7b29347cae
X-Runtime: 0.048766

Body

{
  "username": "1508899534:2aKbTXjE",
  "password": "bBj5bs5x6p44+YDbcMWDrF9M/Nk=",
  "ttl": 86400,
  "uris": [
    "turn:10.10.10.0?transport=tcp"
  ]
}

Create Live

Create a new live event. A live event provides the ability of live streaming. There are three types of live events: event, channel and sync. The type field indicates a live event belongs to which one. Different type events offer different live streaming functions. event: a default live event. channel: an non-stop live event provides a stream key that never expires. sync: a live event only provides syndication(stream relay) function.

Endpoint

POST /api/v1/app/lives

Parameters

Name Description Type
title required

The title of the resource. Currently, emoji is not supported.

String
profile required

The profile of the live event. {360p,720p,720p_and_source,1080p_and_source} Note: 1080p_and_source can only be used when the account is enabled highest resolution 1080p authority.

String
synopsis

The synopsis of the resource.

String
listed

Whether to list the item. Default value: false.

Boolean
type

Indicates different functions for a live event. {event,channel}. “event” represents the default live event. “channel” is a live which stream key never expires. Default value: event.

String
category

The category object (i.e. category: { id: }.) which the resource belongs to.

Object
category[id]

The category id.

Integer
tags

The array of tag objects (i.e. tags: [ { name: } ]) which the resource is tagged with.

Array[Object]
tags[name]

The name of the tag.

String
owner

The member who owns this resource.

Object
owner[member_id]

The member id.

String
vod_listed

Whether to list the new VoD of the live event. Default value: false.

Boolean
vod_available

Whether the new VoD of the live event is available by users. Default value: false.

Boolean
vod_merge

Whether to merge all VoDs of the live event together. If this field is enabled, only one VoD is generated and there is no temporary VoD is shown until the live event ends. This field can’t be changed after the live event is created. Default value: false.

Boolean
dvr_enabled

Whether to enable live DVR feature for a live event. Default value: false.

Boolean
start_time

The start time of live event. The default value is current time, if this parameter is empty.

String
projection

Specifies the projection format of the media. {flat,equirectangular} Set equirectangular type to play a full 360 degree panorama media. Default value: flat.

String
with_chatroom

Whether to create an associated chatroom when the live event is created. Default value: false.

Boolean
chatroom[name]

The chatroom name. Default value is the live id. If the chatroom name has been taken, the existing chatroom will be linked to the live event automatically.

String
free

Determine if the monetizable item is free or not.

Boolean

Request

Route

POST /api/v1/app/lives

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjU5LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzI1fQ.bq8412mHoc2D_BXvPrAIGjn6tJKAqdzGIHb6TLb_5AA
Content-Type: application/json

Body

{
  "category": {
    "id": 120
  },
  "title": "live test title",
  "synopsis": "test test test test synopsis",
  "listed": true,
  "profile": "720p",
  "tags": [
    {
      "name": "tag1"
    },
    {
      "name": "tag2"
    }
  ],
  "owner": {
    "member_id": "cp_member_id"
  },
  "vod_listed": true,
  "vod_available": true,
  "vod_merge": true,
  "start_time": "2020-07-10T09:02:05.000Z",
  "projection": "equirectangular",
  "type": "event",
  "with_chatroom": true,
  "dvr_enabled": true
}

Response

Response Fields

Name Description Type
id The live id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
status The status of live. {ready,started,ended} String
type The event type indicates the live owns different functions and is used in different scenario.{event,sync,channel} String
start_time The start time of the live event. String
started_at The starting time of live streaming. String
ended_at The ending time of live streaming. String
stream_key_expired_at The expired time of stream key. This field is empty until the streaming has been started. If the stream key is expired and there is no any ongoing streaming, the event will be ended automatically within several minutes. String
status_updated_at The status updated time of live streaming. String
highest_resolution The highest resolution of live streaming. String
profile The profile of live streaming. String
stream_url The url of streaming source. String
stream_server_url The stream server url. String
stream_key The stream key for rtmp setup. This field is empty after the live event is ended. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
free Determine if the monetizable item is free or not. Boolean
cover_url The image shown in the player when the live streaming is off air. String
["cover_image"][url] The image shown in the player when the live streaming is off air. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String
vod_listed Whether the new VoD of the live event is listed. Boolean
vod_available Whether the new VoD of the live event is available. Boolean
vod_merge Whether to merge all VoDs of the live event together. If this field is enabled, only one VoD is generated and there is no temporary VoD is shown until the live event ends. Boolean
vod_enabled Whether to generate a video after the live event stops. Boolean
dvr_enabled Whether to enable live DVR feature for a live event. Boolean
transcode_enabled Whether to enable transcoding. Boolean
["ccu_statistic_summary"][account_id] The id of the account which the resource belongs to. String
["ccu_statistic_summary"][ccu] The number of concurrent users at the last update time. Integer
["ccu_statistic_summary"][updated_at] The data last updated time. String
chatroom The chatroom. Object
["chatroom"][account_id] The id of the account which the resource belongs to. String
["chatroom"][name] The chatroom name which must be unique under the account scope. Integer
videos The VOD of the live event. Array
["videos"][id] The video id. String
["videos"][account_id] The id of the account which the resource belongs to. String
["videos"][title] The title. String
["videos"][synopsis] The synopsis. String
["videos"][listed] Whether this resource is listed. Boolean
["videos"][available] Whether this resource is available. Boolean
["videos"][publish_time] The video publish time in ISO8601 format. String
["videos"][accomplished] The video transcoding status. Boolean
["videos"][duration] The duration of the video. Integer
["videos"][resolution] The resolution of the video. String
["videos"][live_id] Indicates this video is generated by the live event. String
["videos"][live_started_at] The starting time of the live streaming. String
["videos"][live_ended_at] The ending time of the live streaming. String
["videos"][projection] Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
["videos"][stream_url] The url of streaming source. String
["videos"][embed_url] The embed player url. String
["videos"][poster_url] The large size thumbnail of thumbnail_urls. String
["videos"][thumbnail_urls] The thumbnail urls. Object
["videos", "thumbnail_urls"][large] The large size thumbnail. Object
["videos", "thumbnail_urls", "large"][url] Url of the thumbnail. String
["videos", "thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["videos", "thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["videos", "thumbnail_urls"][medium] The medium size thumbnail. Object
["videos", "thumbnail_urls", "medium"][url] Url of the thumbnail. String
["videos", "thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["videos", "thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["videos", "thumbnail_urls"][small] The small size thumbnail. Object
["videos", "thumbnail_urls", "small"][url] Url of the thumbnail. String
["videos", "thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["videos", "thumbnail_urls", "small"][height] Height of the thumbnail. Integer
["videos"][free] Determine if the monetizable item is free or not. Boolean
["videos"][vip_accessible] Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
["videos"][owner] The owner of this resource. String
["videos", "owner"][id] The id of the member who exists in your member system. String
["videos"][created_at] The data created time. String
["videos"][updated_at] The data last updated time. String
sync_status_url_anatomy The information for socket.io connection. The information is used to receive the broadcasting status. Object
["sync_status_url_anatomy"][host] The socket.io server host. String
["sync_status_url_anatomy"][path] The socket.io server path. String
["sync_status_url_anatomy"][query] The socket.io connection token. String
rtmp_stream_url (Deprecated) Please use /api/v1/app/lives/:id/rtmp_edge_stream. String

Status

201

Headers

X-Cache-Count: 23
Content-Type: application/json
Content-Length: 2556
ETag: W/"ebc468561da00b8c17352799a9e0b563"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 5937db29-6221-4035-92bf-d84f9c0a2c74
X-Runtime: 0.471146

Body

{
  "id": "PKdD8UK4",
  "account_id": "straas-dev-test",
  "title": "live test title",
  "synopsis": "test test test test synopsis",
  "status": "ready",
  "start_time": "2020-07-10T09:02:05Z",
  "started_at": null,
  "ended_at": null,
  "status_updated_at": null,
  "highest_resolution": null,
  "profile": "720p",
  "stream_url": "https://rtcp-agent-staging.straas.net/PKdD8UK4/video/live.m3u8",
  "stream_key_expired_at": null,
  "stream_server_url": "rtmp://livestaging-ea.straas.net/app",
  "stream_key": "8ea21abfb6394972a1f62df9222e19d1",
  "streams": [
    {
      "id": 51,
      "key": "8ea21abfb6394972a1f62df9222e19d1",
      "expired_at": null,
      "created_at": "2017-08-18T08:22:10Z",
      "updated_at": "2020-07-09T09:02:05Z"
    }
  ],
  "rtmp_stream_url": "rtmp://35.194.164.117/app/6HRV5C44QLWLGGF72AGTZTOFSQFGGQFJFVIBVFJOG42YSP7KI3B4NIAIC6GCQBCQ6GUIYJWBN3MCMTOAKZ5KA===",
  "cover_url": null,
  "cover_image": {
    "url": null
  },
  "embed_url": "https://app-staging.straas.net/straas-dev-test/lives/PKdD8UK4",
  "videos": [

  ],
  "vod_available": true,
  "vod_listed": true,
  "vod_merge": true,
  "tags": [
    {
      "id": 1,
      "name": "tag1",
      "description": null,
      "taggings_count": 1
    },
    {
      "id": 2,
      "name": "tag2",
      "description": null,
      "taggings_count": 1
    }
  ],
  "available": true,
  "listed": true,
  "projection": "equirectangular",
  "category": {
    "id": 120,
    "default": false,
    "name": "category-117",
    "description": "Sit placeat ullam adipisci.",
    "videos_count": 1,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 1,
    "parent_id": null,
    "created_at": "2020-07-09T09:02:05Z",
    "updated_at": "2020-07-09T09:02:05Z"
  },
  "monetization_rules": [

  ],
  "has_monetization_rules": false,
  "free": true,
  "poster_url": null,
  "thumbnail_urls": null,
  "owner": {
    "id": "cp_member_id"
  },
  "statistic_summary": {
    "views_count_sum": 0,
    "viewers_count_sum": 0,
    "time_watched_sum": 0,
    "play_count_sum": 0,
    "play_duration_sum": 0,
    "hit_count_sum": 0,
    "base_play_count": 0,
    "base_play_duration": 0,
    "base_hit_count": 0,
    "hit_count_sum_with_base": 0,
    "updated_at": "2020-07-09T09:02:05Z"
  },
  "ccu_statistic_summary": {
    "account_id": "straas-dev-test",
    "ccu": 0,
    "updated_at": "2020-07-09T09:02:05Z"
  },
  "sync_status_url_anatomy": {
    "host": "https://sk-staging.straas.net",
    "path": "/pierce/socket.io/",
    "query": "token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InpoMkZ0RDc0dmIiLCJyb29tcyI6W3sibmFtZXNwYWNlIjoibGl2ZV9ldmVudHMiLCJpZCI6InN0cmFhcy1kZXY9UkZuVzRSQmYifV0sImV4cCI6MTQ4MzgwNjI0NX0.m7yy_7yMV4IrrPL1vxz4fUp0uaK04d5yg_LWkoVUAug&cid=BcbLiuX7Wa"
  },
  "vod_enabled": true,
  "transcode_enabled": true,
  "dvr_enabled": true,
  "type": "event",
  "chatroom": {
    "account_id": "straas-dev-test",
    "name": "PKdD8UK4",
    "created_at": "2020-07-09T09:02:05Z",
    "updated_at": "2020-07-09T09:02:05Z"
  },
  "created_at": "2020-07-09T09:02:05Z",
  "updated_at": "2020-07-09T09:02:05Z"
}

Get Live Details

Get the live details.

Endpoint

GET /api/v1/app/lives/:id

Parameters

Name Description Type
id required

The live id.

String
includes

Include extra resource details. Allow included resources: {category,tags,videos,sync_status_url_anatomy,owner,ccu_statistic_summary,monetization_rules}. For example, includes=category,tags. Note: the max number of videos which can be included is 50. If the video number of a live is more than 50, please use GET /api/v1/app/lives/:id/videos API to get more videos.

String

Request

Route

GET /api/v1/app/lives/YojZcSiR?includes=category%2Csync_status_url_anatomy

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjU0LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzIyfQ.3NNTzn3q6DNP4SImXw7u9FS_i2jghKYHF4BIpvz5tIc
Content-Type: application/json

Query Parameters

includes=category,sync_status_url_anatomy

Response

Response Fields

Name Description Type
id The live id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
status The status of live. {ready,started,ended} String
type The event type indicates the live owns different functions and is used in different scenario.{event,sync,channel} String
start_time The start time of the live event. String
started_at The starting time of live streaming. String
ended_at The ending time of live streaming. String
stream_key_expired_at The expired time of stream key. This field is empty until the streaming has been started. If the stream key is expired and there is no any ongoing streaming, the event will be ended automatically within several minutes. String
status_updated_at The status updated time of live streaming. String
highest_resolution The highest resolution of live streaming. String
profile The profile of live streaming. String
stream_url The url of streaming source. String
stream_server_url The stream server url. String
stream_key The stream key for rtmp setup. This field is empty after the live event is ended. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
free Determine if the monetizable item is free or not. Boolean
cover_url The image shown in the player when the live streaming is off air. String
["cover_image"][url] The image shown in the player when the live streaming is off air. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String
vod_listed Whether the new VoD of the live event is listed. Boolean
vod_available Whether the new VoD of the live event is available. Boolean
vod_merge Whether to merge all VoDs of the live event together. If this field is enabled, only one VoD is generated and there is no temporary VoD is shown until the live event ends. Boolean
vod_enabled Whether to generate a video after the live event stops. Boolean
dvr_enabled Whether to enable live DVR feature for a live event. Boolean
transcode_enabled Whether to enable transcoding. Boolean
["ccu_statistic_summary"][account_id] The id of the account which the resource belongs to. String
["ccu_statistic_summary"][ccu] The number of concurrent users at the last update time. Integer
["ccu_statistic_summary"][updated_at] The data last updated time. String
chatroom The chatroom. Object
["chatroom"][account_id] The id of the account which the resource belongs to. String
["chatroom"][name] The chatroom name which must be unique under the account scope. Integer
videos The VOD of the live event. Array
["videos"][id] The video id. String
["videos"][account_id] The id of the account which the resource belongs to. String
["videos"][title] The title. String
["videos"][synopsis] The synopsis. String
["videos"][listed] Whether this resource is listed. Boolean
["videos"][available] Whether this resource is available. Boolean
["videos"][publish_time] The video publish time in ISO8601 format. String
["videos"][accomplished] The video transcoding status. Boolean
["videos"][duration] The duration of the video. Integer
["videos"][resolution] The resolution of the video. String
["videos"][live_id] Indicates this video is generated by the live event. String
["videos"][live_started_at] The starting time of the live streaming. String
["videos"][live_ended_at] The ending time of the live streaming. String
["videos"][projection] Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
["videos"][stream_url] The url of streaming source. String
["videos"][embed_url] The embed player url. String
["videos"][poster_url] The large size thumbnail of thumbnail_urls. String
["videos"][thumbnail_urls] The thumbnail urls. Object
["videos", "thumbnail_urls"][large] The large size thumbnail. Object
["videos", "thumbnail_urls", "large"][url] Url of the thumbnail. String
["videos", "thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["videos", "thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["videos", "thumbnail_urls"][medium] The medium size thumbnail. Object
["videos", "thumbnail_urls", "medium"][url] Url of the thumbnail. String
["videos", "thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["videos", "thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["videos", "thumbnail_urls"][small] The small size thumbnail. Object
["videos", "thumbnail_urls", "small"][url] Url of the thumbnail. String
["videos", "thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["videos", "thumbnail_urls", "small"][height] Height of the thumbnail. Integer
["videos"][free] Determine if the monetizable item is free or not. Boolean
["videos"][vip_accessible] Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
["videos"][owner] The owner of this resource. String
["videos", "owner"][id] The id of the member who exists in your member system. String
["videos"][created_at] The data created time. String
["videos"][updated_at] The data last updated time. String
sync_status_url_anatomy The information for socket.io connection. The information is used to receive the broadcasting status. Object
["sync_status_url_anatomy"][host] The socket.io server host. String
["sync_status_url_anatomy"][path] The socket.io server path. String
["sync_status_url_anatomy"][query] The socket.io connection token. String
rtmp_stream_url (Deprecated) Please use /api/v1/app/lives/:id/rtmp_edge_stream. String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 1589
ETag: W/"9cb379ae8a4ce938866581952e51cde3"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 9fc498d8-10b2-490d-8f73-c460e40560d3
X-Runtime: 0.047461

Body

{
  "id": "YojZcSiR",
  "account_id": "straas-dev-test",
  "title": "Rem est quos quia libero ut vel repellendus maiores.",
  "synopsis": "Molestiae dicta temporibus autem neque est aperiam quo quam.",
  "status": "ready",
  "start_time": "2020-07-09T19:09:35Z",
  "started_at": null,
  "ended_at": null,
  "status_updated_at": null,
  "highest_resolution": "_720p",
  "profile": "720p",
  "stream_url": "https://rtcp-agent-staging.straas.net/YojZcSiR/video/live.m3u8",
  "stream_key_expired_at": null,
  "stream_server_url": "rtmp://livestaging-ea.straas.net/app",
  "stream_key": "8ea21abfb6394972a1f62df9222e19d1",
  "cover_url": null,
  "cover_image": {
    "url": null
  },
  "embed_url": "https://app-staging.straas.net/straas-dev-test/lives/YojZcSiR",
  "vod_available": false,
  "vod_listed": false,
  "vod_merge": true,
  "available": true,
  "listed": true,
  "projection": "flat",
  "category": {
    "id": 114,
    "default": true,
    "name": "Not classified",
    "description": "Default category",
    "videos_count": 0,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 0,
    "parent_id": null,
    "created_at": "2020-07-09T09:02:02Z",
    "updated_at": "2020-07-09T09:02:02Z"
  },
  "free": true,
  "poster_url": null,
  "thumbnail_urls": null,
  "sync_status_url_anatomy": {
    "host": "https://sk-staging.straas.net",
    "path": "/pierce/socket.io/",
    "query": "token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InpoMkZ0RDc0dmIiLCJyb29tcyI6W3sibmFtZXNwYWNlIjoibGl2ZV9ldmVudHMiLCJpZCI6InN0cmFhcy1kZXY9UkZuVzRSQmYifV0sImV4cCI6MTQ4MzgwNjI0NX0.m7yy_7yMV4IrrPL1vxz4fUp0uaK04d5yg_LWkoVUAug&cid=Y2q8auAZ0m"
  },
  "vod_enabled": true,
  "transcode_enabled": true,
  "dvr_enabled": false,
  "type": "event",
  "created_at": "2020-07-09T09:02:02Z",
  "updated_at": "2020-07-09T09:02:02Z"
}

Get Live's RTMP Edge Stream

Get live’s rtmp edge stream for low latency live streaming.

Endpoint

GET /api/v1/app/lives/:id/rtmp_edge_stream

Parameters

Name Description Type
id required

The live id.

String

Request

Route

GET /api/v1/app/lives/W6YCuskU/rtmp_edge_stream

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjIzLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNjk5fQ.hXS9GvHPuWYgNxihcZpm5cO_SDi1nOSdVr0bLZHO6Gk
Content-Type: application/json

Response

Response Fields

Name Description Type
account_id The id of the account which the resource belongs to. String
live_id The live id. String
urls The rtmp urls of rtmp edge stream, will be an empty array when live's status is not started. Array

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 179
ETag: W/"5cbe8337efb8e617682e36cec10688c6"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 34572ec7-0d10-410a-83b0-84b24e9011af
X-Runtime: 0.065740

Body

{
  "live_id": "W6YCuskU",
  "account_id": "straas-dev-test",
  "urls": [
    "rtmp://35.194.164.117/app/6HRV5C44QLWLGGF72AGTZTOFSQFGGQFJFVIBVFJOG42YSP7KI3B4NIAIC6GCQBCQ6GUIYJWBN3MCMTOAKZ5KA==="
  ]
}

Get Live's Videos

Get live’s videos.

Endpoint

GET /api/v1/app/lives/:id/videos

Parameters

Name Description Type
id required

The live id.

String

Request

Route

GET /api/v1/app/lives/ephsKvj7/videos

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjMxLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzA0fQ.IOeQmK1o20-UZHIxoCqSxPkCCor9pKNEghDAJJFPeYI
Content-Type: application/json

Response

Response Fields

Name Description Type
id The video id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
publish_time The video publish time in ISO8601 format. String
accomplished The video transcoding status. Boolean
duration The duration of the video. Integer
resolution The resolution of the video. String
live_id Indicates this video is generated by the live event. String
live_started_at The starting time of the live streaming. String
live_ended_at The ending time of the live streaming. String
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
stream_url The url of streaming source. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
free Determine if the monetizable item is free or not. Boolean
vip_accessible Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

Total: 2
Per-Page: 10
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 1333
ETag: W/"aecb6c0b69b63afff0c9ac167386082b"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 00d72b40-d4d2-4f96-8bc3-7983bc614ca5
X-Runtime: 0.051450

Body

[
  {
    "id": "bMTDoyE4",
    "account_id": "straas-dev-test",
    "title": "Voluptatem rem voluptatem aut est culpa occaecati.",
    "synopsis": "Dignissimos sequi ipsam libero voluptatem.",
    "accomplished": true,
    "duration": 7804664,
    "resolution": "_1080p",
    "stream_url": "https://vod-staging.straas.net/test.m3u8",
    "embed_url": "https://app-staging.straas.net/straas-dev-test/videos/bMTDoyE4",
    "live_id": "ephsKvj7",
    "available": false,
    "listed": false,
    "projection": "flat",
    "free": true,
    "vip_accessible": true,
    "poster_url": null,
    "thumbnail_urls": null,
    "storyboard_set": null,
    "publish_time": null,
    "live_started_at": null,
    "live_ended_at": null,
    "created_at": "2020-07-09T09:01:44Z",
    "updated_at": "2020-07-09T09:01:44Z"
  },
  {
    "id": "iJZdstw6",
    "account_id": "straas-dev-test",
    "title": "Voluptatem rem voluptatem aut est culpa occaecati.",
    "synopsis": "Dignissimos sequi ipsam libero voluptatem.",
    "accomplished": true,
    "duration": 9022108,
    "resolution": "_1080p",
    "stream_url": "https://vod-staging.straas.net/test.m3u8",
    "embed_url": "https://app-staging.straas.net/straas-dev-test/videos/iJZdstw6",
    "live_id": "ephsKvj7",
    "available": false,
    "listed": false,
    "projection": "flat",
    "free": true,
    "vip_accessible": true,
    "poster_url": null,
    "thumbnail_urls": null,
    "storyboard_set": null,
    "publish_time": null,
    "live_started_at": null,
    "live_ended_at": null,
    "created_at": "2020-07-09T09:01:44Z",
    "updated_at": "2020-07-09T09:01:44Z"
  }
]

Get Lives

Get the live list.

Endpoint

GET /api/v1/app/lives

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer
listed

Filter the listed items.

Boolean
available

Filter the available items.

Boolean
category_ids

Filter the item which exists in the category. Multiple ids are allowed. For example, category_ids=1,3,5

String
tags

Filter the item which are tagged with the tags. Multiple tags are allowed. For example, tags=sport,game

String
owner[member_id]

Filter the item which is owned by the member registered in your member system.

String
types

Filter the lives which type is given. {event,sync,channel}

String
sort

Data sorted by which column {start_time,created_at,updated_at,status,started_at,ccu_statistic_summary.ccu}. Apply - to sort in descending order. For example, sort=-start_time. Apply column name only to sort in ascending order. For example, sort=start_time. You also can use + sign to imply ascending sort order. Note that + sign is an URL reserved character, please encode + to %2B if you compose the URL manually. When you sort data by a column which belongs to its included resource, the resource is included automatically.

String
includes

Include extra resource details. Allow included resources: {tags,category,owner,ccu_statistic_summary}. For example, includes=tags,category.

String
status

The live status. {ready,started,ended}

String

Request

Route

GET /api/v1/app/lives?page=1&per_page=5&includes=owner&owner[member_id]=cp_member_id

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjQ1LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzExfQ.3NLh76DmNS28n-2hQGi1O8YSz_DnJzUJkxEvBf8uPck
Content-Type: application/json

Query Parameters

page=1
per_page=5
includes=owner
owner={"member_id"=>"cp_member_id"}

Response

Response Fields

Name Description Type
id The live id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
status The status of live. {ready,started,ended} String
type The event type indicates the live owns different functions and is used in different scenario.{event,sync,channel} String
start_time The start time of the live event. String
started_at The starting time of live streaming. String
ended_at The ending time of live streaming. String
stream_key_expired_at The expired time of stream key. This field is empty until the streaming has been started. If the stream key is expired and there is no any ongoing streaming, the event will be ended automatically within several minutes. String
status_updated_at The status updated time of live streaming. String
highest_resolution The highest resolution of live streaming. String
profile The profile of live streaming. String
stream_url The url of streaming source. String
stream_server_url The stream server url. String
stream_key The stream key for rtmp setup. This field is empty after the live event is ended. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
free Determine if the monetizable item is free or not. Boolean
cover_url The image shown in the player when the live streaming is off air. String
["cover_image"][url] The image shown in the player when the live streaming is off air. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String
vod_listed Whether the new VoD of the live event is listed. Boolean
vod_available Whether the new VoD of the live event is available. Boolean
vod_merge Whether to merge all VoDs of the live event together. If this field is enabled, only one VoD is generated and there is no temporary VoD is shown until the live event ends. Boolean
vod_enabled Whether to generate a video after the live event stops. Boolean
dvr_enabled Whether to enable live DVR feature for a live event. Boolean
transcode_enabled Whether to enable transcoding. Boolean
["ccu_statistic_summary"][account_id] The id of the account which the resource belongs to. String
["ccu_statistic_summary"][ccu] The number of concurrent users at the last update time. Integer
["ccu_statistic_summary"][updated_at] The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 1004
ETag: W/"7044fc8cf655ce1c5e5718f122a84652"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 9c96ba0e-9dd6-414a-b150-a0a9fc285164
X-Runtime: 0.075558

Body

[
  {
    "id": "oePng9vM",
    "account_id": "straas-dev-test",
    "title": "Veniam praesentium officiis et.",
    "synopsis": "Quod quia numquam libero id dolorem dignissimos inventore natus.",
    "status": "ready",
    "start_time": "2020-07-08T22:43:33Z",
    "started_at": null,
    "ended_at": null,
    "status_updated_at": null,
    "highest_resolution": "_720p",
    "profile": "720p",
    "stream_url": "https://rtcp-agent-staging.straas.net/oePng9vM/video/live.m3u8",
    "stream_key_expired_at": null,
    "stream_server_url": "rtmp://livestaging-ea.straas.net/app",
    "stream_key": "8ea21abfb6394972a1f62df9222e19d1",
    "cover_url": null,
    "cover_image": {
      "url": null
    },
    "embed_url": "https://app-staging.straas.net/straas-dev-test/lives/oePng9vM",
    "vod_available": false,
    "vod_listed": false,
    "vod_merge": true,
    "available": true,
    "listed": true,
    "projection": "flat",
    "free": true,
    "poster_url": null,
    "thumbnail_urls": null,
    "owner": {
      "id": "cp_member_id"
    },
    "vod_enabled": true,
    "transcode_enabled": true,
    "dvr_enabled": false,
    "type": "event",
    "created_at": "2020-07-09T09:01:51Z",
    "updated_at": "2020-07-09T09:01:51Z"
  }
]

Get Searched Lives

Get the live list of search result.

Endpoint

GET /api/v1/app/lives/search

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer
category_ids

Filter the item which exists in the category. Multiple ids are allowed. For example, category_ids=1,3,5

String
owner[member_id]

Filter the item which is owned by the member registered in your member system.

String
search_query required

Data search in these {title} columns. You can use multiple terms at a search. Terms have to be separated by whitespace. The search result would return only items that contains all of the query terms. For example: “straas awesome” would return only items that match straas AND awesome.

String
includes

Include extra resource details. Allow included resources: {category,owner,ccu_statistic_summary}. For example, includes=category,owner.

String

Request

Route

GET /api/v1/app/lives/search?page=1&per_page=5&owner[member_id]=cp_member_id&category_ids=142&search_query=default+title&includes=category%2Cowner%2Cccu_statistic_summary

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjc4LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzMyfQ.aIPvZ2e0PCOcOb4-f0Pv8qeq0kwxhan_PC5LoQ9p8Xw
Content-Type: application/json

Query Parameters

page=1
per_page=5
owner={"member_id"=>"cp_member_id"}
category_ids=142
search_query=default title
includes=category,owner,ccu_statistic_summary

Response

Response Fields

Name Description Type
id The live id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
status The status of live. {ready,started,ended} String
type The event type indicates the live owns different functions and is used in different scenario.{event,sync,channel} String
start_time The start time of the live event. String
started_at The starting time of live streaming. String
ended_at The ending time of live streaming. String
stream_key_expired_at The expired time of stream key. This field is empty until the streaming has been started. If the stream key is expired and there is no any ongoing streaming, the event will be ended automatically within several minutes. String
status_updated_at The status updated time of live streaming. String
highest_resolution The highest resolution of live streaming. String
profile The profile of live streaming. String
stream_url The url of streaming source. String
stream_server_url The stream server url. String
stream_key The stream key for rtmp setup. This field is empty after the live event is ended. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
free Determine if the monetizable item is free or not. Boolean
cover_url The image shown in the player when the live streaming is off air. String
["cover_image"][url] The image shown in the player when the live streaming is off air. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String
vod_listed Whether the new VoD of the live event is listed. Boolean
vod_available Whether the new VoD of the live event is available. Boolean
vod_merge Whether to merge all VoDs of the live event together. If this field is enabled, only one VoD is generated and there is no temporary VoD is shown until the live event ends. Boolean
vod_enabled Whether to generate a video after the live event stops. Boolean
dvr_enabled Whether to enable live DVR feature for a live event. Boolean
transcode_enabled Whether to enable transcoding. Boolean
["ccu_statistic_summary"][account_id] The id of the account which the resource belongs to. String
["ccu_statistic_summary"][ccu] The number of concurrent users at the last update time. Integer
["ccu_statistic_summary"][updated_at] The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 1381
ETag: W/"f84a739129ebb0465ae1de0fc32526a4"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2c3c9639-678a-4bdc-814c-4c1af7f1b2af
X-Runtime: 0.068826

Body

[
  {
    "id": "SgTMfNHU",
    "account_id": "straas-dev-test",
    "title": "default title",
    "synopsis": "Omnis nesciunt odio vel consequatur assumenda rerum accusamus molestias.",
    "status": "ready",
    "start_time": "2020-07-08T06:18:03Z",
    "started_at": null,
    "ended_at": null,
    "status_updated_at": null,
    "highest_resolution": "_720p",
    "profile": "720p",
    "stream_url": "https://rtcp-agent-staging.straas.net/SgTMfNHU/video/live.m3u8",
    "stream_key_expired_at": null,
    "stream_server_url": "rtmp://livestaging-ea.straas.net/app",
    "stream_key": "8ea21abfb6394972a1f62df9222e19d1",
    "cover_url": null,
    "cover_image": {
      "url": null
    },
    "embed_url": "https://app-staging.straas.net/straas-dev-test/lives/SgTMfNHU",
    "vod_available": false,
    "vod_listed": false,
    "vod_merge": false,
    "available": true,
    "listed": true,
    "projection": "flat",
    "category": {
      "id": 142,
      "default": false,
      "name": "category-121",
      "description": "A totam eum at quisquam exercitationem non quidem.",
      "videos_count": 1,
      "lives_count": 0,
      "playlists_count": 0,
      "total_count": 1,
      "parent_id": null,
      "created_at": "2020-07-09T09:02:12Z",
      "updated_at": "2020-07-09T09:02:12Z"
    },
    "free": true,
    "poster_url": null,
    "thumbnail_urls": null,
    "owner": {
      "id": "cp_member_id"
    },
    "ccu_statistic_summary": {
      "account_id": "straas-dev-test",
      "ccu": 0,
      "updated_at": "2020-07-09T09:02:12Z"
    },
    "vod_enabled": true,
    "transcode_enabled": true,
    "dvr_enabled": false,
    "type": "event",
    "created_at": "2020-07-09T09:02:12Z",
    "updated_at": "2020-07-09T09:02:12Z"
  }
]

Update Live

Update details of a live.

Endpoint

PUT /api/v1/app/lives/:id

Parameters

Name Description Type
title

The title of the resource. Currently, emoji is not supported.

String
synopsis

The synopsis of the resource.

String
listed

Whether to list the item.

Boolean
status

The status of the live. Set status to ‘ended’ when the live event is over. {ended}. You can skip the following condition if you don’t need the owner use case. A member can only own one unended event at a time. The old live event should be ended before creating another new one.

String
vod_listed

Whether to list the new VoD of the live event.

Boolean
vod_available

Whether the new VoD of the live event is available by users.

Boolean
category

The category object (i.e. category: { id: }.) which the resource belongs to.

Object
category[id]

The category id.

Integer
tags

The array of tag objects (i.e. tags: [ { name: } ]) which the resource is tagged with.

Array[Object]
tags[name]

The name of the tag.

String
start_time

The start time of live event. The default value is current time, if this parameter is empty.

String
projection

Specifies the projection format of the media. {flat,equirectangular} Set equirectangular type to play a full 360 degree panorama media.

String
free

Determine if the monetizable item is free or not.

Boolean
owner

The member who owns this resource.

Object
owner[member_id]

The member id.

String

Request

Route

PUT /api/v1/app/lives/7iVFBHgT

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjc2LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzMxfQ.e52f3IwwQMPaNVj384gDoy3uWe7UXUeeb7WU7vdoq3E
Content-Type: application/json

Body

{
  "category": {
    "id": 138
  },
  "title": "new live test title",
  "synopsis": "new test test test test synopsis",
  "listed": false,
  "status": "ended",
  "tags": [
    {
      "name": "tag1"
    },
    {
      "name": "tag2"
    }
  ],
  "vod_listed": true,
  "vod_available": true,
  "start_time": "2017-01-02T00:00:00.000Z",
  "projection": "equirectangular",
  "owner": {
    "member_id": "cp_member_id"
  }
}

Response

Response Fields

Name Description Type
id The live id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
status The status of live. {ready,started,ended} String
type The event type indicates the live owns different functions and is used in different scenario.{event,sync,channel} String
start_time The start time of the live event. String
started_at The starting time of live streaming. String
ended_at The ending time of live streaming. String
stream_key_expired_at The expired time of stream key. This field is empty until the streaming has been started. If the stream key is expired and there is no any ongoing streaming, the event will be ended automatically within several minutes. String
status_updated_at The status updated time of live streaming. String
highest_resolution The highest resolution of live streaming. String
profile The profile of live streaming. String
stream_url The url of streaming source. String
stream_server_url The stream server url. String
stream_key The stream key for rtmp setup. This field is empty after the live event is ended. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
free Determine if the monetizable item is free or not. Boolean
cover_url The image shown in the player when the live streaming is off air. String
["cover_image"][url] The image shown in the player when the live streaming is off air. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String
vod_listed Whether the new VoD of the live event is listed. Boolean
vod_available Whether the new VoD of the live event is available. Boolean
vod_merge Whether to merge all VoDs of the live event together. If this field is enabled, only one VoD is generated and there is no temporary VoD is shown until the live event ends. Boolean
vod_enabled Whether to generate a video after the live event stops. Boolean
dvr_enabled Whether to enable live DVR feature for a live event. Boolean
transcode_enabled Whether to enable transcoding. Boolean
["ccu_statistic_summary"][account_id] The id of the account which the resource belongs to. String
["ccu_statistic_summary"][ccu] The number of concurrent users at the last update time. Integer
["ccu_statistic_summary"][updated_at] The data last updated time. String
chatroom The chatroom. Object
["chatroom"][account_id] The id of the account which the resource belongs to. String
["chatroom"][name] The chatroom name which must be unique under the account scope. Integer
videos The VOD of the live event. Array
["videos"][id] The video id. String
["videos"][account_id] The id of the account which the resource belongs to. String
["videos"][title] The title. String
["videos"][synopsis] The synopsis. String
["videos"][listed] Whether this resource is listed. Boolean
["videos"][available] Whether this resource is available. Boolean
["videos"][publish_time] The video publish time in ISO8601 format. String
["videos"][accomplished] The video transcoding status. Boolean
["videos"][duration] The duration of the video. Integer
["videos"][resolution] The resolution of the video. String
["videos"][live_id] Indicates this video is generated by the live event. String
["videos"][live_started_at] The starting time of the live streaming. String
["videos"][live_ended_at] The ending time of the live streaming. String
["videos"][projection] Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
["videos"][stream_url] The url of streaming source. String
["videos"][embed_url] The embed player url. String
["videos"][poster_url] The large size thumbnail of thumbnail_urls. String
["videos"][thumbnail_urls] The thumbnail urls. Object
["videos", "thumbnail_urls"][large] The large size thumbnail. Object
["videos", "thumbnail_urls", "large"][url] Url of the thumbnail. String
["videos", "thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["videos", "thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["videos", "thumbnail_urls"][medium] The medium size thumbnail. Object
["videos", "thumbnail_urls", "medium"][url] Url of the thumbnail. String
["videos", "thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["videos", "thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["videos", "thumbnail_urls"][small] The small size thumbnail. Object
["videos", "thumbnail_urls", "small"][url] Url of the thumbnail. String
["videos", "thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["videos", "thumbnail_urls", "small"][height] Height of the thumbnail. Integer
["videos"][free] Determine if the monetizable item is free or not. Boolean
["videos"][vip_accessible] Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
["videos"][owner] The owner of this resource. String
["videos", "owner"][id] The id of the member who exists in your member system. String
["videos"][created_at] The data created time. String
["videos"][updated_at] The data last updated time. String
sync_status_url_anatomy The information for socket.io connection. The information is used to receive the broadcasting status. Object
["sync_status_url_anatomy"][host] The socket.io server host. String
["sync_status_url_anatomy"][path] The socket.io server path. String
["sync_status_url_anatomy"][query] The socket.io connection token. String
rtmp_stream_url (Deprecated) Please use /api/v1/app/lives/:id/rtmp_edge_stream. String

Status

200

Headers

X-Cache-Count: 20
Content-Type: application/json
Content-Length: 2478
ETag: W/"18bc1bd1718c48c29720b974016fe696"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: be4fd600-abff-4802-9d65-4802fdf073b9
X-Runtime: 0.290810

Body

{
  "id": "7iVFBHgT",
  "account_id": "straas-dev-test",
  "title": "new live test title",
  "synopsis": "new test test test test synopsis",
  "status": "ended",
  "start_time": "2017-01-02T00:00:00Z",
  "started_at": null,
  "ended_at": "2017-01-01T00:00:00Z",
  "status_updated_at": "2017-01-01T00:00:00Z",
  "highest_resolution": "_720p",
  "profile": "720p",
  "stream_url": "https://rtcp-agent-staging.straas.net/7iVFBHgT/video/live.m3u8",
  "stream_key_expired_at": null,
  "stream_server_url": "rtmp://livestaging-ea.straas.net/app",
  "stream_key": null,
  "streams": [
    {
      "id": 60,
      "key": null,
      "expired_at": null,
      "created_at": "2017-08-18T08:22:10Z",
      "updated_at": "2017-01-01T00:00:00Z"
    }
  ],
  "rtmp_stream_url": "rtmp://35.194.164.117/app/6HRV5C44QLWLGGF72AGTZTOFSQFGGQFJFVIBVFJOG42YSP7KI3B4NIAIC6GCQBCQ6GUIYJWBN3MCMTOAKZ5KA===",
  "cover_url": null,
  "cover_image": {
    "url": null
  },
  "embed_url": "https://app-staging.straas.net/straas-dev-test/lives/7iVFBHgT",
  "videos": [

  ],
  "vod_available": true,
  "vod_listed": true,
  "vod_merge": false,
  "tags": [
    {
      "id": 3,
      "name": "tag1",
      "description": null,
      "taggings_count": 1
    },
    {
      "id": 4,
      "name": "tag2",
      "description": null,
      "taggings_count": 1
    }
  ],
  "available": true,
  "listed": false,
  "projection": "equirectangular",
  "category": {
    "id": 138,
    "default": false,
    "name": "category-119",
    "description": "Doloribus velit dignissimos magnam at perspiciatis tempore fugiat laboriosam.",
    "videos_count": 1,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 1,
    "parent_id": null,
    "created_at": "2017-01-01T00:00:00Z",
    "updated_at": "2017-01-01T00:00:00Z"
  },
  "monetization_rules": [

  ],
  "has_monetization_rules": false,
  "free": true,
  "poster_url": null,
  "thumbnail_urls": null,
  "owner": {
    "id": "cp_member_id"
  },
  "statistic_summary": {
    "views_count_sum": 0,
    "viewers_count_sum": 0,
    "time_watched_sum": 0,
    "play_count_sum": 0,
    "play_duration_sum": 0,
    "hit_count_sum": 0,
    "base_play_count": 0,
    "base_play_duration": 0,
    "base_hit_count": 0,
    "hit_count_sum_with_base": 0,
    "updated_at": "2017-01-01T00:00:00Z"
  },
  "ccu_statistic_summary": {
    "account_id": "straas-dev-test",
    "ccu": 0,
    "updated_at": "2017-01-01T00:00:00Z"
  },
  "sync_status_url_anatomy": {
    "host": "https://sk-staging.straas.net",
    "path": "/pierce/socket.io/",
    "query": "token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InpoMkZ0RDc0dmIiLCJyb29tcyI6W3sibmFtZXNwYWNlIjoibGl2ZV9ldmVudHMiLCJpZCI6InN0cmFhcy1kZXY9UkZuVzRSQmYifV0sImV4cCI6MTQ4MzgwNjI0NX0.m7yy_7yMV4IrrPL1vxz4fUp0uaK04d5yg_LWkoVUAug&cid=1O87p4rNby"
  },
  "vod_enabled": true,
  "transcode_enabled": true,
  "dvr_enabled": false,
  "type": "event",
  "chatroom": null,
  "created_at": "2017-01-01T00:00:00Z",
  "updated_at": "2017-01-01T00:00:00Z"
}

LivePackage

A set of lives can be bundled by a live package and monetized together.

Create LivePackage

Create a live package.

Endpoint

POST /api/v1/app/live_packages

Parameters

Name Description Type
title required

The title of the resource. Currently, emoji is not supported.

String

Request

Route

POST /api/v1/app/live_packages

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjM3LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzA3fQ.Atx4aQpFiq8Iidu9OcgT52mrRGCvPJfcyTvUrnmFppk
Content-Type: application/json

Body

{
  "title": "live package title"
}

Response

Response Fields

Name Description Type
id The live package id. String
account_id The id of the account which the resource belongs to. String
title The live package title. String
created_at The data created time. String
updated_at The data last updated time. String

Status

201

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 149
ETag: W/"4b1d6f0bf24ecee3a2d547c09eb0f841"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 36212cde-3bdd-4d86-b8f0-1317e7594847
X-Runtime: 0.030770

Body

{
  "id": "RTqM3Huy",
  "account_id": "straas-dev-test",
  "title": "live package title",
  "created_at": "2020-07-09T09:01:47Z",
  "updated_at": "2020-07-09T09:01:47Z"
}

Create LivePackageItem

Add a live to a live package.

Endpoint

POST /api/v1/app/live_packages/:live_package_id/live_package_items

Parameters

Name Description Type
live_package_id required

The live package id.

String
live_id required

The live id.

String

Request

Route

POST /api/v1/app/live_packages/VcwB7gP5/live_package_items

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjQwLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzA4fQ.b2egCCTrA97hUpdgAAA0xbgKSDlSM17TakmQKLt6TTk
Content-Type: application/json

Body

{
  "live_id": "Y6QwT6gx"
}

Response

Response Fields

Name Description Type
id The live package item id. Integer
account_id The id of the account which the resource belongs to. String
live_package_id The live package id which the live package item belongs to. String
live_id The live id of the live package item. String
live The live object. Object
["live"][id] The live id. String
["live"][title] The title. String
["live"][type] The event type indicates the live owns different functions and is used in different scenario.{event,sync,channel} String
["live"][poster_url] The large size thumbnail of thumbnail_urls. String
["live"][thumbnail_urls] The thumbnail urls. Object
["live", "thumbnail_urls"][large] The large size thumbnail. Object
["live", "thumbnail_urls", "large"][url] Url of the thumbnail. String
["live", "thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["live", "thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["live", "thumbnail_urls"][medium] The medium size thumbnail. Object
["live", "thumbnail_urls", "medium"][url] Url of the thumbnail. String
["live", "thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["live", "thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["live", "thumbnail_urls"][small] The small size thumbnail. Object
["live", "thumbnail_urls", "small"][url] Url of the thumbnail. String
["live", "thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["live", "thumbnail_urls", "small"][height] Height of the thumbnail. Integer
created_at The data created time. String
updated_at The data last updated time. String

Status

201

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 292
ETag: W/"6dc9ba12a894626467522a8c5ba87ced"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 116f9ec9-464d-470e-ad9b-02e37e16ada2
X-Runtime: 0.117451

Body

{
  "id": 1,
  "account_id": "straas-dev-test",
  "live_package_id": "VcwB7gP5",
  "live_id": "Y6QwT6gx",
  "live": {
    "id": "Y6QwT6gx",
    "title": "Sed velit quam sint voluptatem quis sed.",
    "type": "event",
    "poster_url": null,
    "thumbnail_urls": null
  },
  "created_at": "2020-07-09T09:01:48Z",
  "updated_at": "2020-07-09T09:01:48Z"
}

Delete LivePackage

Delete the live package.

Endpoint

DELETE /api/v1/app/live_packages/:id

Parameters

Name Description Type
id required

The live package id.

String

Request

Route

DELETE /api/v1/app/live_packages/k4qyKzkP

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjM5LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzA3fQ.wnXCNSq9j-qjUytDctz6g3QqmcPR5w_UsTg3KWfWX1k
Content-Type: application/json

Response

Response Fields

Name Description Type
id The live package id. String
account_id The id of the account which the resource belongs to. String
title The live package title. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 150
ETag: W/"4ebb1f6fd94b7e33621da6abbe4418e0"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 93db380f-a6d8-4f15-9d1a-d9b85db045c7
X-Runtime: 0.172424

Body

{
  "id": "k4qyKzkP",
  "account_id": "straas-dev-test",
  "title": "live package title7",
  "created_at": "2020-07-09T09:01:47Z",
  "updated_at": "2020-07-09T09:01:47Z"
}

Delete LivePackageItem

Remove the live from the live package.

Endpoint

DELETE /api/v1/app/live_packages/:live_package_id/live_package_items/:id

Parameters

Name Description Type
live_package_id required

The live package id.

String
id required

The live package item id.

String

Request

Route

DELETE /api/v1/app/live_packages/6zixXBpX/live_package_items/7

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjQ0LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzEwfQ.-LvcFn8I2t_flygps2VXjJATDGWXgcLlROG943hVAes
Content-Type: application/json

Response

Response Fields

Name Description Type
id The live package item id. Integer
account_id The id of the account which the resource belongs to. String
live_package_id The live package id which the live package item belongs to. String
live_id The live id of the live package item. String
live The live object. Object
["live"][id] The live id. String
["live"][title] The title. String
["live"][type] The event type indicates the live owns different functions and is used in different scenario.{event,sync,channel} String
["live"][poster_url] The large size thumbnail of thumbnail_urls. String
["live"][thumbnail_urls] The thumbnail urls. Object
["live", "thumbnail_urls"][large] The large size thumbnail. Object
["live", "thumbnail_urls", "large"][url] Url of the thumbnail. String
["live", "thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["live", "thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["live", "thumbnail_urls"][medium] The medium size thumbnail. Object
["live", "thumbnail_urls", "medium"][url] Url of the thumbnail. String
["live", "thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["live", "thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["live", "thumbnail_urls"][small] The small size thumbnail. Object
["live", "thumbnail_urls", "small"][url] Url of the thumbnail. String
["live", "thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["live", "thumbnail_urls", "small"][height] Height of the thumbnail. Integer
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 296
ETag: W/"7d8e09ef23820d6c1a3516e976db6417"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 7ee9f423-2bc9-466e-9715-87c5d3aac42a
X-Runtime: 0.096118

Body

{
  "id": 7,
  "account_id": "straas-dev-test",
  "live_package_id": "6zixXBpX",
  "live_id": "eKV9WNev",
  "live": {
    "id": "eKV9WNev",
    "title": "Velit ratione officia voluptatibus est illo.",
    "type": "event",
    "poster_url": null,
    "thumbnail_urls": null
  },
  "created_at": "2020-07-09T09:01:50Z",
  "updated_at": "2020-07-09T09:01:50Z"
}

Get LivePackage Details

Get the live package details.

Endpoint

GET /api/v1/app/live_packages/:id

Parameters

Name Description Type
id required

The live package id.

String
includes

Include extra resource details. Allow included resources: {monetization_rules}. For example, includes=monetization_rules.

String

Request

Route

GET /api/v1/app/live_packages/AELyWDpC?includes=monetization_rules

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjM2LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzA2fQ.pAGgzaRII_V3wxPRyAZYdO9j4fRcdEwyokO8wwR6Byo
Content-Type: application/json

Query Parameters

includes=monetization_rules

Response

Response Fields

Name Description Type
id The live package id. String
account_id The id of the account which the resource belongs to. String
title The live package title. String
created_at The data created time. String
updated_at The data last updated time. String
has_monetization_rules Whether there is any monetization rule created from the monetizable item. Boolean
monetization_rules The monetization rules created from this monetizable item. Array
["monetization_rules"][id] The monetization rule id. Integer
["monetization_rules"][account_id] The id of the account which the resource belongs to. String
["monetization_rules"][description] The desciption of this monetization rule. String
["monetization_rules"][monetizable_type] The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
["monetization_rules"][monetizable_id] The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
["monetization_rules"][title] The title of this monetization rule. String
["monetization_rules"][valid_minutes] The valid duration of this monetization rule. Integer
["monetization_rules"][amount] The price of this monetization rule. Integer
["monetization_rules"][amount_currency] The currency of the price (amount). String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 418
ETag: W/"23bb44196d1365f1c9752086d92c98c1"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 7e276113-a35e-443c-9602-fb5241ad0c7b
X-Runtime: 0.033326

Body

{
  "id": "AELyWDpC",
  "account_id": "straas-dev-test",
  "title": "live package title5",
  "monetization_rules": [
    {
      "id": 1,
      "account_id": "straas-dev-test",
      "title": "monetization rule title1",
      "description": null,
      "amount": 399,
      "amount_currency": "TWD",
      "valid_minutes": 46863,
      "monetizable_id": "AELyWDpC",
      "monetizable_type": "live_package"
    }
  ],
  "has_monetization_rules": true,
  "created_at": "2020-07-09T09:01:46Z",
  "updated_at": "2020-07-09T09:01:46Z"
}

Get LivePackageItems

Get the item list of the live package.

Endpoint

GET /api/v1/app/live_packages/:live_package_id/live_package_items

Parameters

Name Description Type
live_package_id required

The live package id.

String
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer

Request

Route

GET /api/v1/app/live_packages/SbNW8fHV/live_package_items?page=1&per_page=5&sort=created_at

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjQyLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzA5fQ.MeH3lV5cAcl1ywHeGSUq-MzDH2LPly4LecChWEgDniY
Content-Type: application/json

Query Parameters

page=1
per_page=5
sort=created_at

Response

Response Fields

Name Description Type
id The live package item id. Integer
account_id The id of the account which the resource belongs to. String
live_package_id The live package id which the live package item belongs to. String
live_id The live id of the live package item. String
live The live object. Object
["live"][id] The live id. String
["live"][title] The title. String
["live"][type] The event type indicates the live owns different functions and is used in different scenario.{event,sync,channel} String
["live"][poster_url] The large size thumbnail of thumbnail_urls. String
["live"][thumbnail_urls] The thumbnail urls. Object
["live", "thumbnail_urls"][large] The large size thumbnail. Object
["live", "thumbnail_urls", "large"][url] Url of the thumbnail. String
["live", "thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["live", "thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["live", "thumbnail_urls"][medium] The medium size thumbnail. Object
["live", "thumbnail_urls", "medium"][url] Url of the thumbnail. String
["live", "thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["live", "thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["live", "thumbnail_urls"][small] The small size thumbnail. Object
["live", "thumbnail_urls", "small"][url] Url of the thumbnail. String
["live", "thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["live", "thumbnail_urls", "small"][height] Height of the thumbnail. Integer
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 320
ETag: W/"23fbc7c39d25561a9049653d21c3a705"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 8584023f-ea7e-46e0-9926-8242ead4afc1
X-Runtime: 0.041398

Body

[
  {
    "id": 3,
    "account_id": "straas-dev-test",
    "live_package_id": "SbNW8fHV",
    "live_id": "BqajJMSY",
    "live": {
      "id": "BqajJMSY",
      "title": "Qui sint dolorum temporibus provident laboriosam aut perspiciatis.",
      "type": "event",
      "poster_url": null,
      "thumbnail_urls": null
    },
    "created_at": "2020-07-09T09:01:49Z",
    "updated_at": "2020-07-09T09:01:49Z"
  }
]

Get LivePackages

Get live packages.

Endpoint

GET /api/v1/app/live_packages

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer

Request

Route

GET /api/v1/app/live_packages?page=1&per_page=5

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjM0LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzA2fQ.Rw-9KoHkIm2lF5yq8FfuT7wDp9q847FvHei1-gWlUCk
Content-Type: application/json

Query Parameters

page=1
per_page=5

Response

Response Fields

Name Description Type
id The live package id. String
account_id The id of the account which the resource belongs to. String
title The live package title. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 152
ETag: W/"73aa575f59ec54f8e90f3e44edb3c987"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 5674b2dc-46d8-4624-b196-badad8b8bf9b
X-Runtime: 0.025258

Body

[
  {
    "id": "Nt8s5oAb",
    "account_id": "straas-dev-test",
    "title": "live package title1",
    "created_at": "2020-07-09T09:01:46Z",
    "updated_at": "2020-07-09T09:01:46Z"
  }
]

Update LivePackage Details

Update the live package details.

Endpoint

PUT /api/v1/app/live_packages/:id

Parameters

Name Description Type
title

The title of the resource. Currently, emoji is not supported.

String

Request

Route

PUT /api/v1/app/live_packages/UQa2wku3

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjM4LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzA3fQ.RDIjJX9pVIc9s6ZHq00zOmRCSXX5ajnA6HEOLJUS6LQ
Content-Type: application/json

Body

{
  "title": "new live package title6"
}

Response

Response Fields

Name Description Type
id The live package id. String
account_id The id of the account which the resource belongs to. String
title The live package title. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 154
ETag: W/"dd9962ba30c006bdebeef0c7e21291bd"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2a8f93e4-5c7a-400e-8d98-616ec62fb9b5
X-Runtime: 0.028542

Body

{
  "id": "UQa2wku3",
  "account_id": "straas-dev-test",
  "title": "new live package title6",
  "created_at": "2020-07-09T09:01:47Z",
  "updated_at": "2020-07-09T09:01:47Z"
}

Member

Create Member Token

Create a new member token for your client. The member token is used for the member APIs.

Endpoint

POST /api/v1/app/members/:id/token

Parameters

Name Description Type
id required

The id of the member who exists in your member system.

String

Request

Route

POST /api/v1/app/members/cp_member_id/token

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjk3LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzQ3fQ.zGm0yLvTkTUPFjlszM2heRpIg2xC784hjKYwj5gOM5U
Content-Type: application/json

Response

Response Fields

Name Description Type
token New member token. String

Status

201

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 277
ETag: W/"6019629549acb5e4a9fee47b24a681f9"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: a58843aa-ada3-490f-bb12-6901825ab7cb
X-Runtime: 0.062346

Body

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoidHJpYWwuc3RyYWFzLmlvLXRlc3QiLCJtZW1iZXJfaWQiOiJ5YWNodW4iLCJ1c2VyX2lkIjoiYWEwNGMwYjAxNjQxNTAyMGJmOGI0NzNkNmE5ZGIwODEiLCJyZXhwIjoxNTEzNzU3NzI3LCJleHAiOjE1MDUyMDQxMjd9.BzPzf6-vl31CEu0FuNYkF-vXPM6v7e21xFzgzbQC5zo"
}

Create New Member

This API is used to create a cms user. For a better experience, we encourage you to create a new one while your member sign up completely.

Endpoint

POST /api/v1/app/members

Parameters

Name Description Type
id required

The id of the member who exists in your member system. Can only contains charset {-, ., _, A-Z, a-z, 0-9} and support email format.

String
email

The email of the member who exists in your member system.

String
name

The name of the member who exists in your member system. Currently, emoji is not supported.

String
avatar_url

The avatar url of the member who exists in your member system.

String
personal_url

The personal url of the member who exists in your member system.

String

Request

Route

POST /api/v1/app/members

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjk0LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzQ2fQ.Wflg_nVl7MG88lpke158OFPoBjxESv8wgPwL3kgoeIQ
Content-Type: application/json

Body

{
  "id": "cp_member_id",
  "email": "cp_member_id@gmail.com"
}

Response

Response Fields

Name Description Type
id The id of the member who exists in your member system. String
email The email of the member who exists in your member system. String
name The name of the member who exists in your member system. String
avatar_url The avatar url of the member who exists in your member system. String
personal_url The personal url of the member who exists in your member system. String
membership_type Indicates what membership type this member has. If the member paid for a VIP monetization rule, he has a VIP membership. {vip, free} String
membership_expired_at This field is used to describe the duration of VIP membership. It only exist when the membership type is VIP. String

Status

201

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 129
ETag: W/"d37ab82a18ef2907ed4ef967133782db"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: f5618936-5588-44b0-a0ea-577d48c2bfff
X-Runtime: 0.049533

Body

{
  "id": "cp_member_id",
  "email": "cp_member_id@gmail.com",
  "name": null,
  "avatar_url": null,
  "personal_url": null,
  "membership_type": "free"
}

Determine Whether Member Has Permission

Determine whether the member has permission to access the specified monetizable item or not.

Endpoint

GET /api/v1/app/members/:id/check_monetization_permission

Parameters

Name Description Type
id required

The id of the member who exists in your member system.

String
monetizable[id] required

The monetizable item id such as a video id, a playlist id, a live id, a video package id or a membership type id.

String
monetizable[type] required

The type of monetizable item such as Video or Playlist. {video, playlist, live, video_package, membership_type}

String

Request

Route

GET /api/v1/app/members/cp_member_id/check_monetization_permission?monetizable[id]=9dNbGQ58&monetizable[type]=video

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjk4LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzQ3fQ.VwlDv7Cj3_TPls88o2YlPUKEVtwSPczYKg7Biusngbk
Content-Type: application/json

Query Parameters

monetizable={"id"=>"9dNbGQ58", "type"=>"video"}

Response

Response Fields

Name Description Type
has_permission Whether the member has permission to access the monetizable item. Boolean

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 23
ETag: W/"4f51645a83fde80a2b8d879fe1f45718"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: e22f9c2a-919b-4225-91b1-c9d245655ad6
X-Runtime: 0.087415

Body

{
  "has_permission": true
}

Get Member Information

Get the member information.

Endpoint

GET /api/v1/app/members/:id

Parameters

Name Description Type
id required

The id of the member who exists in your member system.

String

Request

Route

GET /api/v1/app/members/cp_member_id

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjk2LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzQ3fQ.KO9-cSJISHk0Y-V2kr8PTXX6B_C5Y94Oqg-u-ctNpAY
Content-Type: application/json

Response

Response Fields

Name Description Type
id The id of the member who exists in your member system. String
email The email of the member who exists in your member system. String
name The name of the member who exists in your member system. String
avatar_url The avatar url of the member who exists in your member system. String
personal_url The personal url of the member who exists in your member system. String
membership_type Indicates what membership type this member has. If the member paid for a VIP monetization rule, he has a VIP membership. {vip, free} String
membership_expired_at This field is used to describe the duration of VIP membership. It only exist when the membership type is VIP. String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 187
ETag: W/"ab247762d40bba043088e21ff4fa80ee"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 7fcb5958-675d-47dd-aafc-f147be3284a6
X-Runtime: 0.039484

Body

{
  "id": "cp_member_id",
  "email": "cp_member_id@gmail.com",
  "name": "cp_member_name",
  "avatar_url": "http://imgur.com/avatar.png",
  "personal_url": "http://www.personal.com",
  "membership_type": "free"
}

Get Member Live Viewing Logs

Return the live viewing logs (i.e. the period of watched live) of this member.

Endpoint

GET /api/v1/app/members/:id/live_viewing_logs

Parameters

Name Description Type
id required

The id of the member who exists in your member system.

String
start_time required

The start time of the viewing logs in ISO8601 format.

String
end_time required

The end time of the viewing logs in ISO8601 format.

String
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer

Request

Route

GET /api/v1/app/members/cp_member_id/live_viewing_logs?start_time=2018-03-26T00%3A00%3A00Z&end_time=2018-03-29T00%3A00%3A00Z&page=1&per_page=2

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjkwLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzQ1fQ.DCDBifseZ-cZ_QAK1oXVpJHHQnDDhURjAE5tnS1F1rw
Content-Type: application/json

Query Parameters

start_time=2018-03-26T00:00:00Z
end_time=2018-03-29T00:00:00Z
page=1
per_page=2

Response

Response Fields

Name Description Type
member_id The member id. String
live_id The id of the watched live. String
viewed_start The start time that the member has watched live. String
viewed_end The end time that the member has watched live. String

Status

200

Headers

Link: <http://example.org/api/v1/app/members/cp_member_id/live_viewing_logs?end_time=2018-03-29T00%3A00%3A00Z&page=2&per_page=2&start_time=2018-03-26T00%3A00%3A00Z>; rel="last", <http://example.org/api/v1/app/members/cp_member_id/live_viewing_logs?end_time=2018-03-29T00%3A00%3A00Z&page=2&per_page=2&start_time=2018-03-26T00%3A00%3A00Z>; rel="next"
Total: 4
Per-Page: 2
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 297
ETag: W/"ce0ed787cb217bce58cc1e7902f9e5e7"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 699c197e-f6d6-4407-8c29-6fcbd679dba5
X-Runtime: 0.071695

Body

[
  {
    "member_id": "straas-dev-test/cp_member_id",
    "viewed_start": "2018-03-27T03:12:14.457Z",
    "viewed_end": "2018-03-27T03:20:14.457Z",
    "live_id": "yF77v3Th"
  },
  {
    "member_id": "straas-dev-test/cp_member_id",
    "viewed_start": "2018-03-27T03:25:14.457Z",
    "viewed_end": "2018-03-27T03:30:14.457Z",
    "live_id": "2mn7nHxe"
  }
]

Get Member Video Viewing Logs

Return the video viewing logs (i.e. the period of watched video) of this member.

Endpoint

GET /api/v1/app/members/:id/video_viewing_logs

Parameters

Name Description Type
id required

The id of the member who exists in your member system.

String
start_time required

The start time of the viewing logs in ISO8601 format.

String
end_time required

The end time of the viewing logs in ISO8601 format.

String
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer

Request

Route

GET /api/v1/app/members/cp_member_id/video_viewing_logs?start_time=2018-03-26T00%3A00%3A00Z&end_time=2018-03-29T00%3A00%3A00Z&page=1&per_page=2

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjkxLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzQ1fQ.71fmRPOuhFS3bd2GQEQwK7uEXcCGtm6udJX-HUsvr2g
Content-Type: application/json

Query Parameters

start_time=2018-03-26T00:00:00Z
end_time=2018-03-29T00:00:00Z
page=1
per_page=2

Response

Response Fields

Name Description Type
member_id The member id. String
video_id The id of the watched video. String
viewed_start The start time that the member has watched video. String
viewed_end The end time that the member has watched video. String

Status

200

Headers

Link: <http://example.org/api/v1/app/members/cp_member_id/video_viewing_logs?end_time=2018-03-29T00%3A00%3A00Z&page=2&per_page=2&start_time=2018-03-26T00%3A00%3A00Z>; rel="last", <http://example.org/api/v1/app/members/cp_member_id/video_viewing_logs?end_time=2018-03-29T00%3A00%3A00Z&page=2&per_page=2&start_time=2018-03-26T00%3A00%3A00Z>; rel="next"
Total: 4
Per-Page: 2
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 299
ETag: W/"0423a7fa425fa51252600cb9e7db999a"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 3119c86a-356a-4ca4-92ca-8b9babe588c7
X-Runtime: 0.048965

Body

[
  {
    "member_id": "straas-dev-test/cp_member_id",
    "viewed_start": "2018-03-27T03:12:14.457Z",
    "viewed_end": "2018-03-27T03:20:14.457Z",
    "video_id": "yF77v3Th"
  },
  {
    "member_id": "straas-dev-test/cp_member_id",
    "viewed_start": "2018-03-27T03:25:14.457Z",
    "viewed_end": "2018-03-27T03:30:14.457Z",
    "video_id": "2mn7nHxe"
  }
]

Get Member Viewing History

Return the viewing history (i.e. the position of the last watched video) of this member.

Endpoint

GET /api/v1/app/members/:id/viewing_history

Parameters

Name Description Type
id required

The id of the member who exists in your member system.

String

Request

Route

GET /api/v1/app/members/cp_member_id/viewing_history

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjkyLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzQ1fQ.ry8cM5OPNV6AeVUkHUGMHFac4Y6hlleBFXd4Ik_oP0w
Content-Type: application/json

Response

Response Fields

Name Description Type
member_id The member id. String
video_id The id of the last watched video. String
position The VoD position of the last watched videos in seconds. Integer

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 63
ETag: W/"5465cdbde6d94ed872a5e5c8429ac95e"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 49ac806e-bb89-41e0-8ce9-38282f02758e
X-Runtime: 0.060480

Body

{
  "member_id": "cp_member_id",
  "video_id": "zzFPtiX5",
  "position": 0
}

Update Member

Update the information of the member. You must update at least one of email, name, avatar_url or personal_url.

Endpoint

PUT /api/v1/app/members/:id

Parameters

Name Description Type
id required

The id of the member who exists in your member system. Can only contains charset {-, ., _, A-Z, a-z, 0-9} and support email format.

String
email

The email of the member who exists in your member system.

String
name

The name of the member who exists in your member system. Currently, emoji is not supported.

String
avatar_url

The avatar url of the member who exists in your member system.

String
personal_url

The personal url of the member who exists in your member system.

String

Request

Route

PUT /api/v1/app/members/cp_member_id

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjk1LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzQ2fQ.AJiwOkLYnJx57hMh_652uMpJghtGIzU1ACj26tfMIvs
Content-Type: application/json

Body

{
  "name": "new_member_name",
  "avatar_url": "http://imgur.com/avatar.png",
  "personal_url": "http://www.personal.com"
}

Response

Response Fields

Name Description Type
id The id of the member who exists in your member system. String
email The email of the member who exists in your member system. String
name The name of the member who exists in your member system. String
avatar_url The avatar url of the member who exists in your member system. String
personal_url The personal url of the member who exists in your member system. String
membership_type Indicates what membership type this member has. If the member paid for a VIP monetization rule, he has a VIP membership. {vip, free} String
membership_expired_at This field is used to describe the duration of VIP membership. It only exist when the membership type is VIP. String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 188
ETag: W/"71abdf19684fd43e53e96c156574ee7a"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: b2bd7399-98fd-4264-8c61-337a35ace6ba
X-Runtime: 0.070279

Body

{
  "id": "cp_member_id",
  "email": "cp_member_id@gmail.com",
  "name": "new_member_name",
  "avatar_url": "http://imgur.com/avatar.png",
  "personal_url": "http://www.personal.com",
  "membership_type": "free"
}

MemberShipType

Get MembershipTypes

Get the membership types.

Endpoint

GET /api/v1/app/membership_types

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer
contains_passcode_sets

Filter the monetizable item which contains passcode sets.

String

Request

Route

GET /api/v1/app/membership_types?contains_passcode_sets=true

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEwMSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc0OH0.ZA-tEX3tD3WGLxJhkDDhx9iBfTHX5D-ftxSo7qy7gms
Content-Type: application/json

Query Parameters

contains_passcode_sets=true

Response

Response Fields

Name Description Type
id The membership type id. Integer
type The membership type. Currently, there is only a VIP type in every account. String

Status

200

Headers

Total: 1
Per-Page: 10
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 25
ETag: W/"ae5ce3c797a6f135c360fc873e50b453"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: e8d3c41e-161a-4460-880c-ecc9b9b96e26
X-Runtime: 0.049057

Body

[
  {
    "id": 101,
    "type": "Vip"
  }
]

MonetizationPermissions

If you prefer to have your own payment system instead of the one provided by StraaS, you can handle the order by yourself and change your member’s permissions via the monetization permission APIs.

Create Monetization Permissions

Create permissions with a monetization rule for a member.

Endpoint

POST /api/v1/app/monetization_permissions

Parameters

Name Description Type
monetization_rule_id required

The monetization rule which will be applied to the member.

Integer
member_id required

The member who will own the permission of this monetization rule.

String

Request

Route

POST /api/v1/app/monetization_permissions

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEwNCwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc1MH0.3rwzgLx_NqafKBm3X-7LwKyaZ4dpIM2xe0_Dm9gMzrQ
Content-Type: application/json

Body

{
  "monetization_rule_id": 5,
  "member_id": "cp_member_id"
}

Response

Response Fields

Name Description Type
member_id The id of the member who owns the permission. String
monetizable_type The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
monetizable_id The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
expired_at The expired time of the access permission of a monetizable item such as a video, a playlist or a live event. String
created_at The data created time. String
updated_at The data last updated time. String

Status

201

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 191
ETag: W/"ce23781322cca2dd1e6245f736b88c25"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 347fc31f-2bb5-47f2-bc6e-076f5b6aff25
X-Runtime: 0.099350

Body

{
  "member_id": "cp_member_id",
  "monetizable_id": "zgGzchBr",
  "monetizable_type": "Video",
  "expired_at": "2020-07-12T11:28:30Z",
  "created_at": "2020-07-09T09:02:30Z",
  "updated_at": "2020-07-09T09:02:30Z"
}

Get Monetization Permissions

Get the monetization permission list.

Endpoint

GET /api/v1/app/monetization_permissions

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer
member_id required

Filter the item owned by the member.

String

Request

Route

GET /api/v1/app/monetization_permissions?member_id=cp_member_id

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEwMywiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc0OX0.sPySmJ_czwIPn-m7PGhFLW9TS9s0NEg2lEjqB4SKeDg
Content-Type: application/json

Query Parameters

member_id=cp_member_id

Response

Response Fields

Name Description Type
member_id The id of the member who owns the permission. String
monetizable_type The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
monetizable_id The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
expired_at The expired time of the access permission of a monetizable item such as a video, a playlist or a live event. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 10
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 193
ETag: W/"0e653ee17e4a545a7ac19d50461cd09e"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: fc599293-23ad-47b2-a5a9-bb9a06f2572c
X-Runtime: 0.023602

Body

[
  {
    "member_id": "cp_member_id",
    "monetizable_id": "ApLgP6PF",
    "monetizable_type": "Video",
    "expired_at": "2020-07-10T09:02:29Z",
    "created_at": "2020-07-09T09:02:29Z",
    "updated_at": "2020-07-09T09:02:29Z"
  }
]

Remove Monetization Permissions

Remove permissions of a monetization rule from a member.

Endpoint

DELETE /api/v1/app/monetization_permissions

Parameters

Name Description Type
monetization_rule_id required

The monetization rule which will be applied to the member.

Integer
member_id required

The member who will lose the permission of this monetization rule.

String

Request

Route

DELETE /api/v1/app/monetization_permissions

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEwNiwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc1MH0.K-vJBFgJkKvB1e9_-U0yQoa7Epb9iXTHqMZ1Su2CXc8
Content-Type: application/json

Body

{
  "monetization_rule_id": 7,
  "member_id": "cp_member_id"
}

Response

Response Fields

Name Description Type
member_id The id of the member who owns the permission. String
monetizable_type The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
monetizable_id The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
expired_at The expired time of the access permission of a monetizable item such as a video, a playlist or a live event. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 191
ETag: W/"2a6712eb3f11403e63eb5bf1aaff59b7"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 038b4e75-20f2-4ce3-92e1-df0f86f631f4
X-Runtime: 0.051762

Body

{
  "member_id": "cp_member_id",
  "monetizable_id": "AuNpc9Fi",
  "monetizable_type": "Video",
  "expired_at": "2020-06-07T01:22:30Z",
  "created_at": "2020-07-09T09:02:30Z",
  "updated_at": "2020-07-09T09:02:30Z"
}

MonetizationRules

Create Monetization Rule

Create a monetization rule.

Endpoint

POST /api/v1/app/monetization_rules

Parameters

Name Description Type
title required

The title of this monetization rule.

String
description

The desciption of this monetization rule.

String
amount required

The price of this monetization rule. The currency of the price is TWD

Integer
valid_minutes required

The valid duration of this monetization rule.

Integer
monetizable_id required

The monetizable item id. {video_id,playlist_id,video_package_id,live_id,live_package_id,membership_type_id}

String
monetizable_type required

The monetizable item type. {video,playlist,video_package,live,live_package,membership_type}

String

Request

Route

POST /api/v1/app/monetization_rules

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEwOSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc1Mn0.hW6aABmXY1ucusVjkJqOhBJlozjM0seRyggXyT_sJoE
Content-Type: application/json

Body

{
  "title": "monetization rule title",
  "description": "monetization rule description",
  "amount": 10,
  "valid_minutes": 1440,
  "monetizable_id": "CdaHH6Y7",
  "monetizable_type": "video"
}

Response

Response Fields

Name Description Type
id The monetization rule id. Integer
account_id The id of the account which the resource belongs to. String
description The desciption of this monetization rule. String
monetizable_type The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
monetizable_id The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
title The title of this monetization rule. String
valid_minutes The valid duration of this monetization rule. Integer
amount The price of this monetization rule. Integer
amount_currency The currency of the price (amount). String

Status

201

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 232
ETag: W/"7e0595dc58a1e651036a625e56af8d5e"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: b1f873ed-8175-41b2-8a59-6426f72afc85
X-Runtime: 0.035349

Body

{
  "id": 16,
  "account_id": "straas-dev-test",
  "title": "monetization rule title",
  "description": "monetization rule description",
  "amount": 10,
  "amount_currency": "TWD",
  "valid_minutes": 1440,
  "monetizable_id": "CdaHH6Y7",
  "monetizable_type": "video"
}

Delete Monetization Rule

Delete a monetization rule.

Endpoint

DELETE /api/v1/app/monetization_rules/:id

Parameters

Name Description Type
id required

Monetization rule id.

Integer

Request

Route

DELETE /api/v1/app/monetization_rules/17

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjExMCwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc1Mn0.dGj_xf_0MWfRJXuZ9Y_Xn07RunX6SEc_rM2FzglRV2s
Content-Type: application/json

Response

Response Fields

Name Description Type
id The monetization rule id. Integer
account_id The id of the account which the resource belongs to. String
description The desciption of this monetization rule. String
monetizable_type The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
monetizable_id The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
title The title of this monetization rule. String
valid_minutes The valid duration of this monetization rule. Integer
amount The price of this monetization rule. Integer
amount_currency The currency of the price (amount). String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 209
ETag: W/"27e3cf973132dcc9b228e152d8d109da"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 269d8aa1-4355-47c8-9e1e-23de4d2ec4ce
X-Runtime: 0.030400

Body

{
  "id": 17,
  "account_id": "straas-dev-test",
  "title": "monetization rule title16",
  "description": null,
  "amount": 953,
  "amount_currency": "TWD",
  "valid_minutes": 59291,
  "monetizable_id": "gBetcsRc",
  "monetizable_type": "video"
}

Get Monetization Rules

Get the monetization rules of the monetizable item such as a video or a playlist.

Endpoint

GET /api/v1/app/monetization_rules

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer
type

Get all monetization rules related to the monetization type. You can use type=”membership_type” to get the subscription choise. {video,playlist,video_package,live,live_package,membership_type}

String
video_ids

Get all monetization rules related to the videos.

String
playlist_ids

Get all monetization rules related to the playlists.

String
video_package_ids

Get all monetization rules related to the video packages.

String
live_ids

Get all monetization rules related to the lives.

String
live_package_ids

Get all monetization rules related to the live packages.

String
sort

Data sorted by which column {monetizable_id}. Apply - to sort in descending order. For example, sort=-monetizable_id. Apply column name only to sort in ascending order. For example, sort=monetizable_id. You also can use + sign to imply ascending sort order. Note that + sign is an URL reserved character, please encode + to %2B if you compose the URL manually. When you sort data by a column which belongs to its included resource, the resource is included automatically.

String

Request

Route

GET /api/v1/app/monetization_rules?video_ids=w5LF7Zvb

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEwNywiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc1MX0.MFRf-zBb7tWTmNt7Rwcj39b92JazkJa534e4oM-fMhU
Content-Type: application/json

Query Parameters

video_ids=w5LF7Zvb

Response

Response Fields

Name Description Type
id The monetization rule id. Integer
account_id The id of the account which the resource belongs to. String
description The desciption of this monetization rule. String
monetizable_type The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
monetizable_id The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
title The title of this monetization rule. String
valid_minutes The valid duration of this monetization rule. Integer
amount The price of this monetization rule. Integer
amount_currency The currency of the price (amount). String

Status

200

Headers

Total: 2
Per-Page: 10
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 416
ETag: W/"f09915466606dc3798a6f4c799794ae3"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 295e04a9-a930-4521-a373-76d13086948b
X-Runtime: 0.023062

Body

[
  {
    "id": 8,
    "account_id": "straas-dev-test",
    "title": "monetization rule title8",
    "description": null,
    "amount": 57,
    "amount_currency": "TWD",
    "valid_minutes": 66908,
    "monetizable_id": "w5LF7Zvb",
    "monetizable_type": "video"
  },
  {
    "id": 9,
    "account_id": "straas-dev-test",
    "title": "monetization rule title9",
    "description": null,
    "amount": 770,
    "amount_currency": "TWD",
    "valid_minutes": 76835,
    "monetizable_id": "w5LF7Zvb",
    "monetizable_type": "video"
  }
]

Get the Monetization Rule

Get the monetization rules of the monetizable item such as a video or a playlist.

Endpoint

GET /api/v1/app/monetization_rules/:id

Parameters

Name Description Type
id required

Monetization rule id.

Integer

Request

Route

GET /api/v1/app/monetization_rules/12

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEwOCwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc1MX0.xEXoDIymk3P6oif0CykeXwsrZqTkcnZijVcEehto9fg
Content-Type: application/json

Response

Response Fields

Name Description Type
id The monetization rule id. Integer
account_id The id of the account which the resource belongs to. String
description The desciption of this monetization rule. String
monetizable_type The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
monetizable_id The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
title The title of this monetization rule. String
valid_minutes The valid duration of this monetization rule. Integer
amount The price of this monetization rule. Integer
amount_currency The currency of the price (amount). String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 209
ETag: W/"07454eabd207db86d26830ac24bda701"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 33b16674-2402-44ec-88bb-79b7484fd159
X-Runtime: 0.021599

Body

{
  "id": 12,
  "account_id": "straas-dev-test",
  "title": "monetization rule title12",
  "description": null,
  "amount": 955,
  "amount_currency": "TWD",
  "valid_minutes": 61759,
  "monetizable_id": "8kx5ZFnm",
  "monetizable_type": "video"
}

Passcode

Get Passcodes

Get the passcode list of a member.

Endpoint

GET /api/v1/app/passcodes

Parameters

Name Description Type
member_id required

The id of the member who exists in your member system.

String
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer

Request

Route

GET /api/v1/app/passcodes?member_id=cp_member_id

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjExNywiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc2N30.tM_4VN5v9aCFMRfkhv4pYTImbKwc9Fy6JnK6wDdTUgc
Content-Type: application/json

Query Parameters

member_id=cp_member_id

Response

Response Fields

Name Description Type
id The passcode id. String
enabled_at The passcode enabled time. String
passcode_set The passcode set object. Object
["passcode_set"][id] The passcode set id. String
["passcode_set"][account_id] The id of the account which the resource belongs to. String
["passcode_set"][title] The passcode set title. String
["passcode_set"][passcodes_count] The number of passcodes which are contained in the passcode set. Integer
["passcode_set"][used_passcodes_count] The number of passcodes which have been used in the passcode set. Integer
["passcode_set"][created_at] The data created time. String
["passcode_set"][updated_at] The data last updated time. String
monetization_rule The monetization rule. Object
["monetization_rule"][id] The monetization rule id. Integer
["monetization_rule"][account_id] The id of the account which the resource belongs to. String
["monetization_rule"][description] The desciption of this monetization rule. String
["monetization_rule"][monetizable_type] The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
["monetization_rule"][monetizable_id] The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
["monetization_rule"][title] The title of this monetization rule. String
["monetization_rule"][valid_minutes] The valid duration of this monetization rule. Integer
["monetization_rule"][amount] The price of this monetization rule. Integer
["monetization_rule"][amount_currency] The currency of the price (amount). String

Status

200

Headers

Total: 1
Per-Page: 10
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 524
ETag: W/"f3257140fc5ec67ef7738687d4c4570d"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2f02e394-7731-42f8-bfad-54ab49cc14f5
X-Runtime: 0.049453

Body

[
  {
    "id": "N9WEJHMEAJ9Z",
    "enabled_at": "2020-07-09T09:02:47Z",
    "passcode_set": {
      "id": 3,
      "account_id": "straas-dev-test",
      "title": "Fugiat quia autem voluptatem hic ea veniam quia qui.",
      "passcodes_count": 0,
      "used_passcodes_count": 0,
      "created_at": "2020-07-09T09:02:47Z",
      "updated_at": "2020-07-09T09:02:47Z"
    },
    "monetization_rule": {
      "id": 24,
      "account_id": "straas-dev-test",
      "title": "monetization rule title23",
      "description": null,
      "amount": 170,
      "amount_currency": "TWD",
      "valid_minutes": 99723,
      "monetizable_id": "HVaeeoeS",
      "monetizable_type": "video"
    }
  }
]

PasscodeSet

Enable Passcode

Enable a passcode.

Endpoint

PUT /api/v1/app/passcode_sets/enable_passcode

Parameters

Name Description Type
monetizable[id]

The monetizable item id such as a video id, a playlist id, a live id, a video package id or a membership type id.

String
monetizable[type]

The type of monetizable item such as Video or Playlist. {video, playlist, live, video_package, membership_type}

String
monetization_rule_id

The monetization rule id related to the passcode.

Integer
passcode_id required

The passcode id.

String
member_id required

The member who used the passcode.

String

Request

Route

PUT /api/v1/app/passcode_sets/enable_passcode

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjExNiwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc2Nn0.JzfHcLrTj_CKAX9j-F8prBG1keA2iFx7sksn0qUBFg0
Content-Type: application/json

Body

{
  "member_id": "cp_member_id",
  "passcode_id": "VEC4HJYKZMW2",
  "monetizable": {
    "id": "HgJmgB6R",
    "type": "video"
  }
}

Response

Response Fields

Name Description Type
member_id The member who used the passcode. String
passcode_id The passcode which has been used. String

Status

200

Headers

X-Cache-Count: 5
Content-Type: application/json
Content-Length: 57
ETag: W/"ab7d6390e729b6d7c7bf8ddf03bea245"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 68e04464-3f0b-4954-b925-7ac7bb787e46
X-Runtime: 0.136703

Body

{
  "member_id": "cp_member_id",
  "passcode_id": "VEC4HJYKZMW2"
}

Playlist

Get Playlist Details

Get the playlist details

Endpoint

GET /api/v1/app/playlists/:id

Parameters

Name Description Type
id required

The playlist id.

String
includes

Include extra resource details. Allow included resources: {monetization_rules,category,trailer}. For example, includes=monetization_rules,category.

String

Request

Route

GET /api/v1/app/playlists/XMeygsQi?page=1&per_page=5&includes=monetization_rules%2Ccategory%2Ctrailer

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjExOSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc2OH0.ifyH_qsScaQfUWhJVoHdBvg_DZVwIBV1Zt_vCJvB7e8
Content-Type: application/json

Query Parameters

page=1
per_page=5
includes=monetization_rules,category,trailer

Response

Response Fields

Name Description Type
id The playlist id. Integer
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
videos_count The number of videos that the playlist contains. Integer
trailer The video of the playlist trailer. Object
["trailer"][id] The video id. String
["trailer"][account_id] The id of the account which the resource belongs to. String
["trailer"][title] The title. String
["trailer"][synopsis] The synopsis. String
["trailer"][listed] Whether this resource is listed. Boolean
["trailer"][available] Whether this resource is available. Boolean
["trailer"][publish_time] The video publish time in ISO8601 format. String
["trailer"][accomplished] The video transcoding status. Boolean
["trailer"][duration] The duration of the video. Integer
["trailer"][resolution] The resolution of the video. String
["trailer"][live_id] Indicates this video is generated by the live event. String
["trailer"][live_started_at] The starting time of the live streaming. String
["trailer"][live_ended_at] The ending time of the live streaming. String
["trailer"][projection] Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
["trailer"][stream_url] The url of streaming source. String
["trailer"][embed_url] The embed player url. String
["trailer"][poster_url] The large size thumbnail of thumbnail_urls. String
["trailer"][thumbnail_urls] The thumbnail urls. Object
["trailer", "thumbnail_urls"][large] The large size thumbnail. Object
["trailer", "thumbnail_urls", "large"][url] Url of the thumbnail. String
["trailer", "thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["trailer", "thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["trailer", "thumbnail_urls"][medium] The medium size thumbnail. Object
["trailer", "thumbnail_urls", "medium"][url] Url of the thumbnail. String
["trailer", "thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["trailer", "thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["trailer", "thumbnail_urls"][small] The small size thumbnail. Object
["trailer", "thumbnail_urls", "small"][url] Url of the thumbnail. String
["trailer", "thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["trailer", "thumbnail_urls", "small"][height] Height of the thumbnail. Integer
["trailer"][free] Determine if the monetizable item is free or not. Boolean
["trailer"][vip_accessible] Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
["trailer"][owner] The owner of this resource. String
["trailer", "owner"][id] The id of the member who exists in your member system. String
["trailer"][created_at] The data created time. String
["trailer"][updated_at] The data last updated time. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
free Determine if the monetizable item is free or not. Boolean
created_at The data created time. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String
has_monetization_rules Whether there is any monetization rule created from the monetizable item. Boolean
monetization_rules The monetization rules created from this monetizable item. Array
["monetization_rules"][id] The monetization rule id. Integer
["monetization_rules"][account_id] The id of the account which the resource belongs to. String
["monetization_rules"][description] The desciption of this monetization rule. String
["monetization_rules"][monetizable_type] The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
["monetization_rules"][monetizable_id] The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
["monetization_rules"][title] The title of this monetization rule. String
["monetization_rules"][valid_minutes] The valid duration of this monetization rule. Integer
["monetization_rules"][amount] The price of this monetization rule. Integer
["monetization_rules"][amount_currency] The currency of the price (amount). String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 741
ETag: W/"7d21a62ca186cf2a56a8e579207b3b31"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 80da817b-fe50-4ed9-9025-96a5294a6d4d
X-Runtime: 0.046758

Body

{
  "id": "XMeygsQi",
  "account_id": "straas-dev-test",
  "title": "video title4",
  "synopsis": "Ipsum odio in quo laudantium alias architecto sit sunt.",
  "videos_count": 0,
  "embed_url": "https://app-staging.straas.net/straas-dev-test/playlists/XMeygsQi",
  "trailer": null,
  "has_passcode_set": false,
  "available": false,
  "listed": false,
  "category": {
    "id": 184,
    "default": true,
    "name": "Not classified",
    "description": "Default category",
    "videos_count": 0,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 0,
    "parent_id": null,
    "created_at": "2020-07-09T09:02:48Z",
    "updated_at": "2020-07-09T09:02:48Z"
  },
  "monetization_rules": [

  ],
  "has_monetization_rules": false,
  "free": true,
  "poster_url": null,
  "thumbnail_urls": null,
  "created_at": "2020-07-09T09:02:48Z",
  "updated_at": "2020-07-09T09:02:48Z"
}

Get PlaylistItem Details

Get the item list of the playlist

Endpoint

GET /api/v1/app/playlists/:id/playlist_items

Parameters

Name Description Type
id required

The playlist id.

String
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer

Request

Route

GET /api/v1/app/playlists/pPgdtzKw/playlist_items?page=1&per_page=5

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEyMiwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc2OX0.7TT6tNFI60GztdcLUWjPXvy53Nx9YS1PbbDFQUQMTVE
Content-Type: application/json

Query Parameters

page=1
per_page=5

Response

Response Fields

Name Description Type
id The playlist item id. String
account_id The id of the account which the resource belongs to. String
playlist_id The playlist id which the playlist item belongs to. String
video_id The video id of the playlist item. String
position Describe the item order in the list such as a playlist or live playlist. Integer
video The video object. Object
["video"][id] The video id. String
["video"][account_id] The id of the account which the resource belongs to. String
["video"][title] The title. String
["video"][synopsis] The synopsis. String
["video"][listed] Whether this resource is listed. Boolean
["video"][available] Whether this resource is available. Boolean
["video"][publish_time] The video publish time in ISO8601 format. String
["video"][accomplished] The video transcoding status. Boolean
["video"][duration] The duration of the video. Integer
["video"][resolution] The resolution of the video. String
["video"][live_id] Indicates this video is generated by the live event. String
["video"][live_started_at] The starting time of the live streaming. String
["video"][live_ended_at] The ending time of the live streaming. String
["video"][projection] Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
["video"][stream_url] The url of streaming source. String
["video"][embed_url] The embed player url. String
["video"][poster_url] The large size thumbnail of thumbnail_urls. String
["video"][thumbnail_urls] The thumbnail urls. Object
["video", "thumbnail_urls"][large] The large size thumbnail. Object
["video", "thumbnail_urls", "large"][url] Url of the thumbnail. String
["video", "thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["video", "thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["video", "thumbnail_urls"][medium] The medium size thumbnail. Object
["video", "thumbnail_urls", "medium"][url] Url of the thumbnail. String
["video", "thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["video", "thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["video", "thumbnail_urls"][small] The small size thumbnail. Object
["video", "thumbnail_urls", "small"][url] Url of the thumbnail. String
["video", "thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["video", "thumbnail_urls", "small"][height] Height of the thumbnail. Integer
["video"][free] Determine if the monetizable item is free or not. Boolean
["video"][vip_accessible] Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
["video"][owner] The owner of this resource. String
["video", "owner"][id] The id of the member who exists in your member system. String
["video"][created_at] The data created time. String
["video"][updated_at] The data last updated time. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 872
ETag: W/"e92d44b565f7707a9d2e68aef26f990a"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: cdfd5eec-be54-41d8-a2a7-7466202871da
X-Runtime: 0.082421

Body

[
  {
    "id": 8,
    "account_id": "straas-dev-test",
    "playlist_id": "pPgdtzKw",
    "video_id": "zXFh7Utr",
    "position": 1,
    "video": {
      "id": "zXFh7Utr",
      "account_id": "straas-dev-test",
      "title": "Dolorem ullam quisquam sunt quaerat autem illum.",
      "synopsis": "Officiis et qui quis ut autem error sed.",
      "accomplished": true,
      "duration": 9074405,
      "resolution": "_1080p",
      "stream_url": "https://vod-staging.straas.net/test.m3u8",
      "embed_url": "https://app-staging.straas.net/straas-dev-test/videos/zXFh7Utr",
      "live_id": null,
      "available": true,
      "listed": true,
      "projection": "flat",
      "free": true,
      "vip_accessible": true,
      "poster_url": null,
      "thumbnail_urls": null,
      "owner": {
        "id": null
      },
      "storyboard_set": null,
      "text_tracks": [

      ],
      "publish_time": null,
      "live_started_at": null,
      "live_ended_at": null,
      "created_at": "2020-07-09T09:02:49Z",
      "updated_at": "2020-07-09T09:02:49Z"
    },
    "created_at": "2020-07-09T09:02:49Z",
    "updated_at": "2020-07-09T09:02:49Z"
  }
]

Get Playlists

Get playlists.

Endpoint

GET /api/v1/app/playlists

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer
ids

The playlist ids. Filter the item which id is the same one.

String
category_ids

Filter the item which exists in the category. Multiple ids are allowed. For example, category_ids=1,3,5

String
sort

Data sorted by which column {created_at}. Apply - to sort in descending order. For example, sort=-created_at. Apply column name only to sort in ascending order. For example, sort=created_at. You also can use + sign to imply ascending sort order. Note that + sign is an URL reserved character, please encode + to %2B if you compose the URL manually. When you sort data by a column which belongs to its included resource, the resource is included automatically.

String
includes

Include extra resource details. Allow included resources: {category,trailer}. For example, includes=category,trailer.

String
listed

Filter the listed items.

Boolean
available

Filter the available items.

Boolean
contains_passcode_sets

Filter the monetizable item which contains passcode sets.

String

Request

Route

GET /api/v1/app/playlists?page=1&per_page=5&includes=category

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjExOCwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc2OH0.DkeELih4P7IwcBW1qGSUn6AIoKN3I0z-4ZwG5Tfi7mk
Content-Type: application/json

Query Parameters

page=1
per_page=5
includes=category

Response

Response Fields

Name Description Type
id The playlist id. Integer
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
videos_count The number of videos that the playlist contains. Integer
trailer The video of the playlist trailer. Object
["trailer"][id] The video id. String
["trailer"][account_id] The id of the account which the resource belongs to. String
["trailer"][title] The title. String
["trailer"][synopsis] The synopsis. String
["trailer"][listed] Whether this resource is listed. Boolean
["trailer"][available] Whether this resource is available. Boolean
["trailer"][publish_time] The video publish time in ISO8601 format. String
["trailer"][accomplished] The video transcoding status. Boolean
["trailer"][duration] The duration of the video. Integer
["trailer"][resolution] The resolution of the video. String
["trailer"][live_id] Indicates this video is generated by the live event. String
["trailer"][live_started_at] The starting time of the live streaming. String
["trailer"][live_ended_at] The ending time of the live streaming. String
["trailer"][projection] Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
["trailer"][stream_url] The url of streaming source. String
["trailer"][embed_url] The embed player url. String
["trailer"][poster_url] The large size thumbnail of thumbnail_urls. String
["trailer"][thumbnail_urls] The thumbnail urls. Object
["trailer", "thumbnail_urls"][large] The large size thumbnail. Object
["trailer", "thumbnail_urls", "large"][url] Url of the thumbnail. String
["trailer", "thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["trailer", "thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["trailer", "thumbnail_urls"][medium] The medium size thumbnail. Object
["trailer", "thumbnail_urls", "medium"][url] Url of the thumbnail. String
["trailer", "thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["trailer", "thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["trailer", "thumbnail_urls"][small] The small size thumbnail. Object
["trailer", "thumbnail_urls", "small"][url] Url of the thumbnail. String
["trailer", "thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["trailer", "thumbnail_urls", "small"][height] Height of the thumbnail. Integer
["trailer"][free] Determine if the monetizable item is free or not. Boolean
["trailer"][vip_accessible] Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
["trailer"][owner] The owner of this resource. String
["trailer", "owner"][id] The id of the member who exists in your member system. String
["trailer"][created_at] The data created time. String
["trailer"][updated_at] The data last updated time. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
free Determine if the monetizable item is free or not. Boolean
created_at The data created time. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 685
ETag: W/"3617dc14e06fcc4fdbe9aac50d7082b8"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 941e1e5c-e812-4abd-bcae-ca9404450a09
X-Runtime: 0.041749

Body

[
  {
    "id": "DzG4tCTu",
    "account_id": "straas-dev-test",
    "title": "video title3",
    "synopsis": "Iure quasi cumque ratione animi similique voluptates reiciendis in.",
    "videos_count": 0,
    "embed_url": "https://app-staging.straas.net/straas-dev-test/playlists/DzG4tCTu",
    "has_passcode_set": false,
    "available": false,
    "listed": false,
    "category": {
      "id": 183,
      "default": true,
      "name": "Not classified",
      "description": "Default category",
      "videos_count": 0,
      "lives_count": 0,
      "playlists_count": 0,
      "total_count": 0,
      "parent_id": null,
      "created_at": "2020-07-09T09:02:47Z",
      "updated_at": "2020-07-09T09:02:47Z"
    },
    "free": true,
    "poster_url": null,
    "thumbnail_urls": null,
    "created_at": "2020-07-09T09:02:48Z",
    "updated_at": "2020-07-09T09:02:48Z"
  }
]

Update Playlist Details

Update the playlist details.

Endpoint

PUT /api/v1/app/playlists/:id

Parameters

Name Description Type
id required

The playlist id.

String
free

Determine if the monetizable item is free or not.

Boolean

Request

Route

PUT /api/v1/app/playlists/CcFrfeHA

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEyMSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc2OX0.QntwZ8eqdSVUm13v4t8Fuc62V9dqaOeN5DRwdXrfbjU
Content-Type: application/json

Body

{
  "free": false
}

Response

Response Fields

Name Description Type
id The playlist id. Integer
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
videos_count The number of videos that the playlist contains. Integer
trailer The video of the playlist trailer. Object
["trailer"][id] The video id. String
["trailer"][account_id] The id of the account which the resource belongs to. String
["trailer"][title] The title. String
["trailer"][synopsis] The synopsis. String
["trailer"][listed] Whether this resource is listed. Boolean
["trailer"][available] Whether this resource is available. Boolean
["trailer"][publish_time] The video publish time in ISO8601 format. String
["trailer"][accomplished] The video transcoding status. Boolean
["trailer"][duration] The duration of the video. Integer
["trailer"][resolution] The resolution of the video. String
["trailer"][live_id] Indicates this video is generated by the live event. String
["trailer"][live_started_at] The starting time of the live streaming. String
["trailer"][live_ended_at] The ending time of the live streaming. String
["trailer"][projection] Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
["trailer"][stream_url] The url of streaming source. String
["trailer"][embed_url] The embed player url. String
["trailer"][poster_url] The large size thumbnail of thumbnail_urls. String
["trailer"][thumbnail_urls] The thumbnail urls. Object
["trailer", "thumbnail_urls"][large] The large size thumbnail. Object
["trailer", "thumbnail_urls", "large"][url] Url of the thumbnail. String
["trailer", "thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["trailer", "thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["trailer", "thumbnail_urls"][medium] The medium size thumbnail. Object
["trailer", "thumbnail_urls", "medium"][url] Url of the thumbnail. String
["trailer", "thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["trailer", "thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["trailer", "thumbnail_urls"][small] The small size thumbnail. Object
["trailer", "thumbnail_urls", "small"][url] Url of the thumbnail. String
["trailer", "thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["trailer", "thumbnail_urls", "small"][height] Height of the thumbnail. Integer
["trailer"][free] Determine if the monetizable item is free or not. Boolean
["trailer"][vip_accessible] Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
["trailer"][owner] The owner of this resource. String
["trailer", "owner"][id] The id of the member who exists in your member system. String
["trailer"][created_at] The data created time. String
["trailer"][updated_at] The data last updated time. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
free Determine if the monetizable item is free or not. Boolean
created_at The data created time. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String
has_monetization_rules Whether there is any monetization rule created from the monetizable item. Boolean
monetization_rules The monetization rules created from this monetizable item. Array
["monetization_rules"][id] The monetization rule id. Integer
["monetization_rules"][account_id] The id of the account which the resource belongs to. String
["monetization_rules"][description] The desciption of this monetization rule. String
["monetization_rules"][monetizable_type] The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
["monetization_rules"][monetizable_id] The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
["monetization_rules"][title] The title of this monetization rule. String
["monetization_rules"][valid_minutes] The valid duration of this monetization rule. Integer
["monetization_rules"][amount] The price of this monetization rule. Integer
["monetization_rules"][amount_currency] The currency of the price (amount). String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 399
ETag: W/"a626e54e4041a5232d7de5eec580eb2c"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2640ade6-5959-4808-82af-de8c912de42b
X-Runtime: 0.036059

Body

{
  "id": "CcFrfeHA",
  "account_id": "straas-dev-test",
  "title": "video title6",
  "synopsis": "Dolores doloremque dolor delectus.",
  "videos_count": 0,
  "embed_url": "https://app-staging.straas.net/straas-dev-test/playlists/CcFrfeHA",
  "has_passcode_set": false,
  "available": false,
  "listed": false,
  "free": false,
  "poster_url": null,
  "thumbnail_urls": null,
  "created_at": "2020-07-09T09:02:49Z",
  "updated_at": "2020-07-09T09:02:49Z"
}

Stream

Create Stream

Create a stream. The maximum number of streams for a live is 2—a main stream and a backup stream.

Endpoint

POST /api/v1/app/lives/:live_id/streams

Parameters

Name Description Type
live_id required

The live id.

String

Request

Route

POST /api/v1/app/lives/aFKC6Fmq/streams

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjMwLCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzAzfQ.LAwxo0KdLAWzfQwcVbMGfHBl0xlJ7mFyOfnWh53I4Uc
Content-Type: application/json

Response

Response Fields

Name Description Type
id The stream id. String
key The stream key. String
expired_at The expired time of the stream. String
created_at The data created time. String
updated_at The data last updated time. String

Status

201

Headers

X-Cache-Count: 7
Content-Type: application/json
Content-Length: 140
ETag: W/"85f27e5aab56c09039193f82d5844bbb"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: b47b4f2a-9195-4aaa-9a27-84691475eb72
X-Runtime: 0.084952

Body

{
  "id": 10,
  "key": "8ea21abfb6394972a1f62df9222e19d1",
  "expired_at": null,
  "created_at": "2017-08-18T08:22:10Z",
  "updated_at": "2020-07-09T09:01:43Z"
}

Get Streams

Get the stream list. The main stream for a live will be created automatically via the live create action. Therefore, you can distinguish the main stream and the backup stream by created_at field. The created_at date of the main stream will be earlier than the date of the backup stream as described above.

Endpoint

GET /api/v1/app/lives/:live_id/streams

Parameters

Name Description Type
live_id required

The live id.

String

Request

Route

GET /api/v1/app/lives/K2xXTwZp/streams

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjI5LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzAzfQ.Ob8wXKmPV6Ijl-jV_Kbyy4W4HNiAMjR2kIAexoMnyao
Content-Type: application/json

Response

Response Fields

Name Description Type
id The stream id. String
key The stream key. String
expired_at The expired time of the stream. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 281
ETag: W/"3b5e7d9a24ec22d9756e8cd20e89f4a6"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: ed920694-289c-4c4e-ae49-d3345e4d8dd4
X-Runtime: 0.034495

Body

[
  {
    "id": 7,
    "key": "8ea21abfb6394972a1f62df9222e19d1",
    "expired_at": null,
    "created_at": "2017-08-18T08:22:10Z",
    "updated_at": "2020-07-09T09:01:43Z"
  },
  {
    "id": 8,
    "key": "8ea21abfb6394972a1f62df9222e19d1",
    "expired_at": null,
    "created_at": "2017-08-18T08:22:10Z",
    "updated_at": "2020-07-09T09:01:43Z"
  }
]

StreamRelay

Create Stream Relay

Create a stream relay. The maximum number of stream relays for a live is 20. A Stream URL consists of stream server URL and stream key. A stream URL must be used with only one live when the live has been ready or started otherwise the create action will fail. Also, the create action will fail if the live has been ended.

Endpoint

POST /api/v1/app/lives/:live_id/stream_relays

Parameters

Name Description Type
live_id required

The live id.

String
linkage_name required

The name of the stream relay.

String
stream_server_url required

The stream server URL.

String
stream_key required

The stream key.

String
broadcast_url

The URL where you broadcast the live.

String

Request

Route

POST /api/v1/app/lives/ox3Z8Q5Q/stream_relays

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjI2LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzAxfQ.1gMrdY2WYbMstAJn_QoOaxRV73STvv1EXkEcHOUWoas
Content-Type: application/json

Body

{
  "linkage_name": "stream_relay_test",
  "broadcast_url": "http://christiansenklocko.name/lula_auer",
  "stream_server_url": "rtmp://kshlerinmarvin.net/",
  "stream_key": "aleia.bradtke"
}

Response

Response Fields

Name Description Type
id The stream relay id. String
live_id The live id. String
linkage_name The name of the stream relay. String
stream_server_url The stream server URL. String
stream_key The stream key. String
broadcast_url The URL where you broadcast the live. String

Status

201

Headers

X-Cache-Count: 4
Content-Type: application/json
Content-Length: 210
ETag: W/"4f0d17bce56d9a288b4b5fd08d5f530a"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: d30b5972-81e3-4440-97c0-3fabbf8379fa
X-Runtime: 0.058900

Body

{
  "id": "FUU86dDM",
  "live_id": "ox3Z8Q5Q",
  "broadcast_url": "http://christiansenklocko.name/lula_auer",
  "linkage_name": "stream_relay_test",
  "stream_server_url": "rtmp://kshlerinmarvin.net/",
  "stream_key": "aleia.bradtke"
}

Delete Stream Relay

Delete a stream relay.

Endpoint

DELETE /api/v1/app/lives/:live_id/stream_relays/:id

Parameters

Name Description Type
live_id required

The live id.

String
id required

The stream relay id.

String

Request

Route

DELETE /api/v1/app/lives/aS2ATdRx/stream_relays/DEpoFCgn

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjI4LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzAyfQ.e-JVNITN9CZQN08F-m23SuCoCG2fL-q9r2Nix1mA3mY
Content-Type: application/json

Response

Response Fields

Name Description Type
id The stream relay id. String
live_id The live id. String
linkage_name The name of the stream relay. String
stream_server_url The stream server URL. String
stream_key The stream key. String
broadcast_url The URL where you broadcast the live. String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 196
ETag: W/"906a16d374e9f5e1a454c3a4e95497ce"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: c4620ec8-f25c-45b2-9bf9-c339753d2571
X-Runtime: 0.063069

Body

{
  "id": "DEpoFCgn",
  "live_id": "aS2ATdRx",
  "broadcast_url": "http://schultz.info/breana.koch",
  "linkage_name": "maximillia_gutkowski",
  "stream_server_url": "rtmp://lueilwitz.com/",
  "stream_key": "antonietta"
}

Get Stream Relays

Get the stream relay list.

Endpoint

GET /api/v1/app/lives/:live_id/stream_relays

Parameters

Name Description Type
live_id required

The live id.

String

Request

Route

GET /api/v1/app/lives/gV5HYqZS/stream_relays

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjI1LCJhY2NvdW50X2lkIjoic3RyYWFzLWRldi10ZXN0IiwiZXhwIjoxNTk0MzcxNzAwfQ.iRAWLpzxavQgetK6Pl-J9XcFjiUbBAZLuyODnbTYZWM
Content-Type: application/json

Response

Response Fields

Name Description Type
id The stream relay id. String
live_id The live id. String
linkage_name The name of the stream relay. String
stream_server_url The stream server URL. String
stream_key The stream key. String
broadcast_url The URL where you broadcast the live. String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 206
ETag: W/"9cd036f76263ab9af22ad38c3253858b"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 952b06a7-cefe-4b57-b684-da7f34d80809
X-Runtime: 0.034506

Body

[
  {
    "id": "FvBzfvrS",
    "live_id": "gV5HYqZS",
    "broadcast_url": "http://osinski.co/mandy_bernier",
    "linkage_name": "valentine_bogisich",
    "stream_server_url": "rtmp://hermanbaumbach.net/",
    "stream_key": "maritza.windler"
  }
]

Tag

Get Tags

Return a list of tags.

Endpoint

GET /api/v1/app/tags

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer

Request

Route

GET /api/v1/app/tags

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEzMSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc3M30.Jqp2XmDz781EYkoi5l7tARodcXZwbZu_tdIHyYu-jm8
Content-Type: application/json

Response

Response Fields

Name Description Type
id The tag id. Integer
name The tag name. String
description The tag description. String
taggings_count The number of object which are tagged with this tag. Integer

Status

200

Headers

Total: 1
Per-Page: 10
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 117
ETag: W/"7fbe690cba9e3cefc87b7f384330f078"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 60897a2a-d8c1-4053-933b-7eecda9f4cc3
X-Runtime: 0.024382

Body

[
  {
    "id": 5,
    "name": "tag-1",
    "description": "Ea autem et ut recusandae necessitatibus exercitationem.",
    "taggings_count": 0
  }
]

TextTrack

Create Text Track

Create a text track. The maximum of text tracks for a video is 1. The accepted file format are WebVTT and SRT. The text track content must be a Data URI. An example of data URI is “data:text/vtt;base64,data”. The data must consist of a file body encoded as UTF-8 and encoded to base64 string.

Endpoint

POST /api/v1/app/videos/:video_id/text_tracks

Parameters

Name Description Type
video_id required

The video id.

String
content required

The text track content. Must be a Data URI. For example: { “context”: “data:text/vtt;base64," } .

String
language required

The language of the text track. ISO language code format only. language-code = primary-code ( - subcode ). For example: “en”, “en-US” or “zh-TW”.

String
label required

The label of the text track. A user-readable title of the text track.

String

Request

Route

POST /api/v1/app/videos/mqRTd2XT/text_tracks

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE0NiwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc3OH0.TCEBYJgN91IZMxW-_K_UBPElmBipGNR7k1ok6uWVT24
Content-Type: application/json

Body

{
  "content": "data:text/vtt;base64,V0VCVlRUCgowMDAwMDAwMDAgLS0+IDAwOjAwOjA3LjAwMApKb2luIG1lLCBhbmQgdG9nZXRoZXIgd2UgY2FuIHJ1bGUgdGhlIGdhbGF4eS4KCjAwOjAwOjA3LjAwMCAtLT4gMDA6MDA6MTQuMDAwCkkgY291bGQgc2hvdyB5b3UgdGhlIHdheXMgb2YgdGhlIEZvcmNlLg==",
  "language": "en",
  "label": "default text track"
}

Response

Response Fields

Name Description Type
video_id The video id. String
id The text track id. String
url The text track URL. String
language The language of the text track. String
label The label of the text track. A user-readable title of the text track. String
mime_type The mime type of the text track. String
created_at The data created time. String
updated_at The data last updated time. String

Status

201

Headers

X-Cache-Count: 4
Content-Type: application/json
Content-Length: 246
ETag: W/"fc86ffb4015eff60f777041016b0bbde"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 7fb62bf1-567a-4880-bca4-96ffd53a7302
X-Runtime: 0.521738

Body

{
  "video_id": "mqRTd2XT",
  "id": "CFMHmKj8",
  "url": "http://example.com1d288e11-613b-4def-9ce5-8e955f477753.vtt",
  "language": "en",
  "label": "default text track",
  "mime_type": "text/vtt",
  "created_at": "2020-07-09T09:02:58Z",
  "updated_at": "2020-07-09T09:02:58Z"
}

Delete Text Track

Delete a text track.

Endpoint

DELETE /api/v1/app/videos/:video_id/text_tracks/:id

Parameters

Name Description Type
video_id required

The video id.

String
id required

The text track id.

String

Request

Route

DELETE /api/v1/app/videos/HXmokxTs/text_tracks/LDGNnE8R

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE1NCwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4M30.Fu4CFPx5SOHUHHBBQqj3B0BRMbCbPPfaZIiHG3L44h8
Content-Type: application/json

Response

Response Fields

Name Description Type
video_id The video id. String
id The text track id. String
url The text track URL. String
language The language of the text track. String
label The label of the text track. A user-readable title of the text track. String
mime_type The mime type of the text track. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 4
Content-Type: application/json
Content-Length: 213
ETag: W/"068675e07565a41978638a436a188740"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: e1b4e6bb-89e7-4ea5-8bd1-a0c10c907f73
X-Runtime: 0.051212

Body

{
  "video_id": "HXmokxTs",
  "id": "LDGNnE8R",
  "url": "http://example.com/foobar.vtt",
  "language": "en",
  "label": "Brooklyn Black",
  "mime_type": "text/vtt",
  "created_at": "2020-07-09T09:03:03Z",
  "updated_at": "2020-07-09T09:03:03Z"
}

Get Text Tracks

Get the text track list.

Endpoint

GET /api/v1/app/videos/:video_id/text_tracks

Parameters

Name Description Type
video_id required

The video id.

String

Request

Route

GET /api/v1/app/videos/vv4NR739/text_tracks

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE0NSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc3OH0.mF6A0_uIg4E3fkLSTlhOTzlFT9EbATl_c05T9LYTR6g
Content-Type: application/json

Response

Response Fields

Name Description Type
video_id The video id. String
id The text track id. String
url The text track URL. String
language The language of the text track. String
label The label of the text track. A user-readable title of the text track. String
mime_type The mime type of the text track. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 224
ETag: W/"ec509f0147fad5dc6db864067d8ac92b"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 3f98daea-955e-4fc5-9809-55e8838bbca0
X-Runtime: 0.038251

Body

[
  {
    "video_id": "vv4NR739",
    "id": "mDAg2s4z",
    "url": "http://example.com/foobar.vtt",
    "language": "en",
    "label": "Trappistes Rochefort 10",
    "mime_type": "text/vtt",
    "created_at": "2020-07-09T09:02:58Z",
    "updated_at": "2020-07-09T09:02:58Z"
  }
]

Update Text Track

Update a text track.

Endpoint

PUT /api/v1/app/videos/:video_id/text_tracks/:id

Parameters

Name Description Type
video_id required

The video id.

String
id required

The text track id.

String

Request

Route

PUT /api/v1/app/videos/7tecPGyF/text_tracks/ZjAumZcS

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE1MywiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4Mn0.Y99UN9m7gUrf6hn7etHCeG42X2LyWIIKSzMaNjFoxnk
Content-Type: application/json

Body

{
  "content": "data:text/vtt;base64,V0VCVlRUCgowMDowMDowMC4wMDAgLS0+IDAwOjAwOjA3LjAwMApKb2luIG1lLCBhbmQgdG9nZXRoZXIgd2UgY2FuIHJ1bGUgdGhlIGdhbGF4eS4KCjAwOjAwOjA3LjAwMCAtLT4gMDA6MDA6MTQuMDAwCkkgY291bGQgc2hvdyB5b3UgdGhlIHdheXMgb2YgdGhlIEZvcmNlLgoKMDA6MDA6MTQuMDAwIC0tPiAwMDowMDoyMS4wMDAKWW91IHdlcmUgdGhlIGNob3NlbiBvbmUhIEl0IHdhcyBzYWlkIHRoYXQgeW91IHdvdWxkIGRlc3Ryb3kgdGhlIFNpdGgsIG5vdCBqb2luIHRoZW0uCgowMDowMDoyMS4wMDAgLS0+IDAwOjAwOjI4LjAwMApJIGFtIHlvdXIgRmF0aGVyLgoKMDA6MDA6MjguMDAwIC0tPiAwMDowMDozNS4wMDAKTWF5IHRoZSBGb3JjZSBiZSB3aXRoIHlvdS4=",
  "language": "zh-TW",
  "label": "new-label"
}

Response

Response Fields

Name Description Type
video_id The video id. String
id The text track id. String
url The text track URL. String
language The language of the text track. String
label The label of the text track. A user-readable title of the text track. String
mime_type The mime type of the text track. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 4
Content-Type: application/json
Content-Length: 211
ETag: W/"43bed468f564c497889add0e32b31d2e"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2ebf5a14-440f-4429-9978-c020327359ea
X-Runtime: 0.418186

Body

{
  "video_id": "7tecPGyF",
  "id": "ZjAumZcS",
  "url": "http://example.com/foobar.vtt",
  "language": "zh-TW",
  "label": "new-label",
  "mime_type": "text/vtt",
  "created_at": "2020-07-09T09:03:02Z",
  "updated_at": "2020-07-09T09:03:02Z"
}

Video

Create Video Ingestion

Create content ingestion of new video.

Endpoint

POST /api/v1/app/videos/ingestions

Parameters

Name Description Type
content_type required

Specifies the content type for ingestion, support {video/mp4,video/avi,video/quicktime,audio/mp3,audio/mpeg}.

String
profile required

The profile of the video. The system defined standard profile: {1080p}.

String
video[title] required

The title of the resource. Currently, emoji is not supported.

String
video[projection]

Specifies the projection format of the media. {flat,equirectangular} Set equirectangular type to play a full 360 degree panorama media. Default value: flat.

String

Request

Route

POST /api/v1/app/videos/ingestions

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE0MiwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc3Nn0.6NObNNGTpvOd6n7GaB7_it4ql2tkK2FzO7wQ4V7qpmg
Content-Type: application/json

Body

{
  "content_type": "audio/mpeg",
  "video": {
    "title": "Minima veniam illum corrupti et necessitatibus.",
    "projection": "flat"
  },
  "profile": "1080p"
}

Response

Response Fields

Name Description Type
account_id The id of the account which the resource belongs to. String
status The ingestion status. {feeding,transcoding,completed,terminated} String
progress_percent The progress of video uploading. String
error The error message if any exception occurred while video uploading. String
video_id The video which the ingestion belongs to. String
content_type The content type specified for ingestion. {video/mp4, video/avi, video/quicktime, audio/mp3, audio/mpeg} String
highest_resolution The highest resolution specified for video. {_360p, _720p, _1080p} String
profile The profile specified for video. String
upload_url The url to upload (HTTP PUT) video, only available in feeding status String
expired_at The expiration time for the upload_url in ISO8601 format. String
created_at The data created time. String
updated_at The data last updated time. String

Status

201

Headers

X-Cache-Count: 13
Content-Type: application/json
Content-Length: 891
ETag: W/"b36f232d1548104fe58eebe5c349e825"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 50122683-1e5c-495d-85ea-fbd0edf07b97
X-Runtime: 0.244790

Body

{
  "account_id": "straas-dev-test",
  "status": "feeding",
  "progress_percent": "0%",
  "error": null,
  "video_id": "v5fHJNAx",
  "content_type": "audio/mpeg",
  "highest_resolution": null,
  "profile": "1080p",
  "upload_url": "https://storage.googleapis.com/straasio-vod-raw-staging-as/straas-dev-test/201706241705_v5fHJNAx?GoogleAccessId=straas-staging-dev%40straasio-staging.iam.gserviceaccount.com&Expires=1498410306&Signature=fz2ZHT9C21o3CJ1Orfo8HHssrgTPj4kRzeyiebtz%2FtsATd91uizQYBSE6rK4kgDsFazc1HklE6IfNf%2Fdj6wKdU8JZXCS6Ag%2BtexML7AHdBVMMt71hcn1HaBgSJZ%2FDc%2BaDSZJde9g9wwZ2p598UQvzks9sO%2B7MvtywMq4xf%2FtEof2r%2B4%2FVo7xABJnr20G62MPew6jPJC6c1wY6kI7%2BZfW6pm0UDaDwqEmh9UViZFp6WbXPYRrpu3ofpe2ErtD%2FhoEIZ6fI16mBXzPSKYeXlOsTYnKM98SmNMrs2YJ29bAYxaWuU5xbt7x0SjO81DulAaTVGPI5QSYfC1%2BOPL6OQOZsA%3D%3D",
  "expired_at": "2017-06-25T17:05:06Z",
  "created_at": "2017-06-24T17:05:06Z",
  "updated_at": "2017-06-24T17:05:06Z"
}

Delete Video

Delete the video.

Endpoint

DELETE /api/v1/app/videos/:id

Parameters

Name Description Type
id required

The video id.

String

Request

Route

DELETE /api/v1/app/videos/aZcwCsEx

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE3NywiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc5Nn0.cqz1iciURrQ4CblgJIN7nT2czTGbWqJVQjRGd7vmZWY
Content-Type: application/json

Response

Response Fields

Name Description Type
id The video id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
publish_time The video publish time in ISO8601 format. String
accomplished The video transcoding status. Boolean
duration The duration of the video. Integer
resolution The resolution of the video. String
live_id Indicates this video is generated by the live event. String
live_started_at The starting time of the live streaming. String
live_ended_at The ending time of the live streaming. String
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
stream_url The url of streaming source. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
free Determine if the monetizable item is free or not. Boolean
vip_accessible Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 7
Content-Type: application/json
Content-Length: 656
ETag: W/"fbe5a6a1ad735f9f390da74cd32233a0"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 5e20093f-cdc9-4802-a3b0-7b44ec22a403
X-Runtime: 0.124301

Body

{
  "id": "aZcwCsEx",
  "account_id": "straas-dev-test",
  "title": "Quo tenetur ut ducimus omnis in pariatur.",
  "synopsis": "Dolor sit aperiam repellendus omnis minus vero in.",
  "accomplished": true,
  "duration": 2768169,
  "resolution": "_1080p",
  "stream_url": "https://vod-staging.straas.net/test.m3u8",
  "embed_url": "https://app-staging.straas.net/straas-dev-test/videos/aZcwCsEx",
  "live_id": null,
  "available": true,
  "listed": true,
  "projection": "flat",
  "free": true,
  "vip_accessible": true,
  "poster_url": null,
  "thumbnail_urls": null,
  "storyboard_set": null,
  "publish_time": null,
  "live_started_at": null,
  "live_ended_at": null,
  "created_at": "2020-07-09T09:03:16Z",
  "updated_at": "2020-07-09T09:03:16Z"
}

Get Searched Videos

Get the video list of search result.

Endpoint

GET /api/v1/app/videos/search

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer
category_ids

Filter the item which exists in the category. Multiple ids are allowed. For example, category_ids=1,3,5

String
owner[member_id]

Filter the item which is owned by the member registered in your member system.

String
listed

Filter the listed items.

Boolean
search_query required

Data search in these {title,tag.name} columns. You can use multiple terms at a search. Terms have to be separated by whitespace. The search result would return only items that contains all of the query terms. For example: “straas awesome” would return only items that match straas AND awesome.

String
includes

Include extra resource details. Allow included resources: {category,metadata,statistic_summary,owner}. For example, includes=category,metadata.

String

Request

Route

GET /api/v1/app/videos/search?page=1&per_page=5&owner[member_id]=cp_member_id&category_ids=251&search_query=default+title&includes=category%2Cowner%2Cstatistic_summary

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE3OSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc5Nn0.Nl2ra4oAqbjLkdEAhEcorNAzCafrLb7TK1jIiyP0ITM
Content-Type: application/json

Query Parameters

page=1
per_page=5
owner={"member_id"=>"cp_member_id"}
category_ids=251
search_query=default title
includes=category,owner,statistic_summary

Response

Response Fields

Name Description Type
id The video id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
publish_time The video publish time in ISO8601 format. String
accomplished The video transcoding status. Boolean
duration The duration of the video. Integer
resolution The resolution of the video. String
live_id Indicates this video is generated by the live event. String
live_started_at The starting time of the live streaming. String
live_ended_at The ending time of the live streaming. String
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
stream_url The url of streaming source. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
free Determine if the monetizable item is free or not. Boolean
vip_accessible Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String
metadata The extra description of video. Object
["metadata"][id] The metadata id. Integer
["metadata"][author] The author of the video. String
["metadata"][location] The location of the video. String
["metadata"][language] The language of the video. String
["metadata"][video_id] The video id. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String
tag The tag. Object
["tag"][id] The tag id. Integer
["tag"][name] The tag name. String
["tag"][description] The tag description. String
["tag"][taggings_count] The number of object which are tagged with this tag. Integer
["statistic_summary"][views_count_sum] (Deprecated) Please use play_count_sum. Integer
["statistic_summary"][viewers_count_sum] (Deprecated) Not supported anymore. Integer
["statistic_summary"][time_watched_sum] (Deprecated) Please use play_duration_sum. Integer
["statistic_summary"][play_count_sum] The sum of number of times the media (Live or VOD) played. Integer
["statistic_summary"][play_duration_sum] The sum of play duration of the media (Live or VOD) in seconds. Integer
["statistic_summary"][hit_count_sum] The sum of number of times the media (Live or VOD) hit. Integer
["statistic_summary"][hit_count_sum_with_base] The sum of hit_count_sum and base_hit_count. Integer
["statistic_summary"][base_play_count] The play count inherited from related media. Integer
["statistic_summary"][base_play_duration] The play duration inherited from related media. Integer
["statistic_summary"][base_hit_count] The hit count inherited from related media. Integer
["statistic_summary"][updated_at] The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 1179
ETag: W/"ea4cc399e81f68fe2dafc98acbf168fc"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 740d77c7-b4ea-488e-a6ce-ca4852b8bfb3
X-Runtime: 0.049652

Body

[
  {
    "id": "PtAwP9iX",
    "account_id": "straas-dev-test",
    "title": "default title",
    "synopsis": "Delectus nihil vero ut autem.",
    "accomplished": true,
    "duration": 2525516,
    "resolution": "_1080p",
    "stream_url": "https://vod-staging.straas.net/test.m3u8",
    "embed_url": "https://app-staging.straas.net/straas-dev-test/videos/PtAwP9iX",
    "live_id": null,
    "available": true,
    "listed": true,
    "projection": "flat",
    "category": {
      "id": 251,
      "default": false,
      "name": "category-245",
      "description": "Recusandae soluta unde rerum omnis.",
      "videos_count": 1,
      "lives_count": 0,
      "playlists_count": 0,
      "total_count": 1,
      "parent_id": null,
      "created_at": "2020-07-09T09:03:16Z",
      "updated_at": "2020-07-09T09:03:16Z"
    },
    "free": true,
    "vip_accessible": true,
    "poster_url": null,
    "thumbnail_urls": null,
    "owner": {
      "id": "cp_member_id"
    },
    "statistic_summary": {
      "views_count_sum": 0,
      "viewers_count_sum": 0,
      "time_watched_sum": 0,
      "play_count_sum": 0,
      "play_duration_sum": 0,
      "hit_count_sum": 0,
      "base_play_count": 0,
      "base_play_duration": 0,
      "base_hit_count": 0,
      "hit_count_sum_with_base": 0,
      "updated_at": "2020-07-09T09:03:16Z"
    },
    "storyboard_set": null,
    "publish_time": null,
    "live_started_at": null,
    "live_ended_at": null,
    "created_at": "2020-07-09T09:03:16Z",
    "updated_at": "2020-07-09T09:03:16Z"
  }
]

Get Video Details

Get the video details.

Endpoint

GET /api/v1/app/videos/:id

Parameters

Name Description Type
id required

The video id.

String
includes

Include extra resource details. Allow included resources: {monetization_rules,category,metadata,tags,statistic_summary,owner}. For example, includes=monetization_rules,category.

String

Request

Route

GET /api/v1/app/videos/Eurqtven?includes=monetization_rules%2Ccategory

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE2OSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc5Mn0.WyMZ9VD5LH0VPixojrm_ELLzXrHukv1usZd0IjQukDY
Content-Type: application/json

Query Parameters

includes=monetization_rules,category

Response

Response Fields

Name Description Type
id The video id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
publish_time The video publish time in ISO8601 format. String
accomplished The video transcoding status. Boolean
duration The duration of the video. Integer
resolution The resolution of the video. String
live_id Indicates this video is generated by the live event. String
live_started_at The starting time of the live streaming. String
live_ended_at The ending time of the live streaming. String
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
stream_url The url of streaming source. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
free Determine if the monetizable item is free or not. Boolean
vip_accessible Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String
metadata The extra description of video. Object
["metadata"][id] The metadata id. Integer
["metadata"][author] The author of the video. String
["metadata"][location] The location of the video. String
["metadata"][language] The language of the video. String
["metadata"][video_id] The video id. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String
tag The tag. Object
["tag"][id] The tag id. Integer
["tag"][name] The tag name. String
["tag"][description] The tag description. String
["tag"][taggings_count] The number of object which are tagged with this tag. Integer
has_monetization_rules Whether there is any monetization rule created from the monetizable item. Boolean
monetization_rules The monetization rules created from this monetizable item. Array
["monetization_rules"][id] The monetization rule id. Integer
["monetization_rules"][account_id] The id of the account which the resource belongs to. String
["monetization_rules"][description] The desciption of this monetization rule. String
["monetization_rules"][monetizable_type] The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
["monetization_rules"][monetizable_id] The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
["monetization_rules"][title] The title of this monetization rule. String
["monetization_rules"][valid_minutes] The valid duration of this monetization rule. Integer
["monetization_rules"][amount] The price of this monetization rule. Integer
["monetization_rules"][amount_currency] The currency of the price (amount). String
["statistic_summary"][views_count_sum] (Deprecated) Please use play_count_sum. Integer
["statistic_summary"][viewers_count_sum] (Deprecated) Not supported anymore. Integer
["statistic_summary"][time_watched_sum] (Deprecated) Please use play_duration_sum. Integer
["statistic_summary"][play_count_sum] The sum of number of times the media (Live or VOD) played. Integer
["statistic_summary"][play_duration_sum] The sum of play duration of the media (Live or VOD) in seconds. Integer
["statistic_summary"][hit_count_sum] The sum of number of times the media (Live or VOD) hit. Integer
["statistic_summary"][hit_count_sum_with_base] The sum of hit_count_sum and base_hit_count. Integer
["statistic_summary"][base_play_count] The play count inherited from related media. Integer
["statistic_summary"][base_play_duration] The play duration inherited from related media. Integer
["statistic_summary"][base_hit_count] The hit count inherited from related media. Integer
["statistic_summary"][updated_at] The data last updated time. String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 970
ETag: W/"02d1f9e5580d54d2369b26e94ea802e2"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: e7d6904f-598f-4644-80cc-29948ee5bc67
X-Runtime: 0.035641

Body

{
  "id": "Eurqtven",
  "account_id": "straas-dev-test",
  "title": "Quo et itaque ut sint aliquam doloremque est.",
  "synopsis": "Et eum omnis cupiditate voluptatum voluptatem quidem.",
  "accomplished": true,
  "duration": 9850019,
  "resolution": "_1080p",
  "stream_url": "https://vod-staging.straas.net/test.m3u8",
  "embed_url": "https://app-staging.straas.net/straas-dev-test/videos/Eurqtven",
  "live_id": null,
  "available": true,
  "listed": true,
  "projection": "flat",
  "category": {
    "id": 235,
    "default": true,
    "name": "Not classified",
    "description": "Default category",
    "videos_count": 0,
    "lives_count": 0,
    "playlists_count": 0,
    "total_count": 0,
    "parent_id": null,
    "created_at": "2020-07-09T09:03:12Z",
    "updated_at": "2020-07-09T09:03:12Z"
  },
  "monetization_rules": [

  ],
  "has_monetization_rules": false,
  "free": true,
  "vip_accessible": true,
  "poster_url": null,
  "thumbnail_urls": null,
  "storyboard_set": null,
  "publish_time": null,
  "live_started_at": null,
  "live_ended_at": null,
  "created_at": "2020-07-09T09:03:12Z",
  "updated_at": "2020-07-09T09:03:12Z"
}

Get Video Download Urls

Get download urls of the video.

Endpoint

GET /api/v1/app/videos/:id/download_urls

Parameters

Name Description Type
id required

The video id.

String

Request

Route

GET /api/v1/app/videos/6bzBCgWP/download_urls

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEzOCwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc3NX0.1wG7ofEvb3L2G_FRrvqOBeDZGnWrCLOFXq_6aMMesW0
Content-Type: application/json

Response

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 722
ETag: W/"a939e8d761b8100d868c544042edcb4c"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 3255a4c6-b074-4a3f-af84-e2098e8c6dae
X-Runtime: 0.022912

Body

[
  {
    "name": "source",
    "url": "https://vod.straas.net/straas-dev-test/vr4uCwdY/6pgukpdnn48wipb9/1489981887cpsl50mef561or/compressed/source/201703200351_vr4uCwdY",
    "width": 1280,
    "height": 720
  },
  {
    "name": "1280x720",
    "url": "https://vod.straas.net/straas-dev-test/vr4uCwdY/6pgukpdnn48wipb9/1489981887cpsl50mef561or/compressed/720p/1489981887record.mp4",
    "width": 1280,
    "height": 720
  },
  {
    "name": "640x360",
    "url": "https://vod.straas.net/straas-dev-test/vr4uCwdY/6pgukpdnn48wipb9/1489981887cpsl50mef561or/compressed/360p/1489981887record.mp4",
    "width": 640,
    "height": 360
  },
  {
    "name": "426x240",
    "url": "https://vod.straas.net/straas-dev-test/vr4uCwdY/6pgukpdnn48wipb9/1489981887cpsl50mef561or/compressed/240p/1489981887record.mp4",
    "width": 426,
    "height": 240
  }
]

Get Video Ingestion

Get content ingestion of the video.

Endpoint

GET /api/v1/app/videos/:id/ingestion

Parameters

Name Description Type
id required

The video id.

String

Request

Route

GET /api/v1/app/videos/A7FASxgR/ingestion

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjEzOSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc3NX0.lteuOsyYWBJL31gq2AURhT0rZ_c7JVZlgt7u0AJziBo
Content-Type: application/json

Response

Response Fields

Name Description Type
account_id The id of the account which the resource belongs to. String
status The ingestion status. {feeding,transcoding,completed,terminated} String
progress_percent The progress of video uploading. String
error The error message if any exception occurred while video uploading. String
video_id The video which the ingestion belongs to. String
content_type The content type specified for ingestion. {video/mp4, video/avi, video/quicktime, audio/mp3, audio/mpeg} String
highest_resolution The highest resolution specified for video. {_360p, _720p, _1080p} String
profile The profile specified for video. String
upload_url The url to upload (HTTP PUT) video, only available in feeding status String
expired_at The expiration time for the upload_url in ISO8601 format. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 350
ETag: W/"639938be4332b0b3572bdf3b6a549b16"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: f7891b74-1888-454a-b2cc-9a93b13ee93f
X-Runtime: 0.023329

Body

{
  "account_id": "straas-dev-test",
  "status": "feeding",
  "progress_percent": "0%",
  "error": null,
  "video_id": "A7FASxgR",
  "content_type": "audio/mpeg",
  "highest_resolution": "_1080p",
  "profile": "1080p",
  "upload_url": "http://vandervortorn.io/waino_mccullough",
  "expired_at": "2020-07-10T09:02:55Z",
  "created_at": "2020-07-09T09:02:55Z",
  "updated_at": "2020-07-09T09:02:56Z"
}

Get Videos

Get the video list.

Endpoint

GET /api/v1/app/videos

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer
ids

The video ids. Filter the item which id is the same one.

String
category_ids

Filter the item which exists in the category. Multiple ids are allowed. For example, category_ids=1,3,5

String
tags

Filter the item which are tagged with the tags. Multiple tags are allowed. For example, tags=sport,game

String
ad_tag_ids

Filter the item related to the ad tag. Multiple ids are allowed. For example, ad_tags=1,2

String
owner[member_id]

Filter the item which is owned by the member registered in your member system.

String
sort

Data sorted by which column {created_at,updated_at,statistic_summary.hit_count_sum,statistic_summary.hit_count_sum_with_base,publish_time}. Apply - to sort in descending order. For example, sort=-created_at. Apply column name only to sort in ascending order. For example, sort=created_at. You also can use + sign to imply ascending sort order. Note that + sign is an URL reserved character, please encode + to %2B if you compose the URL manually. When you sort data by a column which belongs to its included resource, the resource is included automatically.

String
includes

Include extra resource details. Allow included resources: {category,metadata,tags,statistic_summary,owner}. For example, includes=category,metadata.

String
listed

Filter the listed items.

Boolean
available

Filter the available items.

Boolean
contains_passcode_sets

Filter the monetizable item which contains passcode sets.

String
type

Choose video generated type. {live_record,uploaded}

String

Request

Route

GET /api/v1/app/videos?page=1&per_page=5&includes=category&sort=statistic_summary.hit_count_sum

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE2NSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4N30.3sGRo8wcRRmcUkmXZMeUp6nbS7vhIafYlkcOC4oRWgM
Content-Type: application/json

Query Parameters

page=1
per_page=5
includes=category
sort=statistic_summary.hit_count_sum

Response

Response Fields

Name Description Type
id The video id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
publish_time The video publish time in ISO8601 format. String
accomplished The video transcoding status. Boolean
duration The duration of the video. Integer
resolution The resolution of the video. String
live_id Indicates this video is generated by the live event. String
live_started_at The starting time of the live streaming. String
live_ended_at The ending time of the live streaming. String
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
stream_url The url of streaming source. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
free Determine if the monetizable item is free or not. Boolean
vip_accessible Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String
metadata The extra description of video. Object
["metadata"][id] The metadata id. Integer
["metadata"][author] The author of the video. String
["metadata"][location] The location of the video. String
["metadata"][language] The language of the video. String
["metadata"][video_id] The video id. String
updated_at The data last updated time. String
category The category. Object
["category"][id] The category id. Integer
["category"][default] This category is a default category if this field is true. Every account has a default category. Boolean
["category"][name] The category name. String
["category"][description] The category description. String
["category"][videos_count] The number of videos which are contained in the category. Integer
["category"][lives_count] The number of lives which are contained in the category. Integer
["category"][parent_id] The id of the category which contains this category. If this category has no parent_id, then it is not a subcategory. Integer
["category"][created_at] The data created time. String
["category"][updated_at] The data last updated time. String
tag The tag. Object
["tag"][id] The tag id. Integer
["tag"][name] The tag name. String
["tag"][description] The tag description. String
["tag"][taggings_count] The number of object which are tagged with this tag. Integer
["statistic_summary"][views_count_sum] (Deprecated) Please use play_count_sum. Integer
["statistic_summary"][viewers_count_sum] (Deprecated) Not supported anymore. Integer
["statistic_summary"][time_watched_sum] (Deprecated) Please use play_duration_sum. Integer
["statistic_summary"][play_count_sum] The sum of number of times the media (Live or VOD) played. Integer
["statistic_summary"][play_duration_sum] The sum of play duration of the media (Live or VOD) in seconds. Integer
["statistic_summary"][hit_count_sum] The sum of number of times the media (Live or VOD) hit. Integer
["statistic_summary"][hit_count_sum_with_base] The sum of hit_count_sum and base_hit_count. Integer
["statistic_summary"][base_play_count] The play count inherited from related media. Integer
["statistic_summary"][base_play_duration] The play duration inherited from related media. Integer
["statistic_summary"][base_hit_count] The hit count inherited from related media. Integer
["statistic_summary"][updated_at] The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 1196
ETag: W/"25954fa3269a2725bc6a109188664112"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 4f2a440c-c59c-4a08-8701-76ad8525bc00
X-Runtime: 0.031753

Body

[
  {
    "id": "dhuWtWy2",
    "account_id": "straas-dev-test",
    "title": "Hic repudiandae quod consequuntur modi amet quos excepturi.",
    "synopsis": "Deleniti odio est quidem iste doloribus tempora.",
    "accomplished": true,
    "duration": 7864770,
    "resolution": "_1080p",
    "stream_url": "https://vod-staging.straas.net/test.m3u8",
    "embed_url": "https://app-staging.straas.net/straas-dev-test/videos/dhuWtWy2",
    "live_id": null,
    "available": true,
    "listed": true,
    "projection": "flat",
    "category": {
      "id": 231,
      "default": true,
      "name": "Not classified",
      "description": "Default category",
      "videos_count": 0,
      "lives_count": 0,
      "playlists_count": 0,
      "total_count": 0,
      "parent_id": null,
      "created_at": "2020-07-09T09:03:07Z",
      "updated_at": "2020-07-09T09:03:07Z"
    },
    "free": true,
    "vip_accessible": true,
    "poster_url": null,
    "thumbnail_urls": null,
    "statistic_summary": {
      "views_count_sum": 0,
      "viewers_count_sum": 0,
      "time_watched_sum": 0,
      "play_count_sum": 0,
      "play_duration_sum": 0,
      "hit_count_sum": 0,
      "base_play_count": 0,
      "base_play_duration": 0,
      "base_hit_count": 0,
      "hit_count_sum_with_base": 0,
      "updated_at": "2020-07-09T09:03:07Z"
    },
    "storyboard_set": null,
    "publish_time": null,
    "live_started_at": null,
    "live_ended_at": null,
    "created_at": "2020-07-09T09:03:07Z",
    "updated_at": "2020-07-09T09:03:07Z"
  }
]

Transcode Video Ingestion

Start transcode content of the video.

Endpoint

PUT /api/v1/app/videos/:id/ingestion/transcode

Parameters

Name Description Type
id required

The video id.

String

Request

Route

PUT /api/v1/app/videos/m2t8jsX3/ingestion/transcode

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE0MSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc3Nn0.yWdR4A7eUO8RdcSXX0RCuLiUyGK1jmGbRJojD4mY4os
Content-Type: application/json

Response

Response Fields

Name Description Type
account_id The id of the account which the resource belongs to. String
status The ingestion status. {feeding,transcoding,completed,terminated} String
progress_percent The progress of video uploading. String
error The error message if any exception occurred while video uploading. String
video_id The video which the ingestion belongs to. String
content_type The content type specified for ingestion. {video/mp4, video/avi, video/quicktime, audio/mp3, audio/mpeg} String
highest_resolution The highest resolution specified for video. {_360p, _720p, _1080p} String
profile The profile specified for video. String
upload_url The url to upload (HTTP PUT) video, only available in feeding status String
expired_at The expiration time for the upload_url in ISO8601 format. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 4
Content-Type: application/json
Content-Length: 321
ETag: W/"7935dcd24f18806b1b3b040cac85ba72"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 95b08d9b-7397-46cb-9fe7-cd1f678ff2dd
X-Runtime: 0.047730

Body

{
  "account_id": "straas-dev-test",
  "status": "transcoding",
  "progress_percent": "0%",
  "error": null,
  "video_id": "m2t8jsX3",
  "content_type": "video/quicktime",
  "highest_resolution": "_1080p",
  "profile": "1080p",
  "upload_url": null,
  "expired_at": "2020-07-10T09:02:56Z",
  "created_at": "2020-07-09T09:02:56Z",
  "updated_at": "2020-07-09T09:02:56Z"
}

Update Video Details

Update the video details.

Endpoint

PUT /api/v1/app/videos/:id

Parameters

Name Description Type
id required

The video id.

String
title

The title of the resource. Currently, emoji is not supported.

String
listed

Whether to list the item.

Boolean
available

Whether the item is available by users.

Boolean
category

The category object (i.e. category: { id: }.) which the resource belongs to.

Object
category[id]

The category id.

Integer
tags

The array of tag objects (i.e. tags: [ { name: } ]) which the resource is tagged with.

Array[Object]
tags[name]

The name of the tag.

String
vip_accessible

Whether to allow membership vip permission. When the value is false, a member can not access this monetizable item via having membership vip permission. Default value: true.

Boolean
synopsis

The synopsis of the resource.

String
free

Determine if the monetizable item is free or not.

Boolean
publish_time

The video publish time in ISO8601 format.

String
owner

The member who owns this resource.

Object
owner[member_id]

The member id.

String

Request

Route

PUT /api/v1/app/videos/xmwtLKwb

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE3MiwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc5M30.8GQBcuWHVTRxFvmb-9ALYkuV7ma242JdQVZXiw7CRF0
Content-Type: application/json

Body

{
  "title": "new title",
  "listed": true,
  "available": true,
  "category": {
    "id": 239
  },
  "tags": [
    {
      "name": "tag1"
    },
    {
      "name": "tag2"
    }
  ],
  "free": false,
  "owner": {
    "member_id": "cp_member_id"
  }
}

Response

Response Fields

Name Description Type
id The video id. String
account_id The id of the account which the resource belongs to. String
title The title. String
synopsis The synopsis. String
listed Whether this resource is listed. Boolean
available Whether this resource is available. Boolean
publish_time The video publish time in ISO8601 format. String
accomplished The video transcoding status. Boolean
duration The duration of the video. Integer
resolution The resolution of the video. String
live_id Indicates this video is generated by the live event. String
live_started_at The starting time of the live streaming. String
live_ended_at The ending time of the live streaming. String
projection Indicate projection format of the media source. {none,flat,equirectangular} "none" type represents to play an audio-only media file. "flat" type represents to play a flat projection video. "equirectangular" type represents to play a 360 panorama video. String
stream_url The url of streaming source. String
embed_url The embed player url. String
poster_url The large size thumbnail of thumbnail_urls. String
thumbnail_urls The thumbnail urls. Object
["thumbnail_urls"][large] The large size thumbnail. Object
["thumbnail_urls", "large"][url] Url of the thumbnail. String
["thumbnail_urls", "large"][width] Width of the thumbnail. Integer
["thumbnail_urls", "large"][height] Height of the thumbnail. Integer
["thumbnail_urls"][medium] The medium size thumbnail. Object
["thumbnail_urls", "medium"][url] Url of the thumbnail. String
["thumbnail_urls", "medium"][width] Width of the thumbnail. Integer
["thumbnail_urls", "medium"][height] Height of the thumbnail. Integer
["thumbnail_urls"][small] The small size thumbnail. Object
["thumbnail_urls", "small"][url] Url of the thumbnail. String
["thumbnail_urls", "small"][width] Width of the thumbnail. Integer
["thumbnail_urls", "small"][height] Height of the thumbnail. Integer
free Determine if the monetizable item is free or not. Boolean
vip_accessible Determine if the membership vip permission is allowed or not. When the value is false, a member can not access this monetizable item via having membership vip permission. Boolean
owner The owner of this resource. String
["owner"][id] The id of the member who exists in your member system. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 11
Content-Type: application/json
Content-Length: 664
ETag: W/"dcff6d206c8549dfad4e2270a311cbcc"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2cd634a0-f641-4215-8599-cc932cb932ee
X-Runtime: 0.138163

Body

{
  "id": "xmwtLKwb",
  "account_id": "straas-dev-test",
  "title": "new title",
  "synopsis": "Id officia veritatis doloribus molestiae qui velit dolorum.",
  "accomplished": true,
  "duration": 5462541,
  "resolution": "_1080p",
  "stream_url": "https://vod-staging.straas.net/test.m3u8",
  "embed_url": "https://app-staging.straas.net/straas-dev-test/videos/xmwtLKwb",
  "live_id": null,
  "available": true,
  "listed": true,
  "projection": "flat",
  "free": false,
  "vip_accessible": true,
  "poster_url": null,
  "thumbnail_urls": null,
  "owner": {
    "id": "cp_member_id"
  },
  "storyboard_set": null,
  "publish_time": null,
  "live_started_at": null,
  "live_ended_at": null,
  "created_at": "2020-07-09T09:03:13Z",
  "updated_at": "2020-07-09T09:03:13Z"
}

VideoPackage

A set of videos can be bundled by a video package and monetized together.

Create VideoPackage

Create a video package.

Endpoint

POST /api/v1/app/video_packages

Parameters

Name Description Type
title required

The title of the resource. Currently, emoji is not supported.

String

Request

Route

POST /api/v1/app/video_packages

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE1NywiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4NH0.p-kmFBHjAT0lCYY3vGjwCc0H3pXdbBIrK5i29favSYQ
Content-Type: application/json

Body

{
  "title": "video package title"
}

Response

Response Fields

Name Description Type
id The video package id. String
account_id The id of the account which the resource belongs to. String
title The video package title. String
created_at The data created time. String
updated_at The data last updated time. String
has_monetization_rules Whether there is any monetization rule created from the monetizable item. Boolean
monetization_rules The monetization rules created from this monetizable item. Array
["monetization_rules"][id] The monetization rule id. Integer
["monetization_rules"][account_id] The id of the account which the resource belongs to. String
["monetization_rules"][description] The desciption of this monetization rule. String
["monetization_rules"][monetizable_type] The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
["monetization_rules"][monetizable_id] The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
["monetization_rules"][title] The title of this monetization rule. String
["monetization_rules"][valid_minutes] The valid duration of this monetization rule. Integer
["monetization_rules"][amount] The price of this monetization rule. Integer
["monetization_rules"][amount_currency] The currency of the price (amount). String

Status

201

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 150
ETag: W/"1ba42b3bcfbaa2bead00be2f1f908a30"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 7efcfc81-7e22-4512-b93b-b04fb076cff2
X-Runtime: 0.036464

Body

{
  "id": "ysowcEwx",
  "account_id": "straas-dev-test",
  "title": "video package title",
  "created_at": "2020-07-09T09:03:04Z",
  "updated_at": "2020-07-09T09:03:04Z"
}

Create VideoPackageItem

Add a video to a video package.

Endpoint

POST /api/v1/app/video_packages/:video_package_id/video_package_items

Parameters

Name Description Type
video_package_id required

The video package id.

String
video_id required

The video id.

String

Request

Route

POST /api/v1/app/video_packages/Ev6qhF36/video_package_items

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE2MCwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4NH0.0kjQrSWnYYfyyE5elsC2uMsjc_JCJlivKKSASu_LE6E
Content-Type: application/json

Body

{
  "video_id": "cuqkA8rr"
}

Response

Response Fields

Name Description Type
id The video package item id. Integer
account_id The id of the account which the resource belongs to. String
video_package_id The video package id which the video package item belongs to. String
video_id The video id of the video package item. String
created_at The data created time. String
updated_at The data last updated time. String

Status

201

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 164
ETag: W/"0a55fa7c5fb0ac8f394e8323edfa0d85"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: f4e32e2f-06f9-4198-8b65-16fe5b02eccd
X-Runtime: 0.078551

Body

{
  "id": 11,
  "account_id": "straas-dev-test",
  "video_package_id": "Ev6qhF36",
  "video_id": "cuqkA8rr",
  "created_at": "2020-07-09T09:03:05Z",
  "updated_at": "2020-07-09T09:03:05Z"
}

Delete VideoPackage

Delete the video package.

Endpoint

DELETE /api/v1/app/video_packages/:id

Parameters

Name Description Type
id required

The video package id.

String

Request

Route

DELETE /api/v1/app/video_packages/6FGauWaC

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE1OSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4NH0.vGMJ1314ngszBs18sVcFdlItbdSs1kNKFsuD2qX4-fQ
Content-Type: application/json

Response

Response Fields

Name Description Type
id The video package id. String
account_id The id of the account which the resource belongs to. String
title The video package title. String
created_at The data created time. String
updated_at The data last updated time. String
has_monetization_rules Whether there is any monetization rule created from the monetizable item. Boolean
monetization_rules The monetization rules created from this monetizable item. Array
["monetization_rules"][id] The monetization rule id. Integer
["monetization_rules"][account_id] The id of the account which the resource belongs to. String
["monetization_rules"][description] The desciption of this monetization rule. String
["monetization_rules"][monetizable_type] The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
["monetization_rules"][monetizable_id] The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
["monetization_rules"][title] The title of this monetization rule. String
["monetization_rules"][valid_minutes] The valid duration of this monetization rule. Integer
["monetization_rules"][amount] The price of this monetization rule. Integer
["monetization_rules"][amount_currency] The currency of the price (amount). String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 151
ETag: W/"86ce13c9b865461893664e9f55eb4ae2"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: eb83da27-de5d-4ad6-ba32-7a55dcf23d8f
X-Runtime: 0.041324

Body

{
  "id": "6FGauWaC",
  "account_id": "straas-dev-test",
  "title": "video package title4",
  "created_at": "2020-07-09T09:03:04Z",
  "updated_at": "2020-07-09T09:03:04Z"
}

Delete VideoPackageItem

Remove the video from the video package.

Endpoint

DELETE /api/v1/app/video_packages/:video_package_id/video_package_items/:id

Parameters

Name Description Type
video_package_id required

The video package id.

String
id required

The video package item id.

String

Request

Route

DELETE /api/v1/app/video_packages/wbsMWWyb/video_package_items/19

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE2NCwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4N30.0fBc8ELT54T6MlWxgzlLh8qqByljBFl3WHxf9QzbIuw
Content-Type: application/json

Response

Response Fields

Name Description Type
id The video package item id. Integer
account_id The id of the account which the resource belongs to. String
video_package_id The video package id which the video package item belongs to. String
video_id The video id of the video package item. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 164
ETag: W/"8e96a8079c33e1aaa411731dc25648fd"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 0dfcdc22-1777-452c-a285-20ac9e11c862
X-Runtime: 0.071632

Body

{
  "id": 19,
  "account_id": "straas-dev-test",
  "video_package_id": "wbsMWWyb",
  "video_id": "KGG69trd",
  "created_at": "2020-07-09T09:03:07Z",
  "updated_at": "2020-07-09T09:03:07Z"
}

Get VideoPackage Details

Get the video package details.

Endpoint

GET /api/v1/app/video_packages/:id

Parameters

Name Description Type
id required

The video package id.

String
includes

Include extra resource details. Allow included resources: {monetization_rules}. For example, includes=monetization_rules.

String

Request

Route

GET /api/v1/app/video_packages/P5oJ6M8L?includes=monetization_rules

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE1NiwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4M30.mcQ8Gic2cr03VcaPumEZvFOcWtwIub2-9uDU9X3fqEw
Content-Type: application/json

Query Parameters

includes=monetization_rules

Response

Response Fields

Name Description Type
id The video package id. String
account_id The id of the account which the resource belongs to. String
title The video package title. String
created_at The data created time. String
updated_at The data last updated time. String
has_monetization_rules Whether there is any monetization rule created from the monetizable item. Boolean
monetization_rules The monetization rules created from this monetizable item. Array
["monetization_rules"][id] The monetization rule id. Integer
["monetization_rules"][account_id] The id of the account which the resource belongs to. String
["monetization_rules"][description] The desciption of this monetization rule. String
["monetization_rules"][monetizable_type] The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
["monetization_rules"][monetizable_id] The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
["monetization_rules"][title] The title of this monetization rule. String
["monetization_rules"][valid_minutes] The valid duration of this monetization rule. Integer
["monetization_rules"][amount] The price of this monetization rule. Integer
["monetization_rules"][amount_currency] The currency of the price (amount). String

Status

200

Headers

X-Cache-Count: 1
Content-Type: application/json
Content-Length: 206
ETag: W/"8db5aec4a9d26598f58529e186023dc4"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 085d5684-8d2f-4423-8015-12ce1fa1ae09
X-Runtime: 0.034194

Body

{
  "id": "P5oJ6M8L",
  "account_id": "straas-dev-test",
  "title": "video package title2",
  "monetization_rules": [

  ],
  "has_monetization_rules": false,
  "created_at": "2020-07-09T09:03:03Z",
  "updated_at": "2020-07-09T09:03:03Z"
}

Get VideoPackageItems

Get the item list of the video package.

Endpoint

GET /api/v1/app/video_packages/:video_package_id/video_package_items

Parameters

Name Description Type
video_package_id required

The video package id.

String
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer
child_ids

The video ids. Filter the item which child id is the same one.

String

Request

Route

GET /api/v1/app/video_packages/roE5n5VE/video_package_items?page=1&per_page=5

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE2MiwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4NX0.F50JHGoq8iU2tIR0O30BBk88dY6IW9FCVcHd4bpp6rY
Content-Type: application/json

Query Parameters

page=1
per_page=5

Response

Response Fields

Name Description Type
id The video package item id. Integer
account_id The id of the account which the resource belongs to. String
video_package_id The video package id which the video package item belongs to. String
video_id The video id of the video package item. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 166
ETag: W/"7d657256c8c5e7d63196996894f489c5"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: ad1577a0-9165-44a3-b4d4-b182ff1b9437
X-Runtime: 0.036424

Body

[
  {
    "id": 13,
    "account_id": "straas-dev-test",
    "video_package_id": "roE5n5VE",
    "video_id": "fdzYmdWN",
    "created_at": "2020-07-09T09:03:05Z",
    "updated_at": "2020-07-09T09:03:05Z"
  }
]

Get VideoPackages

Get video packages.

Endpoint

GET /api/v1/app/video_packages

Parameters

Name Description Type
page

Page of results to fetch.

Integer
per_page

Number of results to return per page. Learn more about Pagination

Integer

Request

Route

GET /api/v1/app/video_packages?page=1&per_page=5

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE1NSwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4M30.X4H6W3SsxJPRkTuLAXjLCxBuc8l1dsX7H2sDQz4jFrs
Content-Type: application/json

Query Parameters

page=1
per_page=5

Response

Response Fields

Name Description Type
id The video package id. String
account_id The id of the account which the resource belongs to. String
title The video package title. String
created_at The data created time. String
updated_at The data last updated time. String

Status

200

Headers

Total: 1
Per-Page: 5
X-Cache-Count: 1
Content-Type: application/json
Content-Length: 153
ETag: W/"7e2dacabb41b6aa27279512d96b660d9"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 1605b4b6-1d41-4dc7-8de6-0027c1955c06
X-Runtime: 0.023726

Body

[
  {
    "id": "CW8LvFpn",
    "account_id": "straas-dev-test",
    "title": "video package title1",
    "created_at": "2020-07-09T09:03:03Z",
    "updated_at": "2020-07-09T09:03:03Z"
  }
]

Update VideoPackage Details

Update the video package details.

Endpoint

PUT /api/v1/app/video_packages/:id

Parameters

Name Description Type
title

The title of the resource. Currently, emoji is not supported.

String

Request

Route

PUT /api/v1/app/video_packages/m6wUEGQ5

Headers

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfaWQiOjE1OCwiYWNjb3VudF9pZCI6InN0cmFhcy1kZXYtdGVzdCIsImV4cCI6MTU5NDM3MTc4NH0.Dx4TGpVrAFsiCBcx67M8Gib7dYcSX6gUTrRjOdGS_24
Content-Type: application/json

Body

{
  "title": "new video package title3"
}

Response

Response Fields

Name Description Type
id The video package id. String
account_id The id of the account which the resource belongs to. String
title The video package title. String
created_at The data created time. String
updated_at The data last updated time. String
has_monetization_rules Whether there is any monetization rule created from the monetizable item. Boolean
monetization_rules The monetization rules created from this monetizable item. Array
["monetization_rules"][id] The monetization rule id. Integer
["monetization_rules"][account_id] The id of the account which the resource belongs to. String
["monetization_rules"][description] The desciption of this monetization rule. String
["monetization_rules"][monetizable_type] The monetizable item type. {video, playlist, video_package, live, live_package, membership_type} String
["monetization_rules"][monetizable_id] The monetizable item id. {video_id, playlist_id, video_package_id, live_id, live_package_id, membership_type_id} String
["monetization_rules"][title] The title of this monetization rule. String
["monetization_rules"][valid_minutes] The valid duration of this monetization rule. Integer
["monetization_rules"][amount] The price of this monetization rule. Integer
["monetization_rules"][amount_currency] The currency of the price (amount). String

Status

200

Headers

X-Cache-Count: 3
Content-Type: application/json
Content-Length: 155
ETag: W/"bbada9d8e9ccde8c73fce2ef8d41514f"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: b261be74-7f6a-4ea3-81b3-5526c884b7c0
X-Runtime: 0.033512

Body

{
  "id": "m6wUEGQ5",
  "account_id": "straas-dev-test",
  "title": "new video package title3",
  "created_at": "2020-07-09T09:03:04Z",
  "updated_at": "2020-07-09T09:03:04Z"
}



Error Responses


The following table shows you the possible error responses.

HTTP status code Error message User message
400 Bad Request The request was malformed.
401 JWT malformed Invalid token.
401 JWT expired Token was expired.
401 Unauthorized The cliend id, client secret or signature were invalid.
403 “Forbidden” or custom messages The user has no permission to access the resource.
404 “Couldn’t find {resource} with ‘id’={id}” or custom messages The resource was not found.
409 Custom messages The request was not completed due to a conflict with the current state of the target resource. Maybe created a duplicate resource or some precondition was missed.
422 Custom messages The request parameters were invalid or the parameters of the resource were invalid.
423 Unavailable The resource was private or unavailable.
429 Retry later API rate limit exceeded.
500 Custom message Server went something wrong.