POST/api/v4/locations/oauth_connect_url

拠点をApple Business Connectに接続

1 つの拠点用の Apple Business Connect OAuth リンクを作成し、ListingsAPI がオーナーの確認済み Apple Business アカウントを通じてその拠点を Apple Maps に公開できるようにします。

API キーが必要です。ヘッダーの形式とキーのローテーションについては認証を参照してください。

パラメーター

ボディ

名前型必須説明
inputobject必須Wrapper object. The entire request body must be nested under `input`.
input.locationIdstring必須Location to connect. Accepts a Base64-encoded Relay ID (e.g. `TG9jYXRpb246MTgwMDI4OQ==`) or a raw numeric location ID.
input.sitestring必須Set to `APPLE`.
input.successUrlstring必須Absolute URL in your application the owner returns to after granting access.
input.errorUrlstring必須Absolute URL in your application the owner returns to if they cancel or the grant fails.

リクエストの例

そのまま貼り付けられるボディです。プレースホルダーの ID と値をご自身のものに置き換えてください。

Request body
{  "input": {    "locationId": "TG9jYXRpb246MTgwMDI4OQ==",    "site": "APPLE",    "successUrl": "https://app.example.com/locations/1800289/apple/connected",    "errorUrl": "https://app.example.com/locations/1800289/apple/connect-failed"  }}

レスポンス

200A single-use link to send the owner to. `errors` is `null` on success. The `url` shown is a placeholder; send the owner to the `url` returned in your own response.
Response
{  "data": {    "createConnectUrl": {      "success": true,      "url": "https://connect.example.com/oauth?token=8f3c1d92-...",      "errors": null    }  }}
401Unauthenticated, missing or invalid API key.
403The key is valid but not permitted to connect this location (`SY90003`).

ビジネスのオーナーが確認済みの Apple Business 組織アカウントを持っている場合に使用します。オーナーを url に案内すると、オーナーは Apple Business Connect にサインインしてアクセスを許可し、指定した successUrl に戻ります。それ以降、ListingsAPI はオーナーのアカウントを通じて、その拠点の名前、カテゴリ、住所、電話番号、ウェブサイト、営業時間を Apple Maps に公開します。オーナーがキャンセルするか、アクセスの許可に失敗した場合は、errorUrl に戻り、何も接続されません。

オーナーが確認済みの Apple Business 組織アカウントを持っていない場合は、この呼び出しをスキップします。ListingsAPI は自社の Apple Business Connect アカウントを通じて拠点を公開し、Apple は公開前に送信内容を確認します。

Apple では、1 つのリンクにつき 1 つの拠点を接続します。複数の拠点を接続するには、拠点ごとにリンクを作成します。両方のリダイレクト URL は絶対 URL である必要があります。相対 URL または解析できない値の場合は、success: true と null の url が返されるため、リダイレクトする前に url を確認してください。リンクは 1 回限り有効なので、試行ごとに新しいリンクを作成します。

接続を確認する

オーナーが successUrl に戻ったら、publisher=AppleAccount を指定して 接続済みアカウントの一覧を取得する を呼び出します。status が CONNECTED の場合、更新はオーナーのアカウントを通じて行われます。MATCH_IN_PROGRESS または CONNECTIVITY_ISSUE の場合、オーナーは新しい接続リンクを開く必要があります。

オーナーのアカウントを通じた公開を停止するには、拠点と Apple Business Connect の接続を解除する を使用します。Apple Maps の掲載情報の確認方法を含む一連の手順については、Apple Business Connect に接続する を参照してください。

このページでは、1 つの拠点用の OAuth 接続 URL を作成する の site: "APPLE" のケースについて説明します。

このエンドポイントは本番の OAuth 認証情報を作成します。上記のリクエストとレスポンスはサンプルです。

Request
curl -X POST 'https://listingsapi.com/api/v4/locations/oauth_connect_url' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "input": {      "locationId": "TG9jYXRpb246MTgwMDI4OQ==",      "site": "APPLE",      "successUrl": "https://app.example.com/locations/1800289/apple/connected",      "errorUrl": "https://app.example.com/locations/1800289/apple/connect-failed"    }  }'