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。当一个或多个账户无法加入队列时,其 ID 会在 failedIds 中返回,且 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"      ]    }  }'