Multiple Fields

Description

You can use the following URIs to obtain a collection of field resources or add a single field for a particular contact. Call HTTP GET on these URIs to access a narrowly-defined collection of contact's resources. Call HTTP POST on thse URIs to add a a specific field for a contact.

For example, you may have developed a relationship with John. Now, you may want to know all of his phone numbers, but you don't need any other information. To do this, you call the HTTP GET operation on the addresses URI and use your GUID and John's CID. To obtain John's CID, you can use the HTTP GET operation to obtain the Contacts resource. Suppose John has a new address that you would like to add to your address book. To do this, you call the HTTP POST operation on the addresses URI and send an Address Field Object containing his new address.

For an example of how to make the call and see the response, see Example JSON Response Body for GET Plural Fields.

If you need to get only a specific field for a contact rather than the entire collection of fields accessed by these URIs, see the Single Fieldsection.

URIs

HTTP Operations Supported

  • GET
  • POST

Query Parameters Supported

  • format

Matrix Parameters Supported

Not available.

Scopes Required

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

Contact Plural Fields

The following list of values is an enumeration, so the listed values have no other data type associated with them.

The Contacts plural field type, which is found in the response, will be one of the values in the following table.

See also the list of single fields in Contact Field Types.

Plural Fields Description
guids The contacts' GUID values.
nicknames The contacts' nicknames.
emails The contacts' emails.
yahooids Yahoo IDs.
otherids Other identifiers, such as ICQ, etc., distinguished by flags (see Contact Field Flags).
phones Phone numbers. Phone numbers should use flags to distinguish one phone number from another.
jobtitles The contacts' job titles.
companies The contacts' company names.
notesFields Comments about the contacts.
links URLs.
customFields Custom fields created with the "Add a Custom Field" dialog from the Yahoo Address Book.
names Contacts' names.
addresses Postal addresses.
birthdays Contacts' birthdays.
anniversaries Contacts' anniversaries.

JSON Syntax for GET Plural Fields

In the following example, the Contacts plural field type will be replaced with one of the entries from the table of Contact Plural Fields. For example, see Example JSON Response Body for GET Plural Fields.

Example Responses for GET Plural Fields

These examples show how to request information for all of the phones of a contact. The contact's unique identifier (the CID) value is 32.

The response body has the following:

  • The response is a collection of separate Field Objects containing the details for each phone. For JSON, the collection is an array, which is a Field Type.

  • The uri tag identifies the precise location of each Field Object.

  • The id tag is the FID that uniquely identifies the field on which this Field object is located.

  • A flag conveniently characterizes each Phone Object.

Example JSON Response Body for GET Plural Fields

To get the requested information in JSON format, you must explicitly make your request as shown here.

https://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/contact/32/phones?format=json

Example XML Response Body for GET Plural Fields

This example shows the XML response body returned when making a request for information for all of the phones of a contact with the following URI:

https://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/contact/32/phones

JSON Syntax for POST Single Field

Example Requests for POST Single Field

These examples show how to add a phone for a contact identified by the CID 32.

Example JSON Request Body for POST Single Field

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

https://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/contact/32/phones?format=json

Example XML Request Body for POST Single Field

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

https://social.yahooapis.com/v1/user/XYZUHL23NH5DGGGGXM/contact/32/phones

Table of Contents