This URI gives you access to the categories to which the specified contact belongs.
Use the following URI to get all of the categories for a contact identified by
the {cid} value. To obtain the {cid} value, run the HTTP GET operation to obtain a Contact Object. See the Contacts section for details.
For example, suppose that Pete (identified by {guid}) has an address book with multiple categories. Some of the categories have an entry for Sam (he's uniquely identified by {cid}). This would occur if, for example, Sam is a member of the Football as well as College Friends categories. In that case, the URI points to those two categories in Pete's address book since each one contains an entry for Sam. To use the URI below you would need your own GUID and Sam's CID.
If the HTTP GET operation succeeds, the call responds with a collection of
Category Objects. The Example JSON Body for GET Categories shows the structure of the collection as an array of Category Objects.
http://social.yahooapis.com/v1/user/{guid}/contact/{cid}/categories
GETPOSTformatNot available.
GET: Read Yahoo! Contacts
POST: Write Yahoo! Contacts
When you make a JSON request for a collection of categories, the information will be returned as an array of Category Objects.
See also JSON Body For GET Categories By CID.
See also Example XML Response Body for GET Categories.
| Element | JSON Data Type | XML Schema Data Type | Required for Write? | Read Only? | Description |
|---|---|---|---|---|---|
start
|
number | nonNegativeInteger | No | Yes | Index of the first category returned. |
count
|
number | nonNegativeInteger | No | Yes | Number of categories returned. |
total
|
number | nonNegativeInteger | No | Yes | Total number of categories available. |
uri
|
string | anyURI | No | Yes | A link to the actual resource. |
created
|
string | dateTime | No | Yes | 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 | No | Yes | 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 |
category
|
Category Object | Category Object | Yes | No | An collection of Category Objects. |
The following sample responses show what two categories would look like. The responses
reveal that the particular contact (uniquely identified by CID 5) is a member of the two
categories BookClub and Clowns. If there were any
more categories (for example, RingMasters,
ShowGirls, Acrobats), they would be added to the
category array of blocks just as BookClub and
Clowns are laid out. The total number of categories is the value of the
total field.
This example shows the JSON response body returned when making a request for a contact's categories with the following URI:
http://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/contact/5/categories?format=json
This example shows the XML response body returned when making a request for a contact's categories with the following URI:
http://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/contact/5/categories