POST/api/v4/locations/reviews/settings/edit

تعديل إعدادات التقييمات لموقع

يحدد مصادر التقييمات التي يُراقَب الموقع عليها، والحد الأدنى للتقييم الذي يُعدّ عنده التقييم إيجابيًا.

يتطلب مفتاح API. راجع المصادقة لمعرفة تنسيق الترويسة وتدوير المفاتيح.

المعلمات

النص الأساسي

ينطبق الحقل المتداخل المحدد على أنه مطلوب فقط عند إرسال الحقل الأصل. إذا كان الحقل الأصل اختياريًا وحذفته، فلا تنطبق حقوله الفرعية المطلوبة.

الاسمالنوعمطلوبالوصف
locationIdstringمطلوبLocation to update, as its Base64-encoded Relay ID (e.g. `TG9jYXRpb246MTgwMDI4OQ==`). This is a body field, so unlike path parameters a raw numeric ID is not converted and fails with `SY90002: Invalid Id`.
siteUrlsarrayاختياريThe complete set of review sources for the location. This REPLACES the current selection, so send every source you want kept, not just the additions.
siteUrls[].namestringاختياريSite key, as returned in `siteSettings[].name` (e.g. `maps.google.com`, `yelp.com`).
siteUrls[].urlstringاختياريThe location's page URL on that site. Send `null` or omit to stop monitoring a source that needs an explicit URL.
positiveInteractionThresholdintegerاختياريStar rating at or above which a review counts as positive. Sent on its own, it leaves the source selection untouched.

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

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

Request body
{  "locationId": "TG9jYXRpb246MTgwMDI4OQ==",  "positiveInteractionThreshold": 4,  "siteUrls": [    { "name": "maps.google.com", "url": null },    { "name": "yelp.com", "url": "https://www.yelp.com/biz/blue-bottle-coffee-oakland" }  ]}

الاستجابات

200Settings applied. `data.editInteractionsSetting.interactionSetting` returns the stored settings; `errors` is `null` on success.
Response
{  "data": {    "editInteractionsSetting": {      "errors": null,      "interactionSetting": {        "id": "1800289",        "locationId": "1800289",        "positiveInteractionThreshold": 4,        "siteSettings": [          { "name": "maps.google.com", "url": null, "monitored": true, "canRespond": true },          { "name": "yelp.com", "url": "https://www.yelp.com/biz/blue-bottle-coffee-oakland", "monitored": true, "canRespond": false }        ]      }    }  }}
401Unauthenticated, missing or invalid API key.
403The key is valid but not permitted to change review settings for this location (`SY90003`).

يحدّث مصادر التقييمات التي يُراقَب الموقع عليها، والتقييم الذي يُعدّ عنده التقييم إيجابيًا. لقراءة الإعدادات نفسها، استخدم عرض مصادر التقييمات لموقع.

siteUrls يستبدل الاختيار بالكامل، ولا يُجري تحديثًا جزئيًا. تصبح المصفوفة التي ترسلها هي مجموعة المصادر المختارة للموقع. لإضافة مصدر واحد، اقرأ siteSettings الحالي أولًا، ثم أعد إرسال العناصر الموجودة مع العنصر الجديد؛ فإرسال مصفوفة تحتوي على عنصر واحد يُسقط جميع المصادر الأخرى دون تنبيه.

الحقلان مستقلان. أرسل positiveInteractionThreshold فقط لتغيير الحد الأدنى للتقييم دون تعديل المصادر، أو siteUrls فقط لتغيير المصادر دون تعديل الحد الأدنى للتقييم.

تؤدي إضافة مصدر إلى جدولة عملية استخراج بياناته، لذا تصل تقييمات الموقع الإلكتروني المضاف حديثًا بصورة غير متزامنة، ولا تُضمَّن في هذه الاستجابة. يُعاد المصدر الذي يرفضه التحقق من الصلاحية (بسبب عنوان URL يتعذر الوصول إليه، أو لأن خطة الحساب لا تشمل المصدر) ضمن errors مع بقاء الإعداد دون تغيير، لذا تحقّق من errors حتى عند تلقي 200.

حالة استخدام: إعداد صفحة Yelp لموقع

بمجرد إنشاء موقع، تُراقَب مصادره على Google وFacebook تلقائيًا، لكن يجب تحديد صفحة Yelp صراحةً. اقرأ الاختيار الحالي من مسار الإعدادات، وأضف { "name": "yelp.com", "url": "<the location's Yelp URL>" }، ثم أعد إرسال المصفوفة بأكملها مع معرّف الموقع. تُضاف عملية استخراج البيانات إلى قائمة الانتظار فورًا، وتظهر أولى تقييمات Yelp في عرض قائمة التفاعلات بمجرد اكتمالها.

تغيّر نقطة النهاية هذه إعدادات المراقبة الفعلية. الطلب والاستجابة النموذجيان أعلاه مثالان توضيحيان.

Request
curl -X POST 'https://listingsapi.com/api/v4/locations/reviews/settings/edit' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "locationId": "TG9jYXRpb246MTgwMDI4OQ==",    "positiveInteractionThreshold": 4,    "siteUrls": [      {        "name": "maps.google.com",        "url": null      },      {        "name": "yelp.com",        "url": "https://www.yelp.com/biz/blue-bottle-coffee-oakland"      }    ]  }'