/api/v4/locations/oauth-disconnect中斷單一地點與發布平台的連線
切斷單一地點與發布平台的連線,對應個別地點的 OAuth 連結網址。
參數
請求主體
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
| 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 連結網址啟動的個別地點 OAuth 流程中,負責中斷連線的部分。
此路由與中斷商家資訊與地點的連線是透過兩個路徑提供的相同操作:兩者接受完全相同的 input 主體,且都將結果放在 disconnectConnectedAccountsLocations 下傳回,而非放在任一路徑的名稱下。您可以選擇在整合中較易理解的路徑;兩者的行為沒有差異。
主體必須包在 input 中,並包含單一 locationId,以及 site 或 providerId 其中之一,以指定要切斷哪個連線。兩者皆未傳送時,會傳回 SY10056(「Site is not valid for the location disconnection」);若地點沒有與該網站的有效連線,則會傳回 SY10057,而不會直接回報成功,因此 success: true 確實表示已移除連線。這不是批次端點,因此若要處理多個地點,請逐一呼叫。若要一次中斷整個帳戶中所有地點的連線,請改用批次中斷 Google 帳戶連線。
使用案例:復原連結錯誤的操作
當使用者將發布平台上錯誤的商家資訊連結至商店時,請在此將 site 設為該發布平台並中斷連線,然後讓使用者再次透過連結網址操作(或執行 trigger-matches 和連結商家資訊),以連結正確的商家資訊。中斷連線後,地點及其資料會保持完整;只有向該發布平台的對外同步會停止。
使用案例:客戶離開並帶走自己的 Apple Business 帳戶
使用 site: "APPLE" 後,地點將停止透過擁有者的 Apple Business 帳戶發布。該地點仍會保留在 Apple Maps 上:後續更新會透過 ListingsAPI 的 Apple Business Connect 帳戶發布,而 Apple 會先驗證提交內容,再進行發布。若要再次透過擁有者的帳戶發布,請透過為單一地點建立 OAuth 連結網址取得新連結,並傳送給擁有者。
此端點會變更實際運作中的連線。上方的範例請求與回應僅供示範。
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" } }'