← 返回目录
📁 API Reference › Accounts › Comments

获取评论的所有回复

若自有TikTok 账号某原生视频的某条评论已有回复,您可以使用本接口查看所有公开和隐藏的回复(以及相关信息)。

注意

  • /business/comment/reply/list/目前不支持获取对隐藏评论的回复。
  • 评论 webhook 事件 comment.update 使您能够在自有 TikTok 账号下的任一公开视频下收到新评论回复,或原有评论回复被删除,或原有评论回复可见设置发生修改的五分钟内收到通知。若想订阅评论 webhook,请查看订阅评论更新事件。

v1.2与v1.3版本对比

以下表格概括了 v1.2与v1.3接口的变化。

|变化内容{30%}|v1.2{35%}|v1.3{35%}|
|---|---|---|
|接口路径|/v1.2/business/comments/replies/list/|/v1.3/business/comment/reply/list/|
|方法|POST |GET|
|新增返回参数|/|`unique_identifier`<br>`parent_comment_id`<br>`display_name`<br>`image_url` |

请求

地址 https://business-api.tiktok.com/open_api/v1.3/business/comment/reply/list/

方法 GET

Header

|字段{30%}|类型{15%}|描述{55%}|
|---|---|---|
|Access-Token {必填}|string|经 TikTok 创作者授权的访问令牌。<br>若想获取访问令牌,需使用[/tt_user/oauth2/token/](https://business-api.tiktok.com/portal/docs?id=1738084387220481#item-link-获取访问令牌)接口。|

参数

请将下列参数作为查询字符串进行传递。

|字段{30%}|类型{15%}|描述{55%}|
|--- |--- |--- |
|business_id {必填}| string | TikTok 账户的应用唯一识别ID。<br>您需将[/tt_user/oauth2/token/](https://business-api.tiktok.com/portal/docs?id=1738084387220481#item-link-获取访问令牌)接口返回的`open_id`字段值传给本字段。|
|video_id {必填}|string|自有 TikTok 视频的唯一标识符,用于列出对应评论。可通过[/business/video/list/](https://ads.tiktok.com/marketing_api/docs?id=1762228421622786) 接口的<code>item_id</code>字段获取。|
|comment_id {必填}|string|自有 TikTok 视频评论的唯一标识符,用于列出对应回复。可通过[/business/comment/list/](https://ads.tiktok.com/marketing_api/docs?id=1760232109619202) 接口的<code>comment_id</code>字段获取所列的各个评论的 ID。|
|status|string|评论回复是否可见的状态枚举。<br><br><strong>枚举值</strong>:<ul><li><code>PUBLIC</code>:所有 TikTok 用户均可公开查看的评论回复。</li><li><code>ALL</code>:隐藏的评论以及所有 TikTok 用户均可公开查看的评论回复。</li></ul><br><strong>默认值:</strong> <code>ALL</code>。|
|sort_field|string|对评论回复进行排序的特定字段。<br><br><strong>枚举值</strong>:<ul><li><code>likes</code>:按<code>sort_order</code>指定的排序方法,同时依据点赞数对评论回复排序。</li><li><code>replies</code>:按<code>sort_order</code>指定的排序方法,同时依据回复数对评论回复排序。</li><li><code>create_time</code>:按<code>sort_order</code>指定的排序方法,同时依据评论回复时间对评论回复排序。</li></ul><br>评论回复默认以随机顺序返回。|
|sort_order|string|指定评论回复排序方法的特定字段。<br><br><strong>枚举值</strong>:<ul><li><code>asc</code>:参照<code>sort_field</code>指定的排序依据,对评论回复升序排序。</li><li><code>desc</code>:参照<code>sort_field</code>指定的排序依据,对评论回复降序排序。</li></ul><br>评论回复默认按意义程度排序。|
|cursor|integer|分页光标。如果返回参数<code>has_more</code> 为<code>true</code>,请将返回中此参数的光标值需传递给后续请求,以获取下一页数据。<br><br><strong>默认值</strong>:0。|
|max_count|integer|每页返回的最大评论回复数。<br><br><strong>默认值</strong>:20。<br><br><strong>最小值</strong>:0。<br><br><strong>最大值</strong>:30。<br><span style="color:darkred"><b>注意</b></span>: 受信任与安全政策影响,接口可能会返回少于 <code>max_count</code> 的评论回复数,即使返回参数<code>has_more</code> 为 <code>true</code>。|

示例

(code curl http)
curl --location --request GET 'https://business-api.tiktok.com/open_api/v1.3/business/comment/reply/list/?business_id={{business_id}}&video_id={{video_id}}&comment_id={{comment_id}}' \
--header 'Access-Token: {{Access-Token}}'
(/code)

返回

Header

这些header很重要,可用于记录问题报告和故障排查信息。下表列出了部分返回的header。

|字段{30%}|类型{15%}|描述{55%}|
|---|---|---|
| Date | string | 收到返回时的(GMT)日期和时间 。 <br><strong>示例</strong>:Fri, 13 Aug 2021 08:04:42 GMT |
| X-Tt-Logid | string | 接口请求的唯一标识符。|

Body

|字段{30%}|类型{15%}|描述{55%}|
|-|-|-|
| request_id | string | 接口请求的唯一标识符。<br><br>请记录此字段,用于所有接口请求。此字段对于问题报告和故障排查十分重要。 |
| code | integer | 返回码。完整返回码列表及描述,可查看[附录 - 返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。|
|message| string | 返回信息。更多信息可查看[附录 - 返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。 |
| data | object | 返回数据。 |
#|comments | object[] | 当前页面针对某一视频的评论的回复列表。 |
##|comment_id | string | 回复的唯一标识符。<br><br><strong>示例</strong>:6990565363377392901 |
##| parent_comment_id | string | 回复(`comment_id`)对应的评论的唯一标识符。<br><br><strong>示例</strong>:6990565363377392901|
##|video_id | string | 回复对应的自有视频的唯一标识符。<br><br><strong>示例</strong>:6990565363377392901 |
##|user_id{-即将废弃}| string | 发表回复的用户在开发者应用和 TikTok 账户范围内的唯一标识符。<br><br><strong>示例</strong>:ce9b7be629b0447af777a0ad945783f61b7f790982b49fbda04a23b4722eaffe<br><br><p><span style="color:darkred"><b>注意</b></span>:本字段将在下个 API 版本中废弃。推荐您使用 `unique_identifier` 识别 TikTok 用户,因为该用户标识符在多个 API 之间保持一致。|
##| unique_identifier | string | 发表评论或评论回复的用户的全球统一标识符。该标识符在多个 API 之间保持一致,方便集成和参数的互相参照。<br><br><b>示例</b>:+ABc1D2/E0fGhijklMNOrD34vDW/zDiZUNRH5Jyahue6OcA7b8ZpwnqXV9u1Uh+k|
##|create_time| string | 回复发表的日期和时间,采用 Unix/Epoch 格式 。<br><br><strong>示例</strong>:1627617835 |
##|text | string | 回复的文本内容。<br><br><strong>示例</strong>:"This is a comment #comment 🙂" |
##|likes | integer | 回复获得的点赞数。<br><br><strong>示例</strong>:123 |
##|replies | integer | 回复获得的回复数。<br><br><strong>示例</strong>:123 |
##|owner | boolean | 当前应用用户是否为回复的所有者。<br><br><strong>示例</strong>:`true` |
##|liked | boolean | 当前应用用户是否点赞了此回复。<br><br><strong>示例</strong>: `true` |
##|pinned | boolean | 当前应用用户是否置顶了此回复。<br><br><strong>示例</strong>: `true` |
##|status | string | 此回复的可见状态设置。枚举值:<ul><li> `HIDDEN`:回复已隐藏,无法公开浏览。</li><li> `PUBLIC`:回复可被所有用户查看。</li></ul><strong>示例</strong>: `PUBLIC `|
##|username | string | 发布此回复的 TikTok 账户的唯一用户名。<br><br><strong>示例</strong>: feather_in_the_w1nd |
##| display_name | string | 发布此回复的 TikTok 账户的显示名称。  <br><br> <strong>示例</strong>:Feather in the wind |
##|profile_image | string | 账户的头像链接。达到链接中设置的(Unix/Epoch 格式)`x-expires`参数对应的时间日期时过期。 <br><br><strong>示例</strong>:https://p16-sign-va.tiktokcdn.com/tos-maliva-avt-0068/188d468fc1de3f328250ea0c96e98f8b~c5_168x168.jpeg?x-expires=1651687200&x-signature=AAiHg70%2Bnj9iUipTuQWodRmk0qA%3D |
##|image_url|string|评论中图片的 URL。<br><br>当评论为图片时返回。<br><br>此 URL 不会过期。|
#|cursor | integer | 用于获取下一页结果的光标,可传递到后续接口请求的 `cursor`查询参数。 |
#|has_more | boolean | 是否有下一页数据。 |

示例

(code Success-Response http)
HTTPS/1.1 200 OK
{
    "code": 0,
    "message": "OK",
    "request_id": "{{request_id}}",
    "data": {
        "cursor": 2,
        "has_more": false,
        "comments": [
            {
                "profile_image": "{{profile_image}}",
                "user_id": "{{user_id}}",
                "text": "{{text}}",
                "likes": 0,
                "username": "{{username}}",
                "display_name": "{{display_name}}",
                "parent_comment_id": "{{parent_comment_id}}",
                "owner": true,
                "status": "PUBLIC",
                "liked": false,
                "video_id": "{{video_id}}",
                "unique_identifier": "{{unique_identifier}}",
                "create_time": "{{create_time}}",
                "comment_id": "{{comment_id}}"
            },
            {
                "profile_image": "{{profile_image}}",
                "user_id": "{{user_id}}",
                "text": "{{text}}",
                "likes": 0,
                "username": "{{username}}",
                "display_name": "{{display_name}}",
                "parent_comment_id": "{{parent_comment_id}}",
                "owner": true,
                "status": "PUBLIC",
                "liked": false,
                "video_id": "{{video_id}}",
                "unique_identifier": "{{unique_identifier}}",
                "create_time": "{{create_time}}",
                "comment_id": "{{comment_id}}"
            }
        ]
    }
}
(/code)

内容来源:TikTok API for Business 官方文档 · 本地归档

在接这个接口时卡住了?
Stuck wiring this API into production? We build ad-delivery tooling on these platforms — campaign automation, reporting pipelines, error-handling and migration between API versions.
联系我们 · Talk to us 每日平台更新简报 →