Profile Filter Links: list

Yetkilendirme gerektirir

Bir profil için tüm profil filtresi bağlantılarını listeler. Hemen deneyin veya bir örneğe göz atın.

İstek

HTTP isteği

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

Parametreler

Parametre adı Değer Açıklama
Yol parametreleri
accountId string Profil filtresi bağlantılarını almak için kullanılacak hesap kimliği.
profileId string Filtre bağlantılarını alınacak profil kimliği. Belirli bir profil kimliği veya kullanıcının erişebildiği tüm profilleri ifade eden "~all" olabilir.
webPropertyId string Profil filtre bağlantılarının web mülkü kimliği. Belirli bir web mülkü kimliği veya kullanıcının erişebildiği tüm web mülklerini ifade eden '~tümü' olabilir.
İsteğe bağlı sorgu parametreleri
max-results integer Bu yanıta dahil edilecek maksimum profil filtresi bağlantısı sayısı.
start-index integer Alınacak ilk varlığın dizini. Bu parametreyi, max-results parametresiyle birlikte sayfalara ayırma mekanizması olarak kullanın.

Yetkilendirme

Bu istek için aşağıdaki kapsamlardan en az biriyle yetkilendirme gerekir (kimlik doğrulama ve yetkilendirme hakkında daha fazla bilgi edinin).

Kapsam
https://www.googleapis.com/auth/analytics.edit
https://www.googleapis.com/auth/analytics.readonly

İstek içeriği

Bu yöntemle bir istek gövdesi sağlamayın.

Yanıt

Başarılı olursa bu yöntem aşağıdaki yapıya sahip bir yanıt gövdesi döndürür:

{
  "kind": "analytics#profileFilterLinks",
  "username": string,
  "totalResults": integer,
  "startIndex": integer,
  "itemsPerPage": integer,
  "previousLink": string,
  "nextLink": string,
  "items": [
    management.profileFilterLinks Resource
  ]
}
Mülk adı Değer Açıklama Notlar
kind string Koleksiyon türü.
username string Kimliği doğrulanan kullanıcının e-posta kimliği
totalResults integer Yanıttaki sonuç sayısından bağımsız olarak sorgu için toplam sonuç sayısı.
startIndex integer Kaynakların başlangıç dizini (varsayılan olarak 1'dir veya başlangıç dizini sorgu parametresi tarafından başka şekilde belirtilir).
itemsPerPage integer Döndürülen gerçek kaynak sayısından bağımsız olarak yanıtın içerebileceği maksimum kaynak sayısı. Bu parametrenin değeri, varsayılan olarak 1.000 değeriyle 1 ile 1.000 arasında değişir veya max-results sorgu parametresiyle belirlenir.
items[] list Profil filtresi bağlantılarının listesi.

Örnekler

Not: Bu yöntem için kullanıma sunulan kod örnekleri, desteklenen tüm programlama dillerini kapsamaz (Desteklenen dillerin listesi için istemci kitaplıkları sayfasını inceleyin).

Java

Java istemci kitaplığı'nı kullanmalıdır.

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

/*
 * Example #1:
 * Requests a list of all profile filter links for the authorized user.
 */
try {
  ProfileFilterLinks filterLinks = analytics.management().
      profileFilterLinks().list("123456", "UA-123456-1",
          "7654321").execute();

} catch (GoogleJsonResponseException e) {
  System.err.println("There was a service error: "
      + e.getDetails().getCode() + " : "
      + e.getDetails().getMessage());
}

/*
 * Example 2:
 * The results of the list method are stored in the filterLinks object.
 * The following code shows how to iterate through them.
 */
for (ProfileFilterLink link : filterLinks.getItems()) {
  System.out.println("Link Id = " + link.getId());
  System.out.println("Link Kind = " + link.getKind());

  // Get the profile reference.
  ProfileRef profileRef = link.getProfileRef();
  System.out.println("Profile Id = " + profileRef.getId());
  System.out.println("Profile Kind = " + profileRef.getKind());
  System.out.println("Profile Account Id = " + profileRef.getAccountId());
  System.out.println("Profile Property Id = " + profileRef.getWebPropertyId());
  System.out.println("Profile Name = " + profileRef.getName());

  // Get the filter reference.
  FilterRef filterRef = link.getFilterRef();
  System.out.println("Filter Id = " + filterRef.getId());
  System.out.println("Filter Account Id = " + filterRef.getAccountId());
  System.out.println("Filter Name = " + filterRef.getName());
}

Python

Python istemci kitaplığını kullanır.

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

# Example #1:
# Requests a list of all profile filter links for the authorized user.
try:
  filterLinks = analytics.management().profileFilterLinks().list(
      accountId='123456'
      webPropertyId='UA-123456-1',
      profileId='7654321'
  ).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))


# Example #2:
# The results of the list method are stored in the filterLinks object.
# The following code shows how to iterate through them.
for link in filterLinks.get('items', []):
  print 'Link Id = %s' % link.get('id')
  print 'Link Kind = %s' % link.get('kind')

  # Get the profile reference.
  profileRef = link.get('profileRef', {})
  print 'Profile Id = %s' % profileRef.get('id')
  print 'Profile Kind = %s' % profileRef.get('kind')
  print 'Profile Account Id = %s' % profileRef.get('accountId')
  print 'Profile Property Id = %s' % profileRef.get('webPropertyId')
  print 'Profile Name = %s' % profile.get('name')

  # Get the filter reference.
  filterRef = link.get('filterRef', {})
  print 'Filter Id = %s' % filterRef.get('id')
  print 'Filter Account Id = %s' % filterRef.get('accountId')
  print 'Filter Name = %s' % filterRef.get('name')

Deneyin.

Canlı verilerde bu yöntemi çağırmak ve yanıtı görmek için aşağıdaki API Gezgini'ni kullanın. Alternatif olarak, bağımsız Gezgin'i deneyin.