POST
/api/v4/locations/reviews/respond回覆互動
在評論或互動的來源平台上發布公開回覆。
參數
請求主體
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
| interactionId | string | 必填 | 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. |
| responseContent | string | 必填 | Text content of the response to post. |
| respondedWith | string | 選填 | Response-template ID to attribute the reply to, if it was generated from a template. |
請求範例
可直接貼上的請求主體。請將預留位置 ID 與值換成您自己的。
{ "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.
{ "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 評論每則只接受一則回覆(重複嘗試會傳回 SY50121);若要變更現有回覆,請使用編輯回覆,而非發布新的回覆。
使用案例:自動回覆新的 5 星評論
若要自動感謝滿意的評論者,請使用 ratingFilters=[5] 和 responseStatus=["PENDING"] 輪詢列出互動,然後針對傳回的每個 canRespond 為 true 的 node,以 POST 將其 id 作為 interactionId,連同您的 responseContent 一起送出:
{ "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!" }'