Difference between revisions of "Exchange Contact (Rest API)"
m (moved RestAPI/Contact to Contact (Rest API)) |
(Updated to latest live version.) |
||
Line 5: | Line 5: | ||
''URL'': | ''URL'': | ||
− | <nowiki>[GET] | + | <nowiki>[GET] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) |
/ex/contacts</nowiki> | /ex/contacts</nowiki> | ||
Line 57: | Line 57: | ||
{"offset":0,"size":50,"total":3,"contacts":[{"name":"apiexcontact66","displayName":"API Test","externalEmail":"externalemail58@yahoo.com"},{"name":"apiexcontact73","displayName":"API Test","externalEmail":"externalemail98@yahoo.com"},{"name":"apiexcontact81","displayName":"API Test","externalEmail":"externalemail46@yahoo.com"}]} | {"offset":0,"size":50,"total":3,"contacts":[{"name":"apiexcontact66","displayName":"API Test","externalEmail":"externalemail58@yahoo.com"},{"name":"apiexcontact73","displayName":"API Test","externalEmail":"externalemail98@yahoo.com"},{"name":"apiexcontact81","displayName":"API Test","externalEmail":"externalemail46@yahoo.com"}]} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 79: | Line 62: | ||
''URL'': | ''URL'': | ||
− | <nowiki>[GET] | + | <nowiki>[GET] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) |
/ex/contacts/(contact name)</nowiki> | /ex/contacts/(contact name)</nowiki> | ||
Line 137: | Line 120: | ||
''Errors'': | ''Errors'': | ||
− | {| | + | {| class="wikitable" |
!''Description'' | !''Description'' | ||
!''HTTP Response Code'' | !''HTTP Response Code'' | ||
!''Sample Message'' | !''Sample Message'' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| Contact is not found | | Contact is not found | ||
Line 159: | Line 134: | ||
''URL'': | ''URL'': | ||
− | <nowiki>Add: [POST] | + | <nowiki>Add: [POST] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) |
/ex/contacts/(contact name) | /ex/contacts/(contact name) | ||
− | Edit: [PUT] | + | Edit: [PUT] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) |
/ex/contacts/(contact name)</nowiki> | /ex/contacts/(contact name)</nowiki> | ||
Line 171: | Line 146: | ||
− | {| | + | {| class="wikitable" |
!''Field Name'' | !''Field Name'' | ||
!''Data Type'' | !''Data Type'' | ||
Line 208: | Line 183: | ||
| Department | | Department | ||
|- | |- | ||
− | | | + | | businessNumber |
| string | | string | ||
| Business phone number | | Business phone number | ||
|- | |- | ||
− | | | + | | homeNumber |
| string | | string | ||
| Home phone number | | Home phone number | ||
|- | |- | ||
− | | | + | | mobileNumber |
| string | | string | ||
| Mobile phone number | | Mobile phone number | ||
|- | |- | ||
− | | | + | | faxNumber |
| string | | string | ||
| Fax number | | Fax number | ||
|- | |- | ||
− | | | + | | pagerNumber |
| string | | string | ||
| Pager number | | Pager number | ||
Line 275: | Line 250: | ||
''Errors'': | ''Errors'': | ||
− | {| | + | {| class="wikitable" |
!''Description'' | !''Description'' | ||
!''HTTP Response Code'' | !''HTTP Response Code'' | ||
!''Sample Message'' | !''Sample Message'' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| Contact is not found | | Contact is not found | ||
Line 295: | Line 262: | ||
| 400 | | 400 | ||
| Invalid display name | | Invalid display name | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| New display name doesn't meet the naming requirements | | New display name doesn't meet the naming requirements | ||
Line 329: | Line 280: | ||
''URL'': | ''URL'': | ||
− | <nowiki>[DELETE] | + | <nowiki>[DELETE] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) |
/ex/contacts/(contact name)</nowiki> | /ex/contacts/(contact name)</nowiki> | ||
Line 350: | Line 301: | ||
''Errors'': | ''Errors'': | ||
− | {| | + | {| class="wikitable" |
!''Description'' | !''Description'' | ||
!''HTTP Response Code'' | !''HTTP Response Code'' | ||
!''Sample Message'' | !''Sample Message'' | ||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| Contact is not found | | Contact is not found |
Revision as of 12:05, 30 November 2009
Contents
Index
URL:
[GET] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/contacts
Description:
Returns a list of contacts under the domain.
Remarks:
For the text/xml format, refer to the following schema document: ContactList.xsd
Example:
get '/customers/12345678/domains/example.com/ex/contacts?size=100&page=1&contains=john', 'text/xml'
XML Result Example:
<?xml version="1.0" encoding="utf-8"?> <contactList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:contactList"> <offset>0</offset> <size>50</size> <total>3</total> <contacts> <contact> <name>apiexcontact66</name> <displayName>API Test</displayName> <externalEmail>externalemail58@yahoo.com</externalEmail> </contact> <contact> <name>apiexcontact73</name> <displayName>API Test</displayName> <externalEmail>externalemail98@yahoo.com</externalEmail> </contact> <contact> <name>apiexcontact81</name> <displayName>API Test</displayName> <externalEmail>externalemail46@yahoo.com</externalEmail> </contact> </contacts> </contactList>
Json Result Example:
{"offset":0,"size":50,"total":3,"contacts":[{"name":"apiexcontact66","displayName":"API Test","externalEmail":"externalemail58@yahoo.com"},{"name":"apiexcontact73","displayName":"API Test","externalEmail":"externalemail98@yahoo.com"},{"name":"apiexcontact81","displayName":"API Test","externalEmail":"externalemail46@yahoo.com"}]}
Show
URL:
[GET] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/contacts/(contact name)
Description:
Returns the contact's details.
Remarks:
For the text/xml format, refer to the following schema document: Contact.xsd
Example:
get '/customers/12345678/domains/example.com/ex/contacts/alex.smith', 'text/xml'
XML Result Example:
<?xml version="1.0" encoding="utf-8"?> <contact xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:contact"> <name>apiexcontact73</name> <displayName>API Test</displayName> <externalEmail>externalemail98@yahoo.com</externalEmail> <isHidden>false</isHidden> <contactInfo> <firstName>API</firstName> <lastName>Test</lastName> <jobTitle>Dev</jobTitle> <company>My Company</company> <department>R&D</department> <businessNumber>111-1111</businessNumber> <homeNumber>222-2222</homeNumber> <mobileNumber>333-3333</mobileNumber> <faxNumber>444-4444</faxNumber> <pagerNumber>1234</pagerNumber> <addressLine1>123 Main Street</addressLine1> <city>Blacksburg</city> <state>VA</state> <zip>24060</zip> <country>USA</country> <notes>My Notes</notes> </contactInfo> </contact>
Json Result Example:
{"name":"apiexcontact73","displayName":"API Test","externalEmail":"externalemail98@yahoo.com","isHidden":false,"contactInfo":{"firstName":"API","lastName":"Test","jobTitle":"Dev","company":"My Company","department":"R&D","businessNumber":"111-1111","homeNumber":"222-2222","mobileNumber":"333-3333","faxNumber":"444-4444","pagerNumber":"1234","addressLine1":"123 Main Street","city":"Blacksburg","state":"VA","zip":"24060","country":"USA","notes":"My Notes"}}
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Contact is not found | 404 | Contact not found |
Add/Edit
URL:
Add: [POST] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/contacts/(contact name) Edit: [PUT] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/contacts/(contact name)
Description:
Adds or edits the contact's details as specified. If the contact does not exist, use Add, if it does, use Edit.
Field Name | Data Type | Description |
---|---|---|
displayName | string | Name of contact when displayed (Required for add) |
externalEmail | string | Email address (Required for add) |
isHidden | boolean | Whether the contact is hidden from the Global List |
firstName | string | First name |
lastName | string | Last name |
jobTitle | string | Job title |
company | string | Company |
department | string | Department |
businessNumber | string | Business phone number |
homeNumber | string | Home phone number |
mobileNumber | string | Mobile phone number |
faxNumber | string | Fax number |
pagerNumber | string | Pager number |
addressLine1 | string | Street address |
city | string | City |
state | string | State |
zip | string | Zip or postal code |
country | string | Country |
notes | string | Notes field |
Example:
post '/customers/12345678/domains/example.com/ex/contacts/alex.smith', 'text/xml', { 'displayName' => 'Johnny Customer', 'externalEmail' => 'jonny@apple.com' }
put '/customers/12345678/domains/example.com/ex/contacts/alex.smith', 'text/xml', { 'externalEmail' => 'jonnysNewEmail@microsoft.com', 'company' => 'Microsoft', 'businessnumber' => '425 555 5555' }
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Contact is not found | 404 | No user with the email address jane.doe@abc.com exists |
New display name doesn't meet the naming requirements | 400 | Invalid display name |
New display name doesn't meet the naming requirements | 400 | Invalid display name |
New contact name (user name) already exists | 400 | The email address john.doe@abc.com is already in use |
New contact name (user name) is reserved by Exchange | 400 | user name reserved |
Delete
URL:
[DELETE] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/contacts/(contact name)
Description:
Deletes the contact.
Remarks:
Contact is deleted immediately without verification and data is lost permanently.
Example:
delete '/customers/12345678/domains/example.com/ex/contacts/alex.smith', 'text/xml'
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Contact is not found | 404 | No user with the email address jane.doe@abc.com exists |