Difference between revisions of "Exchange Distribution List (Rest API)"
(add sample response) |
|||
Line 1: | Line 1: | ||
− | |||
− | |||
__TOC__ | __TOC__ | ||
Line 25: | Line 23: | ||
get '/customers/12345678/domains/example.com/ex/distributionlists?size=100&page=1&contains=mailing', 'text/xml' | get '/customers/12345678/domains/example.com/ex/distributionlists?size=100&page=1&contains=mailing', 'text/xml' | ||
</pre> | </pre> | ||
+ | |||
+ | |||
+ | ''XML Result Example'': | ||
+ | |||
+ | <pre> | ||
+ | <?xml version="1.0" encoding="utf-8"?> | ||
+ | <distributionlistList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
+ | xmlns="urn:xml:distributionlistList"> | ||
+ | <offset>0</offset> | ||
+ | <size>50</size> | ||
+ | <total>3</total> | ||
+ | <distributionlists> | ||
+ | <distributionlist> | ||
+ | <name>apiexgroup4</name> | ||
+ | <displayName>API Test Group</displayName> | ||
+ | </distributionlist> | ||
+ | <distributionlist> | ||
+ | <name>apiexgroup62</name> | ||
+ | <displayName>API Test Group</displayName> | ||
+ | </distributionlist> | ||
+ | <distributionlist> | ||
+ | <name>apiexgroup64</name> | ||
+ | <displayName>API Test Group</displayName> | ||
+ | </distributionlist> | ||
+ | </distributionlists> | ||
+ | </distributionlistList> | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | ''Json Result Example'': | ||
+ | |||
+ | {"offset":0,"size":50,"total":3,"distributionlists":[{"name":"apiexgroup4","displayName":"API Test Group"},{"name":"apiexgroup62","displayName":"API Test Group"},{"name":"apiexgroup64","displayName":"API Test Group"}]} | ||
Line 69: | Line 99: | ||
get '/customers/12345678/domains/example.com/ex/distributionlists/all.employees', 'text/xml' | get '/customers/12345678/domains/example.com/ex/distributionlists/all.employees', 'text/xml' | ||
</pre> | </pre> | ||
+ | |||
+ | |||
+ | ''XML Result Example'' | ||
+ | |||
+ | <pre> | ||
+ | <?xml version="1.0" encoding="utf-8"?> | ||
+ | <distributionlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:contact"> | ||
+ | <name>apiexgroup64</name> | ||
+ | <displayName>API Test Group</displayName> | ||
+ | <isHidden>false</isHidden> | ||
+ | <emailAddressList> | ||
+ | <emailAddress> | ||
+ | <address>apiexgroup64@apidomain36.com</address> | ||
+ | <replyTo>true</replyTo> | ||
+ | </emailAddress> | ||
+ | </emailAddressList> | ||
+ | <memberList> | ||
+ | <member>apiexmailbox30@apidomain36.com</member> | ||
+ | <member>apiexmailbox7@apidomain36.com</member> | ||
+ | <member>apiexmailbox99@apidomain36.com</member> | ||
+ | </memberList> | ||
+ | </distributionlist> | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | ''Json Result Example'': | ||
+ | |||
+ | {"name":"apiexgroup64","displayName":"API Test Group","isHidden":false,"emailAddressList":[{"address":"apiexgroup64@apidomain36.com","replyTo":true}],"memberList":["apiexmailbox30@apidomain36.com","apiexmailbox7@apidomain36.com","apiexmailbox99@apidomain36.com"]} | ||
Revision as of 15:37, 21 September 2009
Contents
Index
URL:
[GET] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/distributionlists
Description:
This operation returns a list of distribution lists associated with the domain.
Remarks:
The Index operation only supports the GET HTTP verb. For text/xml format, refer to the following schema document: DistributionlistList.xsd
Example:
get '/customers/12345678/domains/example.com/ex/distributionlists?size=100&page=1&contains=mailing', 'text/xml'
XML Result Example:
<?xml version="1.0" encoding="utf-8"?> <distributionlistList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:distributionlistList"> <offset>0</offset> <size>50</size> <total>3</total> <distributionlists> <distributionlist> <name>apiexgroup4</name> <displayName>API Test Group</displayName> </distributionlist> <distributionlist> <name>apiexgroup62</name> <displayName>API Test Group</displayName> </distributionlist> <distributionlist> <name>apiexgroup64</name> <displayName>API Test Group</displayName> </distributionlist> </distributionlists> </distributionlistList>
Json Result Example:
{"offset":0,"size":50,"total":3,"distributionlists":[{"name":"apiexgroup4","displayName":"API Test Group"},{"name":"apiexgroup62","displayName":"API Test Group"},{"name":"apiexgroup64","displayName":"API Test Group"}]}
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Format is invalid | 406 | Invalid format |
Domain is not found | 404 | abc.com not found |
Distribution List is not found | 404 | Distribution List not found |
Show
URL:
[GET] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/distributionlists/(distribution list name)
Description:
Returns the distribution list's details.
Remarks:
The show operation only supports the GET HTTP verb. For text/xml format, refer to the following schema document: Distributionlist.xsd
Example:
get '/customers/12345678/domains/example.com/ex/distributionlists/all.employees', 'text/xml'
XML Result Example
<?xml version="1.0" encoding="utf-8"?> <distributionlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:contact"> <name>apiexgroup64</name> <displayName>API Test Group</displayName> <isHidden>false</isHidden> <emailAddressList> <emailAddress> <address>apiexgroup64@apidomain36.com</address> <replyTo>true</replyTo> </emailAddress> </emailAddressList> <memberList> <member>apiexmailbox30@apidomain36.com</member> <member>apiexmailbox7@apidomain36.com</member> <member>apiexmailbox99@apidomain36.com</member> </memberList> </distributionlist>
Json Result Example:
{"name":"apiexgroup64","displayName":"API Test Group","isHidden":false,"emailAddressList":[{"address":"apiexgroup64@apidomain36.com","replyTo":true}],"memberList":["apiexmailbox30@apidomain36.com","apiexmailbox7@apidomain36.com","apiexmailbox99@apidomain36.com"]}
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Format is invalid | 406 | Invalid format |
Domain is not found | 404 | abc.com not found |
Distribution list is not found | 404 | Distribution List not found |
Add/Edit
URL:
Add: [POST] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/distributionlists/(distribution list name) Edit: [PUT] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/distributionlists/(distribution list name)
Description:
Adds/edits the distribution list with the specified information. Required fields must be supplied when adding. Others are optional.
Field Name | Data Type | Description |
---|---|---|
name | string | Distribution list name (Required for Add, not available for Edit) |
displayName | string | Distribution list display name (Required) |
isHidden | boolean | Whether or not the distribution list is hidden from the Global Address List (Defaults to false) |
Example:
post '/customers/12345678/domains/example.com/ex/distributionlists/all.employees', { 'name' => 'all.employees', 'displayName' => 'Employees' }, 'text/xml'
put '/customers/12345678/domains/example.com/ex/distributionlists/all.employees', { 'displayName' => 'Example.com Employees' }, 'text/xml',
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Format is invalid | 406 | Invalid format |
Domain is not found | 404 | abc.com not found |
Required form field is missing | 400 | Missing required field: name |
Required form field has null or empty string input | 400 | Required field displayName cannot be empty |
Boolean form field has non-boolean input | 400 | Invalid format for isHidden, input must be True or False |
Form data has unrecognized field | 400 | Unrecognized field: size |
New distribution list name already exists | 400 | The email address john.doe@abc.com is already in use |
New distribution list name doesn't meet the naming requirements | 400 | Invalid user name |
New distribution list display name doesn't meet the naming requirements | 400 | Invalid display name |
Distribution list is not found | 404 | Distribution List not found |
Display name doesn't meet the naming requirements | 400 | Invalid display name |
Delete
URL:
[DELETE] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/distributionlists/(distribution list name)
Description:
Deletes the distribution list.
Example:
delete '/customers/12345678/domains/example.com/ex/distributionlists/all.employees', 'text/xml'
Description | HTTP Response Code | Sample Message |
---|---|---|
Domain is not found | 404 | abc.com not found |
Distribution list is not found | 404 | Distribution List not found |
Email Addresses
This refers to the email addresses a distribution list can appear as.
Add Email Address
URL:
[POST] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/distributionlists/(distribution list name)/emailaddresses/(email address)
Description:
Adds an email address that the distribution list is associated with to the list. This address' domain name must be the same as the domain the distribution list is under.
Example:
post '/customers/12345678/domains/example.com/ex/distributionlists/all.employees/emailaddresses/alex@example.com', {}, 'text/xml'
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Format is invalid | 406 | Invalid format |
Domain is not found | 404 | abc.com not found |
Distribution list is not found | 404 | Distribution list not found |
Delete Email Address
URL:
[DELETE] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/distributionlists/(distribution list name)/emailaddresses/(email address)
Description:
Deletes the email address that is tied to the distribution list.
Example:
delete '/customers/12345678/domains/example.com/ex/distributionlists/all.employees/emailaddresses/alex@example.com', 'text/xml'
Member
This refers to the recipients of the distribution list.
Add Member
URL:
[POST] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/distributionlists/(distribution list name)/members/(member name)
Description:
Adds an email address to the distribution list.
Example:
post '/customers/12345678/domains/example.com/ex/distributionlists/all.employees/members/john.smith', {}, 'text/xml'
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Format is invalid | 406 | Invalid format |
Domain is not found | 404 | abc.com not found |
Distribution list is not found | 404 | Distribution list not found |
Required form field is missing | 400 | Missing field: addmember |
Form data has unrecognized field | 400 | Unrecognized field: deletemember |
New member is not found | 400 | No user with the email address jane.doe exists |
Delete Member
URL:
[DELETE] http://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name) /ex/distributionlists/(distribution list name)/members/(member name)
Description:
Delete an email address from the distribution list.
Example:
delete '/customers/12345678/domains/example.com/ex/distributionlists/all.employees/members/john.smith', {}, 'text/xml'
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Format is invalid | 406 | Invalid format |
Domain is not found | 404 | abc.com not found |
Distribution list is not found | 404 | Distribution list not found |
Member is not found | 400 | Invalid group member name |