Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Profile List Feed

NOTE: This feed is only available when using ClientLogin

Since ClientLogin requires a profile ID with each of its feeds, applications will likely want to query this feed first in order to select the appropriate profile. The profile list feed returns Atom entries corresponding each profile in the user's Google Health account. The profile ID is returned in the Atom <content> and the profile name in the <title> element.

Query The Feed

To execute a query against the profile list feed, call the service's getHealthProfileListFeed() method:

$healthService = new Zend_Gdata_Health($client);
$feed $healthService->getHealthProfileListFeed();

// print each profile's name and id
$entries $feed->getEntries();
foreach (
$entries as $entry) {
'<p>Profile name: ' $entry->getProfileName() . '<br>';
'profile ID: ' $entry->getProfileID() . '</p>';

Once you've determined which profile to use, call setProfileID() with the profileID as an argument. This will restrict subsequent API requests to be against that particular profile:

// use the first profile
$profileID $feed->entry[0]->getProfileID();

$profileFeed $healthService->getHealthProfileFeed();

$profileID $healthService->getProfileID();
'<p><b>Queried profileID</b>: ' $profileID '</p>';

Zend Framework