Categories

Description

A category name is the user, or system-assigned, label used to group contacts. You can create categories and assign contacts to those categories in applications such as an Yahoo Address Book. For example, suppose that Mike creates a category named Cyclists Club and then adds his cycling contacts to that category. In the following URI, Mike is identified by the {guid}value and the value of {category-name} is Cyclists Club. Similarly, Mike may create categories under which he groups his school classmates, his family members and so forth.

You can use the following URI to get all of the categories that have been entered by the user identified by the {guid} value. When you call the HTTP GET method on this URI, the categories' information is returned in a collection of Category Objects. You can add a new category by calling HTTP POST on the URI and sending a Category Object. For details on the category resource, see Elements of the Category Object.

URI

https://social.yahooapis.com/v1/user/{guid}/categories

HTTP Operations Supported

  • GET
  • POST

Query Parameters Supported

  • format

Matrix Parameters Supported

  • start
  • count

Scopes Required

  • GET: Read Yahoo Contacts
  • POST: Write Yahoo Contacts

Example Responses for GET All Categories

The response content body shows the layout pattern for categories. It reveals that the user, whose GUID is XYZUHL23NH5DGGGGXM, keeps two categories: Clowns and BookClub. The number of categories is contained in the total field.

Note that each category has a unique URI and identifier: uri and id, respectively.

Example JSON Response for GET All Categories

This example shows how to make a request for all of a user's categories and send the response in JSON format.

https://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/categories?format=json

Example XML Response for GET All Categories

This example shows the XML response body returned when making a request for all of a user's categories with the following URI:

https://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/categories?format=xml

Example Requests for POST Category

The following examples show how to add the category Family for the user identified by the GUID value of XYZUHL23NH5DGGGGXM.

Example JSON Request Body for POST Category

Call the HTTP POST operation on the following endpoint and send the Category Object below:

https://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/categories?format=json

Example XML Request Body for POST Category

Call the HTTP POST operation on the following endpoint and send the Category Object below:

https://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/categories

Table of Contents