# 获取跑马灯设置接口

### 接口URL

```
http://api.polyv.net/live/v3/channel/marquee/get
```

### 接口说明

```
1、接口用于获取频道或全局的跑马灯设置信息
2、接口支持https
3、不提交channelId 表示获取全局设置
4、提交channelId 且getActual="N" 表示获取频道本身的设置，不提交getActual 或者提交getActual = "Y" 表示获取频道实际生效的跑马灯设置
```

### 支持格式

```
JSON
```

### 请求方式

```
GET
```

### 请求参数

| 参数名       | 必选 | 类型            | 说明                                                                                                                                                                                                        |
| --------- | -- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| appId     | 是  | string        | 管理员的appId                                                                                                                                                                                                 |
| timestamp | 是  | long          | 13位当前时间戳                                                                                                                                                                                                  |
| sign      | 是  | String        | 签名，为32位大写的MD5值,`生成签名的appSecret密钥作为通信数据安全的关键信息，严禁保存在客户端直接使用，所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据`【详见[签名生成规则](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/buildSign/README.md)】 |
| userId    | 是  | string        | 用户id                                                                                                                                                                                                      |
| channelId | 否  | int           | 频道id,查询全局设置值不用传该值                                                                                                                                                                                         |
| getActual | 否  | string（取值Y/N） | 仅在查询频道跑马灯设置时生效，Y:获取频道实际生效跑马设置，N：获取频道的跑马灯设置                                                                                                                                                                |

### 响应成功JSON示例：

```json
{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "globalSettingEnabled": null,
        "marqueeRestrict": "N",
        "marqueeType": "nickname",
        "marquee": "",
        "marqueeOpacity": 100,
        "marqueeFontSize": 30,
        "marqueeFontColor": "#000000",
        "marqueeAutoZoomEnabled": "N"
    }
}
```

### 响应失败JSON示例：

未输入appId

```json
{
    "code": 400,
    "status": "error",
    "message": "appId is required.",
    "data": ""
}
```

appId不正确

```json
{
    "code": 400,
    "status": "error",
    "message": "application not found.",
    "data": ""
}
```

时间戳错误

```json
{
    "code": 400,
    "status": "error",
    "message": "invalid timestamp.",
    "data": ""
}
```

用户ID错误

```json
{
    "code": 400,
    "status": "error",
    "message": "userId error.",
    "data": ""
}
```

签名错误

```json
{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
```

### 字段说明

| 参数名                         | 说明                                                                                |
| --------------------------- | --------------------------------------------------------------------------------- |
| code                        | 响应代码，成功为200，失败为400，签名错误为403，异常错误500                                               |
| status                      | 成功为success，失败为error                                                               |
| message                     | 错误时为错误提示消息                                                                        |
| data.globalSettingEnabled   | 频道跑马灯的全局设置开关，查询全局设置时此字段为null                                                      |
| data.marqueeRestrict        | 跑马灯开关，取值Y（开），N（关）                                                                 |
| data.marqueeType            | 跑马灯类型,取值：fixed（固定值）、nickname（观众名称）、diyurl（自定义url）                                 |
| data.marquee                | marqueeType=fixed 时，此字段为跑马灯内容，marqueeType=nickname 为空, marqueeType=diyurl 为用户的url |
| data.marqueeOpacity         | 跑马灯不透明度，范围是 0 \~ 100                                                              |
| data.marqueeFontSize        | 跑马灯字体大小                                                                           |
| data.marqueeFontColor       | 跑马灯字体颜色，例如 #ffffff                                                                |
| data.marqueeAutoZoomEnabled | 是否开启跑马灯自适应缩放，值为 Y 或 N                                                             |


---

# Agent Instructions: 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://polyv.gitbook.io/document/docs/unclassified/2019/25791b5b2598b62c4aa2db2ad31de2aa.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.
