Profile Filter Links: list

مطلوب تفويض

يعرض جميع روابط فلاتر الملف الشخصي. جرِّب ذلك الآن أو اطّلِع على مثال.

طلب

طلب HTTP

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

المَعلمات

اسم المعلَمة القيمة الوصف
معلّمات المسار
accountId string رقم تعريف الحساب لاسترداد روابط فلاتر الملفات الشخصية لأجل.
profileId string معرّف الملف الشخصي لاسترداد روابط الفلاتر يمكن أن يكون معرّف ملف شخصي محدد أو '~'، والذي يشير إلى جميع الملفات الشخصية التي يمكن للمستخدم الدخول إليها.
webPropertyId string معرّف الموقع الإلكتروني لروابط فلتر الملف الشخصي. يمكن أن يكون معرّف موقع إلكتروني معيّن أو '~all'، والذي يشير إلى جميع مواقع الويب التي يمكن للمستخدم الوصول إليها.
معلَمات طلب البحث الاختيارية
max-results integer الحد الأقصى لعدد روابط فلاتر الملفات الشخصية التي يمكن تضمينها في هذه الاستجابة.
start-index integer فهرس للكيان الأول المطلوب استرداده. استخدِم هذه المعلّمة كآلية للتقسيم على صفحات إلى جانب المعلّمة max-results.

التفويض

ويتطلب هذا الطلب تفويضًا باستخدام نطاق واحد على الأقل من النطاقات التالية (مزيد من المعلومات عن المصادقة والتفويض).

النطاق
https://www.googleapis.com/auth/analytics.edit
https://www.googleapis.com/auth/analytics.readonly

نص الطلب

لا توفِّر نص طلب بهذه الطريقة.

الإجابة

إذا نجحت، ستعرض هذه الطريقة نص استجابة بالبنية التالية:

{
  "kind": "analytics#profileFilterLinks",
  "username": string,
  "totalResults": integer,
  "startIndex": integer,
  "itemsPerPage": integer,
  "previousLink": string,
  "nextLink": string,
  "items": [
    management.profileFilterLinks Resource
  ]
}
اسم الموقع القيمة الوصف ملاحظات
kind string نوع المجموعة
username string رقم تعريف البريد الإلكتروني للمستخدم الذي تمت المصادقة عليه
totalResults integer إجمالي عدد نتائج طلب البحث، بغض النظر عن عدد النتائج في الاستجابة.
startIndex integer فهرس البداية للموارد، وهو تلقائيًا 1 أو المُحدَّدة في معلَمة طلب البحث لفهرس البدء.
itemsPerPage integer الحد الأقصى لعدد الموارد التي يمكن أن تحتوي عليها الاستجابة، بغض النظر عن العدد الفعلي للموارد المعروضة. وتتراوح قيمتها بين 1 و1000 مع قيمة 1000 تلقائيًا، أو كما هو محدّد من خلال مَعلمة طلب البحث لتحقيق الحد الأقصى من النتائج.
items[] list قائمة بروابط فلاتر الملفات الشخصية.

أمثلة

ملاحظة: إنّ الأمثلة المرتبطة بالرموز والمتوفرة لهذه الطريقة لا تمثّل كل لغات البرمجة المتوافقة (يُرجى مراجعة صفحة مكتبات البرامج للاطّلاع على قائمة باللغات المتوافقة).

Java

يستخدم مكتبة برامج Java.

/*
 * 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.

# 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')

جرِّب هذه الميزة الآن.

استخدِم "مستكشف واجهات برمجة التطبيقات" أدناه لطلب هذه الطريقة في البيانات المباشرة والاطّلاع على الاستجابة. يمكنك بدلاً من ذلك تجربة المستكشف المستقل.