Appearance
朋友圈评论
给一条朋友圈评论,或回复它下面的某条评论。
接口地址: POST /snsComment
说明与注意
id来自获取朋友圈列表、获取某个好友的朋友圈或发布接口的返回。replyCommentId用获取朋友圈详情返回的snsComments[].commentId。
请求参数
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| wId | 是 | string | 登录实例标识 |
| id | 是 | string | 朋友圈 ID |
| replyCommentId | 是 | int | 回复目标评论 ID;普通评论传 0 |
| content | 是 | string | 内容 |
请求示例
http
POST {BASE_URL}/snsComment
Authorization: Bearer <你的调用凭证>
Content-Type: application/json
{
"wId": "0000016e-abcd-0ea8-0002-d8c2dfdb0bf3",
"id": "13205404970681503871",
"replyCommentId": 0,
"content": "充满力量"
}bash
curl -X POST '{BASE_URL}/snsComment' \
-H 'Authorization: Bearer <你的调用凭证>' \
-H 'Content-Type: application/json' \
--data-raw '{
"wId": "0000016e-abcd-0ea8-0002-d8c2dfdb0bf3",
"id": "13205404970681503871",
"replyCommentId": 0,
"content": "充满力量"
}'python
import requests
url = "{BASE_URL}/snsComment"
headers = {"Authorization": "Bearer <你的调用凭证>", "Content-Type": "application/json"}
body = """{
"wId": "0000016e-abcd-0ea8-0002-d8c2dfdb0bf3",
"id": "13205404970681503871",
"replyCommentId": 0,
"content": "充满力量"
}"""
resp = requests.post(url, headers=headers, data=body.encode("utf-8"))
print(resp.text)java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String url = "{BASE_URL}/snsComment";
String body = "{\n" +
" \"wId\": \"0000016e-abcd-0ea8-0002-d8c2dfdb0bf3\",\n" +
" \"id\": \"13205404970681503871\",\n" +
" \"replyCommentId\": 0,\n" +
" \"content\": \"充满力量\"\n" +
"}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create(url))
.header("Authorization", "Bearer <你的调用凭证>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());php
<?php
$url = '{BASE_URL}/snsComment';
$body = <<<'JSON'
{
"wId": "0000016e-abcd-0ea8-0002-d8c2dfdb0bf3",
"id": "13205404970681503871",
"replyCommentId": 0,
"content": "充满力量"
}
JSON;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <你的调用凭证>',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;成功响应
json
{
"message": "成功",
"code": "1000",
"data": null
}错误响应
json
{
"message": "失败",
"code": "1001",
"data": null
}响应参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | string | 1000 成功;其他值都是失败,通常是 1001 |
| message | string | 反馈信息 |
| data | null | 无业务数据返回 |