With the Contacts API, you can obtain and add to the a collection of resources that represent a user's contacts. To retrieve contacts of contacts you will need a separate operation and each contact owner's permission.
When you run a GET operation on this resource, you obtain a collection of Contact Objects. Along with other information, each
Contact Object contains identifiers such as {cid} (Contact
ID), {category-name}, and {fid} (Field ID). You will
need these identifiers in other URIs provided by the Contacts API.
When you run a POST operation on this resource, a Contact Object is written to the URI, thus adding a new contact for the user specified by
the GUID value. The POST operation sends a request in XML or JSON with the new contact's information.
Use the following URI to obtain Contact Objects or add a Contact Object for a user identified by the {guid} value.
http://social.yahooapis.com/v1/user/{guid}/contacts
GETPOSTPUT
format
viewstartcountFor paging with filters, use start and count as matrix parameters.
Allowed values for the view parameter:
If count is not specified, the Contacts API will return 10 contacts. To get the entire list of contacts, use count=max.
See also: Filtering Contacts
GET: Read Yahoo! Contacts
POST: Write Yahoo! Contacts
PUT: Write Yahoo! Contacts
When you make a JSON request for a collection of contacts, the information will be returned as an array of Contact Objects.
See also JSON Syntax for Contact Object.
See also Example JSON Response Body for GET Contacts.
| Element | JSON Data Type | XML Schema Data Type | Description |
|---|---|---|---|
start
|
number | nonNegativeInteger | Index of the first contact returned. |
count
|
number | nonNegativeInteger | Number of contacts returned. |
total
|
number | nonNegativeInteger | Total number of contacts available. |
uri
|
string | anyURI | A link to the actual resource. |
created
|
string | dateTime | This is a system-generated response indicating the date that the object was created. The date is in RFC 3339 format. Example:
Wed, 13 Aug 2008 21:24:09 GMT |
updated
|
string | dateTime | This is a system-generated response indicating the date that the object was modified. The date is in RFC 3339 format. Example:
Wed, 13 Aug 2008 21:24:09 GMT |
contact
|
array of Contact Objects | Zero or more Contact Objects | A collection of Contacts Objects. |
This example illustrates the a JSON example for a single contact object.
This is a partial listing that shows only two fields and the contact's categories. The
fields are nickname and address.
You should observe the following information items about the contact.
isConnection field value is false.
id value, 2, is the CID. (Note: The id tag provides different information,
depending on its placement. It may represent a CID or a FID value.)
uri value states the location of this field resource.
id value is 1. This is its FID value.
type is nickname and its value is
HeadClown.
type is address. Its values are subfields
that define the contact's residence address.
flags field value is HOME. If the contact has
more than one address, the flags value will help to distinguish
them.
This example illustrates the structure of an XML response for a single contact object.