/api/v4/locations/oauth-disconnect断开单个地点与发布平台的连接
断开单个地点与发布平台的连接,是按地点 OAuth 连接 URL 对应的断开操作。
参数
请求体
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| input | object | 必填 | Wrapper object. The entire request body must be nested under `input`. |
| input.locationId | string | 必填 | Base64-encoded Relay ID of the one location to disconnect. |
| input.site | string | 可选 | Publisher to disconnect from: `GOOGLE`, `FACEBOOK`, or `APPLE`. Required unless you send `providerId`. |
| input.providerId | string | 可选 | The publisher's own account identifier, as an alternative to `site`. Required unless you send `site`. |
请求示例
可直接粘贴的请求体。请将占位 ID 和值替换为您自己的。
{ "input": { "locationId": "TG9jYXRpb246MTgwMDI4OQ==", "site": "GOOGLE" }}响应
200Connection removed. Response key `disconnectConnectedAccountsLocations`.
{ "data": { "disconnectConnectedAccountsLocations": { "clientMutationId": null, "success": true, "errors": null } }}401Unauthenticated, missing or invalid API key.
403The key is valid but not permitted to disconnect this location (`SY90003`).
移除单个地点与发布平台的连接。它是由为单个地点创建 OAuth 连接 URL启动的按地点 OAuth 流程中负责断开连接的部分。
此路由与断开商家信息与地点的连接是通过两个路径提供的同一操作:两者接受完全相同的 input 请求体,且都在 disconnectConnectedAccountsLocations 下返回结果,而不是在任一路径名称下返回结果。请选择在您的集成中更易于理解的路径;两者的行为没有区别。
请求体必须封装在 input 中,并包含单个 locationId,以及 site 或 providerId,以指定要断开的连接。两者均未发送时,会返回 SY10056(“Site is not valid for the location disconnection”);如果地点与该站点之间没有有效连接,则会返回 SY10057,而不会静默返回成功,因此 success: true 确实表示已移除一条连接。这不是批量端点,因此要处理多个地点,请循环调用。要一次性断开整个账户下所有地点的连接,请改用批量断开 Google 账号的连接。
使用场景:撤销连错的连接
当用户将发布平台上错误的商家信息连接到门店时,请在此处将 site 设置为该发布平台以断开连接,然后让用户重新通过连接 URL 操作(或运行 trigger-matches 和连接商家信息),以连接正确的商家信息。断开连接会完整保留地点及其数据;仅停止向该发布平台同步。
使用场景:客户离开并带走其 Apple Business 账户
使用 site: "APPLE" 后,该地点将停止通过所有者的 Apple Business 账户发布。该地点仍会保留在 Apple Maps 上:后续更新将通过 ListingsAPI Apple Business Connect 账户发布,Apple 会在发布前验证提交内容。要再次通过所有者的账户发布,请向其发送通过为单个地点创建 OAuth 连接 URL生成的新链接。
此端点会更改正在使用的连接。上方的示例请求和响应仅为示例。
curl -X POST 'https://listingsapi.com/api/v4/locations/oauth-disconnect' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "locationId": "TG9jYXRpb246MTgwMDI4OQ==", "site": "GOOGLE" } }'