Home | Index

Address Book XML/JSON API Developer Guide

Example (XML)

In this example the application submits an update and at the same time retrieves updates. This example is identical to the previous example, except that it uses XML instead of JSON.

The Request follows:

POST http://address.yahooapis.com/v1/synchronize
   ?format=xml
   &myrev=43
<sync-request>
  <add-contact>
    <add-name>
      <first>Jane</first>
      <last>Bishop</last>
    </add-name>
    <add-phone mobile="true">415-205-9999</add-phone>
    <add-to-category>Mobile_Friends</add-to-category>
  </add-contact>
</sync-request>

Here is the Response, which includes the confirmation and two change events, the second of which was caused by the request itself:

<sync-response lmt="1168961062" rev="46">
  <category catid="7">Messenger_Buddies</category>
  <category catid="23">Family</category>
  <category catid="599">Mobile_Friends</category>
  <success add-action="add" cid="543" />
  <update-contact cid="511">
    <name fid="512">
      <first>John</first>
      <last>Smith</last>
    </name>
  </update-contact>
  <update-contact cid="543">
    <name fid="600">
      <first>Jane</first>
      <last>Bishop</last>
    </name>
    <phone mobile="true" fid="523">415-205-9999</phone>
    <yahooid fid="524">jane.bishop</yahooid>
    <category catid="599" />
  </update-contact>
</sync-response>