GET Exchange Mailing List Members List
From Hostway API Documentation
GET /accounts/{account_number}/exchange/{domain_name}/mailingLitsts/{username}/members
Retrieve an Exchange Mailing List Members list by a mailing list username
Contents |
Request
GET {server_name}/accounts/{account_number}/exchange/{domain_name}/mailingLitsts/{username}/members?page=page-num&pageSize=page-size&sortField=sort-field&sortOrder=sort-order&filter-field=filter-value
Request Parameters
- account_number - string
- The account number that the Exchange resource belongs to
- domain_name - string
- The domain name that is associated with the Exchange resource
- username - string
- The username that is associated with the Mailing List resource
URI Parameters
- page-num- int
- (OPTIONAL)
- Request a specific page of data. If not set defaults to 1
- page-size - int
- (OPTIONAL)
- Size used to paginate the request. If not set defaults to 100
- sort-field - string
- (OPTIONAL)
- Specifies a field upon which to sort the data. If not set no sorting is preformed. Allowed values can be obtained by an OPTIONS call
- sort-order - string
- (OPTIONAL)
- Specifies the order in which the data is sorted. If not set no sorting is preformed if sort-field is not set or defaults to asc otherwise. Allowed values can be obtained by an OPTIONS call
- filter-field - string
- (OPTIONAL)
- Specifies a field upon which the data is filtered. If multiple filter-field are set all of them have to be true to pass the filter. If none are set no filtering is performed. Allowed values can be obtained by an OPTIONS call.
- filter-value - string
- (OPTIONAL)
- A value with which the filter-field is filtered. Values are exact match or defined with Filter Values Wildcards. Additional restrictions may be specified in the an OPTIONS call
Response
Status Code
- 200
- Success
- 400
- Bad request
- This is usually a sign that the client attempted to use invalid filtering/sorting criteria
- 404
- Non-existent resource
- Returned if:
- - no Exchange service could be found for the given domain name OR
- - there is no mailing list with the given username for the given domain name
- 405
- Unsupported method
- 502
- Bad gateway
- There was a failure in an upstream service that caused a failure in the API.
Response Body
{ "list" : [ { "username" : {member_username}, "type" : {type}, "name" : {display_name}, "links" : [ { "href" : "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailingLists/{list_username}/members/{member_username}", "rel" : "self" }, { "href" : "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/globalContacts/{member_username}", "rel" : "related" } ] } ], "links" : [ { "href" : "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailingLists/{list_username}/members/", "rel" : "self" } ] }
Parameters
- list - list
- List of the mailing list's members. Each element of the list has the following attributes:
- name - string
- The user-friendly display name of the mailing list member
- username - string
- The username of the mailing list member
- type - type
- Type of the the mailing list member. Allowed values are globalContact or mailbox
- links - list
- Hypermedia for this resource
- links - list
- Hypermedia for this resource. Link to self will preserve filtering, sorting and pagination set by the request. Links to the first, last, previous and next pages will also be included, if applicable
Examples
Get an unfiltered, unsorted, unpaginated members list
Request
http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members
Response HTTP/1.0 200 OK
{ "list" : [ { "username" : "test_mail3", "type" : "mailbox", "name" : "Test Exchange2010 Mailbox 3", "links" : [ { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members/test_mail3", "rel" : "self" }, { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailboxes/test_mail3", "rel" : "related" } ] }, { "username" : "test_mail", "type" : "mailbox", "name" : "Test mail", "links" : [ { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members/test_mail", "rel" : "self" }, { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailboxes/test_mail", "rel" : "related" } ] }, { "username" : "00000140538bfdc52362a80b007f000000010001", "type" : "globalContact", "name" : "Anh Hostway", "links" : [ { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members/00000140538bfdc52362a80b007f000000010001", "rel" : "self" }, { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/globalContacts/00000140538bfdc52362a80b007f000000010001", "rel" : "related" } ] } ], "links" : [ { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members/", "rel" : "self" } ] }
Get a members list sorted by username and filtered by type
Request
http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members?filterType=mailbox&sortField=username&sortOrder=desc
Response HTTP/1.0 200 OK
{ "list" : [ { "username" : "test_mail3", "type" : "mailbox", "name" : "Test Exchange2010 Mailbox 3", "links" : [ { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members/test_mail3", "rel" : "self" }, { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailboxes/test_mail3", "rel" : "related" } ] }, { "username" : "test_mail", "type" : "mailbox", "name" : "Test mail", "links" : [ { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members/test_mail", "rel" : "self" }, { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailboxes/test_mail", "rel" : "related" } ] } ], "links" : [ { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members?filterType=mailbox&sortField=username&sortOrder=desc", "rel" : "self" } ] }
Get a paginated members list
Request
http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members?page=1&pageSize=2
Response HTTP/1.0 200 OK
{ "list" : [ { "username" : "test_mail3", "type" : "mailbox", "name" : "Test Exchange2010 Mailbox 3", "links" : [ { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members/test_mail3", "rel" : "self" }, { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailboxes/test_mail3", "rel" : "related" } ] }, { "username" : "test_mail", "type" : "mailbox", "name" : "Test mail", "links" : [ { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members/test_mail", "rel" : "self" }, { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailboxes/test_mail", "rel" : "related" } ] } ], "links" : [ { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members?page=1&pageSize=2", "rel" : "self" }, { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members?page=2&pageSize=2", "rel" : "next" }, { "href" : "http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members?page=2&pageSize=2", "rel" : "last" } ] }
See also