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ページ)をListings APIの拠点に関連付け、掲載情報のデータを同期した状態に保ちます。候補に基づくフローとは異なり、このエンドポイントは選択済みの1件の掲載情報をリンクするため、マッチング結果を確認する手順は不要です。

リクエストの形式。 リクエストボディはinputオブジェクトでラップし、locationId(base64でエンコードされた拠点のRelay ID)、connectedAccountId(掲載情報を所有するアカウント)、connectedAccountListingId(リンクする掲載情報)の3つの必須フィールドを含めます。listingIdフィールドは存在せず、スキーマによって拒否されます。connectedAccountIdはGET /connected-accountsから取得し、connectedAccountListingIdはPOST /connected-accounts/connected-account-listingsが返すレコードのidから取得します。

ユースケース:自動マッチングで判別できない場合の手動リンク。 近隣の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="    }  }'