Available in Classic and VPC
This guide describes the APIs required to integrate customer services with B2B PRISM Live Studio for live streaming.
Service API definition
Service APIs are APIs that must be provided by the service in order to integrate with B2B PRISM Live Studio and stream live content. Service APIs are categorized as required APIs and optional APIs. The following describes each API.
- Required APIs
- These are APIs that must be implemented to use the B2B PRISM Live Studio features.
- If these are not supported, the service cannot be activated.
- Optional APIs
- These are APIs that must be implemented to use additional features of B2B PRISM Live Studio.
- These can be provided by type, and their availability can be configured during service setup.
- Each API has dependencies on other APIs, and any dependent APIs must be provided together.
Service API restrictions
This section describes the restrictions to be aware of when using the B2B PRISM Live Studio APIs.
- REST API
- Basic integration uses the REST API.
- A response time of less than 1 second is recommended. Normal operation is not guaranteed if the response time exceeds 3 seconds.
- Authentication and security
- All communication must use HTTPS with SSL. (TLS v1.2 or later recommended)
- Use the access token obtained via OAuth 2.0.
Service API list
This section introduces the list of service APIs.
Required APIs
The list of required APIs is as follows:
| Type | Detailed classification | Description | Specification |
|---|---|---|---|
| AUTH | Login and authentication | ||
| CHANNEL | Get channel | ||
| Get live. | Get channel live list. | Get channel list list API specification | |
| LIVE | Get live information. | Get live information and status. | Get live status and statistics API specification |
| Create live. | Create new live. | Create live API specification | |
| Start and end live. |
Optional APIs
The list of optional APIs is as follows:
| Type | Detailed classification | Description | Dependency | Specification |
|---|---|---|---|---|
| LIVE_CHAT_LIST | Get chat. | Get chat API specification | ||
| LIVE_CHAT_SEND | Send chat. | Send chat. | Send chat API specification | |
| LIVE_CHAT_DELETE | Delete chat. | LIVE_CHAT_LIST | Delete chat API specification | |
| USER_BAN | Block and unblock chat users. | LIVE_CHAT_LIST | ||
| USER_MOD | Grant and remove chat admin permissions. | LIVE_CHAT_LIST |
To view the specific process for using the B2B PRISM Live Studio API, see the B2B PRISM Live Studio integration guide.
Basic API format
This section describes the basic API format.
Request headers
The request headers are as follows:
| Name | Type | Description |
|---|---|---|
| x-prism-client-id | String | Client ID provided by the customer's service to B2B PRISM Live Studio for OAuth 2.0 authorization, which cannot be changed |
| x-prism-client-secret | String | A client secret provided by the customer’s service for OAuth 2.0 authentication with B2B PRISM Live Studio. It can be changed through consultation if necessary due to security issues or other reasons. |
| x-prism-access-token | String | Issued and stored during OAuth 2.0 login, and changes with each login. If the access token expires, an ACCESS_TOKEN_EXPIRED (1011) error occurs. |
The content-type header in the request is as follows:
Content-type: application/json
Basic response format
The basic response format is as follows:
| Name | Type | Description | Required |
|---|---|---|---|
| success | Boolean | Indicates whether the request succeeded. | Y |
| errorCode | Number | 0 if successful; for failures, see API error code. | Y |
| errorName | String | Blank if successful; for failures, see API error code. | Y |
| message | String | Providing a detailed error message enables faster error monitoring. | N |
| data | Object | If only the success status is returned, data is optional; see the API specification for each data format. | N |
Common API error codes
The following describes the common API error codes.
| Code | Code name | HTTP status code | HTTP status code message | Description |
|---|---|---|---|---|
| 1000 | INVALID_PARAMETER | 400 | Bad Request | The requested path parameter or request body contains an invalid value. |
| 1001 | UNAUTHORIZED_ACCOUNT_ID | 401 | Unauthorized | The request was made with an invalid account ID or account token. |
| 1011 | ACCESS_TOKEN_EXPIRED | 400 | Bad Request | The access token has expired. |
| 1012 | ACCESS_TOKEN_INVALID | 400 | Bad Request | The access token is invalid. |
| 1102 | CHANNEL_DISABLED | 400 | Bad Request | The channel is disabled. |
| 1104 | RESOURCE_NOT_FOUND | 404 | Not Found | When querying liveId, channelId, userId, etc., the object being queried does not exist. |
| 1107 | ACCESS_TOKEN_SCOPE | 400 | Bad Request | The access token lacks sufficient permissions (scope). |
| 2000 | UNEXPECTED_ERROR | 500 | Internal Server Error | An unexpected server error has occurred. |