Profile Filter Links: list

इसके लिए, अनुमति लेना ज़रूरी है

किसी प्रोफ़ाइल के सभी प्रोफ़ाइल फ़िल्टर लिंक की सूची बनाता है. इसे अभी आज़माएं या उदाहरण देखें.

अनुरोध

एचटीटीपी अनुरोध

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

पैरामीटर

पैरामीटर का नाम वैल्यू ब्यौरा
पाथ पैरामीटर
accountId string वह खाता आईडी जिसके लिए प्रोफ़ाइल फ़िल्टर के लिंक फिर से पाने हैं.
profileId string वह प्रोफ़ाइल आईडी जिसके लिए फ़िल्टर के लिंक फिर से पाने हैं. यह कोई खास प्रोफ़ाइल आईडी या '~all' हो सकता है. यह उन सभी प्रोफ़ाइलों के बारे में बताता है जिनका ऐक्सेस उपयोगकर्ता के पास होता है.
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,000 वैल्यू के साथ 1 से 1,000 तक की हो सकती है या इसे ज़्यादा से ज़्यादा नतीजे वाले क्वेरी पैरामीटर से तय किया जा सकता है.
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')

इसे आज़माएं!

इस तरीके को लाइव डेटा पर कॉल करने और रिस्पॉन्स देखने के लिए, नीचे दिए गए एपीआई एक्सप्लोरर का इस्तेमाल करें. इसके अलावा, Standalone Explorer का इस्तेमाल भी किया जा सकता है.