POST/api/v4/locations/reviews/respond

回复互动

在评价或互动的来源平台上发布公开回复。

需要 API 密钥。请求头格式和密钥轮换请参阅身份验证。

参数

请求体

名称类型必填描述
interactionIdstring必填UUID of the interaction to respond to. Take it from an interaction's `id` or `interactionId`, which are the same value. It is a plain UUID, with no numeric or Base64 Relay form.
responseContentstring必填Text content of the response to post.
respondedWithstring可选Response-template ID to attribute the reply to, if it was generated from a template.

请求示例

可直接粘贴的请求体。请将占位 ID 和值替换为您自己的。

Request body
{  "interactionId": "9e26d2a8-a6ed-42ea-8454-47d1c92ea841",  "responseContent": "Thank you for visiting Jenny Home: we're glad you enjoyed your experience!"}

响应

200Response accepted and queued for posting. `data.respondToInteraction.interaction` holds the created response.
Response
{  "data": {    "respondToInteraction": {      "interaction": {        "id": "2090753a-ece6-4837-8336-8494ad308523",        "interactionId": "9e26d2a8-a6ed-42ea-8454-47d1c92ea841",        "content": "Thank you for visiting Jenny Home: we're glad you enjoyed your experience!",        "interactionStatus": "CREATED",        "editedResponse": false      },      "errors": null    }  }}
401Unauthenticated, missing or invalid API key.

常见错误

  • SY50121: Google Reviews accept only a single owner reply per review; a second response is rejected.

在评价或互动的来源平台(例如 Google、Facebook)上发布回复。回复以异步方式提交:interactionStatus 立即为 CREATED,并在平台确认后变为 COMPLETED 或 CONFIRMED(也可能变为 FAILED,请参阅回复状态流程)。

并非所有平台都支持商家回复。调用前,请检查互动对象上的 canRespond。Google Reviews 的每条评价仅接受一条回复(重复尝试会返回 SY50121);如需修改现有回复,请使用编辑回复,而不是发布新回复。

使用场景:自动回复新的 5 星评价

若要自动感谢给出好评的用户,请使用 ratingFilters=[5] 和 responseStatus=["PENDING"] 轮询列出互动,然后对于返回结果中每个 canRespond 为 true 的 node,将其 id 作为 interactionId,连同您的 responseContent 一起通过 POST 提交:

JSON
{  "interactionId": "9e26d2a8-a6ed-42ea-8454-47d1c92ea841",  "responseContent": "Thank you for visiting Jenny Home: we're glad you enjoyed your experience!"}

由于发布是异步的,请通过按 ID 获取互动重新获取该互动,确认回复已变为 COMPLETED/CONFIRMED 状态,而不是根据 200 假定操作成功。

Request
curl -X POST 'https://listingsapi.com/api/v4/locations/reviews/respond' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "interactionId": "9e26d2a8-a6ed-42ea-8454-47d1c92ea841",    "responseContent": "Thank you for visiting Jenny Home: we're glad you enjoyed your experience!"  }'