POST/api/v4/locations/reviews/settings/edit

拠点のレビュー設定を編集する

拠点の監視対象となるレビューソースと、肯定的なレビューの判定しきい値を設定します。

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

パラメーター

ボディ

必須と示されたネストされたフィールドは、その親フィールドを送信する場合にのみ適用されます。親フィールドが任意で省略した場合、その必須の子フィールドは適用されません。

名前型必須説明
locationIdstring必須Location to update, as its Base64-encoded Relay ID (e.g. `TG9jYXRpb246MTgwMDI4OQ==`). This is a body field, so unlike path parameters a raw numeric ID is not converted and fails with `SY90002: Invalid Id`.
siteUrlsarray任意The complete set of review sources for the location. This REPLACES the current selection, so send every source you want kept, not just the additions.
siteUrls[].namestring任意Site key, as returned in `siteSettings[].name` (e.g. `maps.google.com`, `yelp.com`).
siteUrls[].urlstring任意The location's page URL on that site. Send `null` or omit to stop monitoring a source that needs an explicit URL.
positiveInteractionThresholdinteger任意Star rating at or above which a review counts as positive. Sent on its own, it leaves the source selection untouched.

リクエストの例

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

Request body
{  "locationId": "TG9jYXRpb246MTgwMDI4OQ==",  "positiveInteractionThreshold": 4,  "siteUrls": [    { "name": "maps.google.com", "url": null },    { "name": "yelp.com", "url": "https://www.yelp.com/biz/blue-bottle-coffee-oakland" }  ]}

レスポンス

200Settings applied. `data.editInteractionsSetting.interactionSetting` returns the stored settings; `errors` is `null` on success.
Response
{  "data": {    "editInteractionsSetting": {      "errors": null,      "interactionSetting": {        "id": "1800289",        "locationId": "1800289",        "positiveInteractionThreshold": 4,        "siteSettings": [          { "name": "maps.google.com", "url": null, "monitored": true, "canRespond": true },          { "name": "yelp.com", "url": "https://www.yelp.com/biz/blue-bottle-coffee-oakland", "monitored": true, "canRespond": false }        ]      }    }  }}
401Unauthenticated, missing or invalid API key.
403The key is valid but not permitted to change review settings for this location (`SY90003`).

拠点の監視対象となるレビューソースと、肯定的なレビューとみなす評価を更新します。同じ設定を読み取るには、拠点のレビューソースを一覧表示するを使用します。

siteUrlsは差分更新ではなく、全体の置き換えです。 送信した配列が、その拠点で選択されているソースになります。ソースを1つ追加するには、まず現在のsiteSettingsを読み取り、既存のエントリに新しいエントリを加えて再送信してください。要素が1つだけの配列を送信すると、ほかのすべてのソースがエラーにならずに削除されます。

この2つのフィールドは独立しています。ソースを変更せずにしきい値を変更するにはpositiveInteractionThresholdのみを送信し、しきい値を変更せずにソースを変更するにはsiteUrlsのみを送信してください。

ソースを追加すると、そのソースのスクレイピングがスケジュールされるため、新しく追加したサイトのレビューはこのレスポンスには含まれず、非同期で取得されます。検証で拒否されたソース(アクセスできないURLや、アカウントのプランに含まれていないソース)は、設定が変更されないままerrorsに含まれて返されるため、200の場合でもerrorsを確認してください。

ユースケース:拠点のYelpページを登録する

拠点の作成直後から、GoogleとFacebookのソースは自動的に監視されますが、Yelpページは明示的に指定する必要があります。設定用のルートから現在選択されているソースを読み取り、{ "name": "yelp.com", "url": "<the location's Yelp URL>" }を追加して、配列全体を拠点のIDとともに再送信してください。スクレイピングはすぐにキューに追加され、完了すると最初のYelpレビューがインタラクションを一覧表示するに表示されます。

このエンドポイントは、本番の監視設定を変更します。上記のサンプルリクエストとレスポンスは例です。

Request
curl -X POST 'https://listingsapi.com/api/v4/locations/reviews/settings/edit' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "locationId": "TG9jYXRpb246MTgwMDI4OQ==",    "positiveInteractionThreshold": 4,    "siteUrls": [      {        "name": "maps.google.com",        "url": null      },      {        "name": "yelp.com",        "url": "https://www.yelp.com/biz/blue-bottle-coffee-oakland"      }    ]  }'