POST/api/v4/connected-accounts/connect-listing

将商家信息连接到地点

将特定的 Google Business Profile 或 Facebook 商家信息连接到 Listings API 地点。

需要 API 密钥。请求头格式和密钥轮换请参阅身份验证。

参数

请求体

名称类型必填描述
inputobject必填Wrapper object. The entire request body must be nested under `input`.
input.locationIdstring必填Base64-encoded location Relay ID (e.g. `TG9jYXRpb246MTgwMDI4OQ==`) of the Listings API location to link the listing to.
input.connectedAccountIdstring必填ID of the connected account (Google or Facebook) that owns the listing. Taken from `GET /connected-accounts`.
input.connectedAccountListingIdstring必填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`.

请求示例

可直接粘贴的请求体。请将占位 ID 和值替换为您自己的。

Request body
{  "input": {    "locationId": "TG9jYXRpb246MTgwMDI4OQ==",    "connectedAccountId": "4f712c17-4f95-42dd-90f4-97171a2e67b5",    "connectedAccountListingId": "R29vZ2xlTG9jYXRpb246ODc3NTkzNGItNTA5OC00ZDBhLThiNDQ="  }}

响应

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`).
Response
{  "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.

将发布平台上的商家信息(Google Business Profile 或 Facebook Page)与 Listings API 地点关联,以保持商家信息数据同步。与基于建议的流程不同,此端点会连接您已选定的单条商家信息,无需执行匹配确认步骤。

请求结构。 请求体必须封装在 input 对象中,并包含 3 个必填字段:locationId(经过 base64 编码的地点 Relay ID)、connectedAccountId(拥有该商家信息的已连接账户)和 connectedAccountListingId(要连接的特定商家信息)。请求中没有 listingId 字段,schema 会拒绝它。从 GET /connected-accounts 获取 connectedAccountId,并从 POST /connected-accounts/connected-account-listings 返回的记录的 id 中获取 connectedAccountListingId。

使用场景:自动匹配结果不明确时手动连接。 2 家相邻门店的名称相似,trigger-matches 无法判断哪条 Google 商家信息属于哪个 Listings API 地点。获取已连接账户下的商家信息,让操作人员选择正确的一条,然后通过此端点直接连接,完全跳过建议/确认流程。

如果连接失败,响应会返回 success: false,并包含非 null 的 message 来说明原因,例如,当 connectedAccountListingId 无法解析时返回 Listing record not found,或返回一条消息,说明该商家信息已连接到另一个地点。如果您希望批量接受系统建议的匹配,请使用 confirm-matches 端点。

Request
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="    }  }'