
BBAuth described above satisfies both user authentication and application authentication requirements. See the BBAuth documentation on how to obtain the cookie and WSSID needed to access the Address Book XML/JSON API.
The following example shows how to authenticate users and the application.
$appid = // The application ID registered with YDN
$cookie = // The cookie obtained from the login WS
$wssid = // The WSSID string obtained from the login WS
$url = "http://address.yahooapis.com/v1/searchContacts?format=json
&fields=name&email.is=happy.user%40yahoo.com";
$url .= "&appid=$appid&WSSID=$wssid";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Cookie: $cookie"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);