Exchange Distribution List (Rest API)

From Rackspace Email & Apps API
Revision as of 07:06, 25 July 2013 by Appscp (talk | contribs) (Index)
Jump to: navigation, search


Index

URL:

[GET] https://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&offset=10&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
Distribution List is not found 404 Distribution List not found

Show

URL:

[GET] https://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
Distribution list is not found 404 Distribution List not found


Add/Edit

URL:

Add: [POST] https://api.emailsrvr.com/v0/customers/(customer account number)/domains/(domain name)
                /ex/distributionlists/(distribution list name)
Edit: [PUT] https://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
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
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] https://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
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] https://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
Distribution list is not found 404 Distribution list not found


Delete Email Address

URL:

[DELETE] https://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] https://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
Distribution list is not found 404 Distribution list not found
New member is not found 400 No user with the email address jane.doe exists


Delete Member

URL:

[DELETE] https://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
Distribution list is not found 404 Distribution list not found
Member is not found 400 Invalid group member name