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.

مثال على الطلب

نص جاهز للصق. استبدل المعرّفات والقيم النموذجية بقيمك.

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 سوى رد واحد لكل تقييم (تُرجع المحاولة المتكررة SY50121)؛ استخدم تعديل رد لتغيير رد موجود بدلًا من نشر رد جديد.

حالة استخدام: الرد تلقائيًا على التقييمات الجديدة ذات تقييم 5 نجوم

لشكر أصحاب التقييمات الراضين تلقائيًا، استعلِم دوريًا باستخدام عرض قائمة التفاعلات مع ratingFilters=[5] وresponseStatus=["PENDING"]، ثم لكل node مُعاد تكون قيمة canRespond فيه هي true، استخدم POST لإرسال id الخاص به بوصفه interactionId مع responseContent الخاص بك:

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

نظرًا إلى أن النشر غير متزامن، اجلب التفاعل مجددًا عبر جلب التفاعلات حسب المعرّفات للتأكد من وصول الرد إلى 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!"  }'