POST/api/v4/connected-accounts/trigger-matches

觸發地點比對

擷取已連結帳戶的 Google 和 Facebook 商家檔案,並與您的 Listings API 地點比對。

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

參數

請求主體

名稱類型必填說明
inputobject必填Wrapper object. The entire request body must be nested under `input`.
input.connectedAccountIdsarray of strings必填UUIDs of the connected accounts to trigger matches for. Taken from `GET /connected-accounts`.

請求範例

可直接貼上的請求主體。請將預留位置 ID 與值換成您自己的。

Request body
{  "input": {    "connectedAccountIds": [      "4f712c17-4f95-42dd-90f4-97171a2e67b5"    ]  }}

回應

200Request accepted. `success` is `true` when the fetch-and-match job was queued for every account; accounts that could not be queued are returned in `failedIds` and `success` is `false`.
Response
{  "data": {    "connectedAccountsTriggerMatches": {      "failedIds": null,      "success": true    }  }}
400Bad request, the body was not wrapped in `input` (error message: `Variable "$input" of required type "ConnectedAccountsTriggerMatchesInput!" was not provided`).
401Unauthenticated, missing or invalid API key.

啟動非同步作業,擷取指定的已連結帳戶可存取的所有 Google Business Profile 和 Facebook 商家檔案,並與您的 Listings API 地點比對。success: true 回應表示作業已加入佇列,比對作業本身會在背景執行。

請求格式。 請求主體必須包裝在 input 物件中,其中包含 connectedAccountIds,也就是要比對的已連結帳戶陣列。若傳送未包裝的扁平請求主體,請求會遭到拒絕,並傳回 HTTP 400。請從 GET /connected-accounts 取得帳戶 ID。當 1 個或多個帳戶無法加入佇列時,系統會在 failedIds 中傳回這些帳戶的 ID,且 success 為 false。

使用案例:連結新帳戶後重新整理建議。 客戶完成 Google 連結流程後,請立即使用該帳戶的 connectedAccountId 呼叫 trigger-matches。這會填入建議的地點比對結果,讓您的初始設定介面可以顯示「我們找到了您的 N 筆商家資訊」,而無須讓客戶等待排程同步。

使用案例:新增地點後重新執行比對。 當您為現有的已連結帳戶批次建立新的 Listings API 地點時,請觸發新的比對作業,讓新地點與其現有的 Google/Facebook 商家資訊配對。

由於作業以非同步方式執行,請勿將 200 視為「比對已完成」。請輪詢已連結帳戶的詳細資料端點,等待 requestMatchesStatus 變為 MATCH_COMPLETED,然後從 connection-suggestions 端點讀取結果,再呼叫 confirm-matches 或 connect-listing。

此端點會將向 Google/Facebook 即時擷取資料的作業加入佇列。上述請求格式與範例回應是根據 API 規格記載;此呼叫並未針對正式環境資料執行。

Request
curl -X POST 'https://listingsapi.com/api/v4/connected-accounts/trigger-matches' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "input": {      "connectedAccountIds": [        "4f712c17-4f95-42dd-90f4-97171a2e67b5"      ]    }  }'