/api/v4/locations/reviews/respondMenanggapi interaksi
Memposting tanggapan publik terhadap ulasan atau interaksi di platform asalnya.
Parameter
Body
| Nama | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| interactionId | string | wajib | 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 | wajib | Text content of the response to post. |
| respondedWith | string | opsional | Response-template ID to attribute the reply to, if it was generated from a template. |
Contoh permintaan
Body siap tempel. Ganti ID dan nilai placeholder dengan milik Anda.
{ "interactionId": "9e26d2a8-a6ed-42ea-8454-47d1c92ea841", "responseContent": "Thank you for visiting Jenny Home: we're glad you enjoyed your experience!"}Respons
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.
Kesalahan umum
- SY50121: Google Reviews accept only a single owner reply per review; a second response is rejected.
Memposting tanggapan terhadap ulasan atau interaksi di platform asalnya (e.g. Google, Facebook). Tanggapan dikirim secara asinkron: interactionStatus langsung bernilai CREATED dan beralih ke COMPLETED atau CONFIRMED setelah platform mengonfirmasi penerimaannya (atau FAILED, lihat alur status tanggapan).
Tidak semua platform mendukung tanggapan pemilik. Periksa canRespond pada objek interaksi sebelum melakukan pemanggilan. Google Reviews hanya menerima satu balasan per ulasan (percobaan berulang mengembalikan SY50121); gunakan Mengedit tanggapan untuk mengubah balasan yang sudah ada alih-alih memposting balasan baru.
Kasus penggunaan: membalas ulasan bintang 5 yang baru secara otomatis
Untuk berterima kasih secara otomatis kepada pemberi ulasan yang puas, lakukan polling pada Daftar interaksi dengan ratingFilters=[5] dan responseStatus=["PENDING"], lalu untuk setiap node yang dikembalikan dengan canRespond bernilai true, lakukan POST dengan id miliknya sebagai interactionId beserta responseContent Anda:
{ "interactionId": "9e26d2a8-a6ed-42ea-8454-47d1c92ea841", "responseContent": "Thank you for visiting Jenny Home: we're glad you enjoyed your experience!"}Karena proses posting bersifat asinkron, ambil ulang interaksi melalui Mendapatkan interaksi berdasarkan ID untuk memastikan tanggapan telah mencapai COMPLETED/CONFIRMED alih-alih mengasumsikan keberhasilan berdasarkan 200.
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!" }'