/api/v4/locations/create/gmb-listing사업장의 GMB 등록 정보 생성
기존 Listings API 사업장에 새 Google Business Profile 등록 정보를 생성하고 연결된 Google 계정에 연결합니다.
매개변수
본문
| 이름 | 유형 | 필수 | 설명 |
|---|---|---|---|
| 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 location to create the Google listing for. |
| input.connectedAccountId | string | 필수 | UUID of the connected Google account the new listing should be created under. Taken from `GET /connected-accounts`. |
| input.folderId | string | 선택 | Google account group to create the listing inside, as the `accounts/{id}` string from the folders endpoint. Omit to create it at the account root. |
요청 예시
바로 붙여 넣을 수 있는 본문입니다. 예시 ID와 값을 실제 값으로 바꾸세요.
{ "input": { "locationId": "TG9jYXRpb246MTgwMDI4OQ==", "connectedAccountId": "4f712c17-4f95-42dd-90f4-97171a2e67b5" }}응답
200Request accepted. `success: true` means GMB listing creation was initiated.
{ "data": { "createGmbListingForLocation": { "clientMutationId": null, "success": true, "errors": null } }}400Bad request, the body was not wrapped in `input` (error message: `Variable "$input" of required type "CreateGmbListingForLocationInput!" was not provided`).
401Unauthenticated, missing or invalid API key.
Listings API 사업장에 완전히 새로운 Google Business Profile 등록 정보를 생성하고 연결된 Google 계정과 연결합니다. Google 계정에 이미 존재하는 등록 정보를 Listings API 사업장에 연결하는 connect-listing과 달리, 사업장에 Google 등록 정보가 아직 전혀 없을 때 사용합니다.
요청 형식. 본문은 필수 필드 2개인 locationId(base64로 인코딩된 사업장 Relay ID)와 connectedAccountId(등록 정보를 생성할 Google 계정)를 포함하는 input 객체로 감싸야 합니다. folderId는 선택 사항이며, 새 등록 정보를 특정 Google 계정 그룹에 배치하려면 폴더 목록 조회에서 가져온 값을 변경하지 않고 전달합니다. 객체로 감싸지 않은 평면 구조의 본문을 보내면 HTTP 400으로 거부됩니다.
생성은 비동기식으로 처리됩니다. success: true는 요청이 수락되었음을 의미하며, 등록 정보가 즉시 공개되었음을 의미하지는 않습니다. Google은 새 프로필이 게시되기 전에 검토합니다.
사용 사례: 신규 매장의 Google 등록 정보 생성. 고객이 아직 Google Business Profile이 없는 새 사업장을 엽니다. Listings API 사업장을 생성하고 고객의 Google 계정을 연결한 다음, 사업장 ID와 connectedAccountId를 사용하여 이 엔드포인트를 호출하면 Listings API가 해당 계정으로 새 등록 정보를 Google에 제출합니다. 이후 사업장의 등록 정보를 폴링하여 대기 상태에서 인증 완료 상태로 전환되는지 확인합니다.
등록 정보를 생성하려면 사업장에 유효한 비즈니스 정보(이름, 주소, 전화번호)가 이미 있어야 하며, 사업장당 Google 등록 정보는 1개만 존재할 수 있습니다. 실패하면 errors에 이유가 설명되며, 일반적으로 사업장에 필수 필드가 누락되었거나, 이미 Google 등록 정보가 있거나, 사업장이 보관 처리되었거나, 연결된 계정이 활성 상태가 아닌 경우입니다. 연결이 유효하지 않은 계정은 connect-google 엔드포인트로 다시 연결합니다. 현재 이 엔드포인트는 connectedAccountId가 실제로 연결된 Google 계정이 아니어도 success: true를 반환하므로, success에만 의존하지 말고 사업장의 등록 정보를 통해 해당 등록 정보가 실제로 표시되는지 확인합니다.
curl -X POST 'https://listingsapi.com/api/v4/locations/create/gmb-listing' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "locationId": "TG9jYXRpb246MTgwMDI4OQ==", "connectedAccountId": "4f712c17-4f95-42dd-90f4-97171a2e67b5" } }'