/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 の掲載情報がまだまったく存在しない場合に使用します。
リクエストの形式。 リクエストボディは、locationId(base64 エンコードされた拠点の Relay ID)と connectedAccountId(掲載情報を作成する Google アカウント)の 2 つの必須フィールドを持つ 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" } }'