> For the complete documentation index, see [llms.txt](https://shangzhibo.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shangzhibo.gitbook.io/api/readme.md).

# API 简介

## 简介 <a href="#jian-jie" id="jian-jie"></a>

上直播 API 提供基础的功能接口，满足您的二次开发需求。

上直播 API 需要使用 accessToken 发起 API 请求。

## 主要功能 <a href="#jian-jie" id="jian-jie"></a>

| 功能名称     | 详细内容                                     |
| -------- | ---------------------------------------- |
| 活动 API   | 支持对活动进行增、删、改、查，支持发起、结束直播，支持活动相关数据查询      |
| 评论 API   | 支持获取活动历史聊天（评论）记录，添加聊天（评论）                |
| 媒体库 API  | 支持获取媒体库中上传视频以及回看视频列表，从而获取视频播放地址          |
| 观众账号 API | 用于实现通过客户用户信息登录上直播进行观看及付费，使两边用户数据同步       |
| 播放页 API  | 支持获取指定活动的 iframe 嵌入代码，并支持通过嵌入代码提供直播信息的上报 |

## API 接入步骤 <a href="#api-shi-yong-bu-zhou" id="api-shi-yong-bu-zhou"></a>

![](/files/-Lqt1R2Do13zBVrYKpWo)

API 的接入分为三步：

1.成为旗舰版用户：[前往官网升级](http://shangzhibo.tv/price)

2.得到 accessToken： 请咨询我司商务，杨经理（18968187008）、彭经理（15167172618）。

3.使用第二步中得到的 accessToken，便可以访问上直播 API 中的全部接口服务

需要在请求 header 中添加以下请求头信息：

```http
Authorization: Bearer <accessToken>
```

如果请求头没有带上 accessToken，上直播 API 的安全机制将会视其为未授权访问操作，并将其拦截。

## API 域名 <a href="#api-yu-ming" id="api-yu-ming"></a>

API 请求域名统一为: `http://shangzhibo.tv 同时也支持 https`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shangzhibo.gitbook.io/api/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
