/api/v4/connected-accounts/connect-listing등록 정보를 사업장에 연결
특정 Google Business Profile 또는 Facebook 등록 정보를 Listings API 사업장에 연결합니다.
매개변수
본문
| 이름 | 유형 | 필수 | 설명 |
|---|---|---|---|
| input | object | 필수 | Wrapper object. The entire request body must be nested under `input`. |
| input.locationId | string | 필수 | Base64-encoded location Relay ID (e.g. `TG9jYXRpb246MTgwMDI4OQ==`) of the Listings API location to link the listing to. |
| input.connectedAccountId | string | 필수 | ID of the connected account (Google or Facebook) that owns the listing. Taken from `GET /connected-accounts`. |
| input.connectedAccountListingId | string | 필수 | 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와 값을 실제 값으로 바꾸세요.
{ "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`).
{ "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 사업장과 연결하여 등록 정보 데이터가 동기화된 상태로 유지되도록 합니다. 연결 제안 기반 흐름과 달리, 이 엔드포인트는 이미 선택한 등록 정보 1개를 연결하며 매칭 확인 단계가 필요하지 않습니다.
요청 구조. 본문은 필수 필드 3개인 locationId(base64로 인코딩된 사업장 Relay ID), connectedAccountId(등록 정보를 소유한 계정), connectedAccountListingId(연결할 특정 등록 정보)를 포함하는 input 객체로 감싸야 합니다. 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 엔드포인트를 사용합니다.
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=" } }'