Contacts
Description
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. Write access to the Contacts API must be requested
through the YDN Contact Form.
URI
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
HTTP Operations Supported
GETPOST-
PUT
Query Parameters Supported
formatview
Allowed values for the view parameter:
Matrix Parameters Supported
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
Scopes Required
GET:Read Yahoo! ContactsPOST:Write Yahoo! ContactsPUT:Write Yahoo! Contacts
Elements of the Contacts Object
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. |
JSON Syntax for Contacts Object for GET
Example JSON Response for GET Contacts
Example XML Response for GET Contacts
Example JSON Response for GET Single Contact
This example illustrates the structure of a JSON response for a single contact object. To make this request, you only need to provide your own GUID and specify the format JSON with the following URL:
http://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/contacts?format=json
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.
- The contact is not a connection because the
isConnectionfield value isfalse. - The first
idvalue, 2, is the CID. (Note: Theidtag provides different information, depending on its placement. It may represent a CID or a FID value.)
- About the first Field Object:
- The
urivalue states the location of this field resource. - The
idvalue is 1. This is its FID value. - The field
typeisnicknameand its value is HeadClown.
- The
- About the second Field Object:
- The field
typeisaddress. Its values are subfields that define the contact's residence address. - The
flagsfield value isHOME. If the contact has more than one address, theflagsvalue will help to distinguish them.
- The field
- About the Category Object:
- There is only one category, and this contact is placed under the category name CLOWNS.
Example XML Response for GET Single Contact
This example illustrates the structure of an XML response for a single contact object. To make this request, you only need to provide your own GUID. Since the format is not specified, the response will be in XML, which is the default.
http://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/contacts

