Profile Filter Links: patch

認証が必要です

既存のプロファイル フィルタリンクを更新します。このメソッドはパッチのセマンティクスをサポートしています。今すぐ試すまたは例を見る

リクエスト

HTTP リクエスト

PATCH https://www.googleapis.com/analytics/v3/management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/profileFilterLinks/linkId

パラメータ

パラメータ名 説明
パスパラメータ
accountId string プロフィール フィルタリンクが属するアカウントの ID。
linkId string 更新するプロファイル フィルタ リンクの ID。
profileId string フィルタリンクが属するプロファイルの ID
webPropertyId string プロファイル フィルタリンクが属するウェブ プロパティの ID。

認可

このリクエストは、次のスコープでの承認が必要です(認証と承認の詳細をご確認ください)。

スコープ
https://www.googleapis.com/auth/analytics.edit

リクエスト本文

パッチの動作規則に従って、プロファイル フィルタ リンク リソースの関連する部分をリクエスト本文に含めます。

レスポンス

正常に終了した場合、このメソッドによってプロファイル フィルタリンク リソースを含むレスポンスの本文が返されます。

注: このメソッドで使用可能なコード例では、サポートされているプログラミング言語すべての例を示しているわけではありません(サポートされている言語の一覧については、クライアント ライブラリ ページをご覧ください)。

Java

Java クライアント ライブラリを使用します。

/*
 * Note: This code assumes you have an authorized Analytics service object.
 * See the Filters Developer Guide for details.
 */

/*
 * This request patches an existing profile filter link.
 */

// Construct the filter reference.
FilterRef filterRef = new FilterRef();
filterRef.setId("1223334444");

// Construct the body of the request.
ProfileFilterLink body = new ProfileFilterLink();
body.setFilterRef(filterRef);

try {
analytics.management().profileFilterLinks().patch("123456",
    "UA-123456-1", "7654321", "1122334455", body).execute();
} catch (GoogleJsonResponseException e) {
  System.err.println("There was a service error: "
      + e.getDetails().getCode() + " : "
      + e.getDetails().getMessage());
}

Python

Python クライアント ライブラリを使用します。

# Note: This code assumes you have an authorized Analytics service object.
# See the Filters Developer Guide for details.

# This request patches an existing profile filter link.
try:
  analytics.management().profileFilterLinks().patch(
      accountId='123456',
      webPropertyId='UA-123456-1',
      profileId='7654321',
      linkId='11223344',
      body={
          'filterRef': {
              'id': '1223334444'
              }
      }
  ).execute()

except TypeError, error:
  # Handle errors in constructing a query.
  print 'There was an error in constructing your query : %s' % error

except HttpError, error:
  # Handle API errors.
  print ('There was an API error : %s : %s' %
         (error.resp.status, error.resp.reason))

試してみよう:

以下の API Explorer を使用して、ライブデータに対してこのメソッドを呼び出し、レスポンスを確認してください。 または、スタンドアロンの Explorer をお試しください。