/api/v4/connected-accounts/connect-listingHubungkan profil bisnis ke lokasi
Menghubungkan profil bisnis tertentu di Google Business Profile atau Facebook ke lokasi Listings API.
Parameter
Body
| Nama | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| input | object | wajib | Wrapper object. The entire request body must be nested under `input`. |
| input.locationId | string | wajib | Base64-encoded location Relay ID (e.g. `TG9jYXRpb246MTgwMDI4OQ==`) of the Listings API location to link the listing to. |
| input.connectedAccountId | string | wajib | ID of the connected account (Google or Facebook) that owns the listing. Taken from `GET /connected-accounts`. |
| input.connectedAccountListingId | string | wajib | ID of the listing within that connected account to link. Taken from the `id` of a record returned by `POST /connected-accounts/connected-account-listings`. |
Contoh permintaan
Body siap tempel. Ganti ID dan nilai placeholder dengan milik Anda.
{ "input": { "locationId": "TG9jYXRpb246MTgwMDI4OQ==", "connectedAccountId": "4f712c17-4f95-42dd-90f4-97171a2e67b5", "connectedAccountListingId": "R29vZ2xlTG9jYXRpb246ODc3NTkzNGItNTA5OC00ZDBhLThiNDQ=" }}Respons
200Request accepted. `success` is `true` when the listing was linked; when it cannot be linked `success` is `false` and `message` explains why (for example, `Listing record not found`).
{ "data": { "connectListing": { "message": null, "success": true } }}400Bad request, the body was not wrapped in `input`, or a required field was omitted. Note the field is `connectedAccountListingId`, not `listingId` (the API rejects `listingId` with `did you mean locationId?`).
401Unauthenticated, missing or invalid API key.
Mengaitkan profil bisnis di platform publikasi (Google Business Profile atau Facebook Page) dengan lokasi Listings API agar data profil bisnis tetap tersinkronisasi. Berbeda dengan alur berbasis saran, endpoint ini menghubungkan satu profil bisnis yang telah Anda pilih tanpa memerlukan langkah konfirmasi kecocokan.
Struktur permintaan. Isi permintaan harus dibungkus dalam objek input dengan tiga field wajib: locationId (Relay ID lokasi yang dikodekan dalam base64), connectedAccountId (akun yang memiliki profil bisnis), dan connectedAccountListingId (profil bisnis tertentu yang akan dihubungkan). Tidak ada field listingId; field tersebut ditolak oleh skema. Ambil connectedAccountId dari GET /connected-accounts dan connectedAccountListingId dari id pada rekaman yang dikembalikan oleh POST /connected-accounts/connected-account-listings.
Kasus penggunaan: menghubungkan secara manual saat hasil pencocokan otomatis ambigu. Dua toko yang berdekatan memiliki nama serupa dan trigger-matches tidak dapat menentukan profil bisnis Google mana yang terkait dengan masing-masing lokasi Listings API. Ambil profil bisnis untuk akun yang terhubung, minta operator memilih profil bisnis yang benar, lalu hubungkan langsung dengan endpoint ini tanpa melalui alur saran/konfirmasi sama sekali.
Jika koneksi gagal, respons mengembalikan success: false dengan message bernilai non-null yang menjelaskan alasannya, misalnya, Listing record not found ketika connectedAccountListingId tidak dapat ditemukan, atau pesan yang menunjukkan bahwa profil bisnis sudah terhubung ke lokasi lain. Untuk menerima kecocokan yang disarankan sistem secara massal sebagai alternatif, gunakan endpoint confirm-matches.
curl -X POST 'https://listingsapi.com/api/v4/connected-accounts/connect-listing' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "locationId": "TG9jYXRpb246MTgwMDI4OQ==", "connectedAccountId": "4f712c17-4f95-42dd-90f4-97171a2e67b5", "connectedAccountListingId": "R29vZ2xlTG9jYXRpb246ODc3NTkzNGItNTA5OC00ZDBhLThiNDQ=" } }'