GET/api/v4/connected-accounts/{connectedAccountId}/connection-suggestions

列出連結建議

傳回已連結帳戶中 Listings API 地點與 Google Business Profile 或 Facebook 商家資訊之間的建議配對。

需要 API 金鑰。標頭格式與金鑰輪替請參閱驗證。

參數

路徑

名稱類型必填說明
connectedAccountIdstring必填UUID of the connected account to list suggestions for.

查詢

名稱類型必填說明預設值
pageinteger選填1-based page number.1
perPageinteger選填Records per page.20

回應

200Paginated list of connection suggestions.
Response
{  "data": {    "connectionSuggestionsForAccount": {      "pageInfo": {        "hasNextPage": false,        "hasPreviousPage": false,        "totalPages": 1,        "totalRecords": 2      },      "records": [        {          "accountEmail": "contact@brightsmile-dental.com",          "accountType": "GMB",          "connectedAccountId": "4f712c17-4f95-42dd-90f4-97171a2e67b5",          "locationId": "73415",          "matchedDataDatabaseId": "0d5e306f-0da0-46e3-929f-fd3c67ccd8cc",          "locationInfo": {            "name": "My Business",            "city": "Lincoln",            "stateIso": "NE"          },          "suggestedLocationInfo": {            "locationInfo": { "name": "My Business", "city": "Lincoln" }          }        }      ]    }  }}
401Unauthenticated, missing or invalid API key.
429Rate limit exceeded. Retry after the `Retry-After` header value.

傳回對已連結帳戶執行配對觸發作業後,偵測到的 Listings API 地點與 Google Business Profile 或 Facebook 商家資訊之間的建議配對。每筆記錄都會顯示 Listings API 地點詳細資料及配對的發布平台商家資訊,讓操作人員在確認前比對兩者。

建議由 POST /connected-accounts/trigger-matches 以非同步方式產生。如果您剛連結帳戶,請先呼叫 trigger-matches,否則 records 會是空的,而 pageInfo.totalRecords 會是 0。(對剛連結且尚無配對的帳戶實際呼叫此端點時,此端點會傳回 {"data":{"connectionSuggestionsForAccount":{"pageInfo":{"hasNextPage":false,"hasPreviousPage":false,"totalPages":0,"totalRecords":0},"records":[]}}}。)上方範例顯示已填入資料的記錄結構。

使用案例:先審核再確認的工作流程。 匯入客戶的 Google 帳戶後,輪詢此端點,以在您自己的審核介面中顯示每個建議配對。操作人員核准正確的配對後,您再將已核准的記錄 ID 傳給 POST /connected-accounts/confirm-matches。

識別記錄。 建議記錄沒有 id 欄位。其識別碼為 matchedDataDatabaseId,也就是底層配對記錄的主鍵;accountType 會指出配對記錄的類型(GMB、FB 或 APPLE)。確認配對 需要這 2 個值來建立其接受的 id,因此當您準備要審核的建議時,請將這 2 個值保留在一起。

分頁與速率限制。 使用扁平的 page 和 perPage 查詢參數分頁(例如 ?page=2&perPage=50),並留意 pageInfo.hasNextPage。此端點沒有 pageInfo、filters、sortBy 或 accountId 參數:已連結帳戶由路徑指定,排序固定依地點資訊遞增排列,您傳送的任何其他參數都會被忽略,而不會遭到拒絕。此端點與其他清單端點一樣受到速率限制;收到 429 時,請延後請求,並等待 Retry-After 標頭值指定的時間後再重試,而不是縮短輪詢間隔。

Request
curl -X GET 'https://listingsapi.com/api/v4/connected-accounts/<connectedAccountId>/connection-suggestions' \  -H "Authorization: API $LISTINGSAPI_KEY"