This HTTP/1.1 POST method request returns the Universal Resource Identifier (URI) of the Email container that is created, including its ID.
|
Method
|
Relative Request URI
|
HTTP-Version
|
|---|
|
POST
|
/LiveContacts/contacts/contact(ContactID)/emails
|
HTTP/1.1
|
|
Element
|
Default
|
Restrictions
|
Notes
|
|---|
|
Email
|
N/A
|
A maximum of one Email element can be inserted in one call.
|
An Email ID is automatically generated for the newly added record. Then, the Email ID is returned in the location header.
|
HTTP/1.1 201 Created
Location: https://livecontacts.services.live.com/users/@L@<lid>/rest/livecontacts/contacts/contact(ContactID)/emails/email(EmailID)
-
Because Windows Live Contacts currently does not have a universal and unique ID for each EmailType property, a hash that is based on the EmailType property value is created. This hash enables retrieval by using the same hash value. This ID is not an actual 1:1 mapping to a specific EmailType instance.
-
Windows Live Contacts only allows for one occurrence of an EmailType property instance for each Contact collection. For example, no more than one "Personal" EmailType instance can exist in a Contact collection.
-
If an ID element is supplied in the body of the POST request, Windows Live Contacts returns the "400 Bad Request" status code.
-
If the request body contains an invalid EmailType property or if an Email container that has that EmailType property already exists in the Contact container, Windows Live Contacts returns the "409 Conflict" status code.
-
If the optional IsDefault flag is set to the True state, the PrimaryEmailType field in Windows Live Contacts is updated to the value of this EmailType property.
-
ContactID is a placeholder for the actual ID of the Contact collection.
-
EmailID is a placeholder for the actual ID of the Email container.
-
ServiceURL is a placeholder for the domain of the Windows Live service.
For detailed information about possible error codes that are returned by this request, see Windows Live Contacts API: Error/Response Codes
Code
Header:
POST /LiveContacts/contacts/contact(ContactID)/emails HTTP/1.1
Body:
<Email>
<EmailType>EmailType<EmailType>
<IsDefault>TrueFalse</IsDefault>
<Address>EmailAddress</Address>
</Email>
Reference
Windows Live Contacts API: REST Schema
Retrieving Contact E-mail Addresses from Windows Live Contacts
Updating Contact E-mail Addresses with Windows Live Contacts
Deleting Contact E-mail Addresses from Windows Live Contacts