POST Exchange Mailing List Members List

From Hostway API Documentation
Revision as of 23:59, 1 July 2014 by Mike.robski (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

POST /accounts/{account_number}/exchange/{domain_name}/malingLitsts/{username}/members

Add a new member to a given mailing list

Contents


Request

POST /accounts/{account_number}/exchange/{domain_name}/malingLitsts/{username}/members

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

Request Body

{
 "username": {username}
}
 

Parameters

username - string
username of a global contact or mailbox to be added to the given mailing list

Response

Status Code

201
Created
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
400
Not qualified member. The username provided is neither a mailbox nor a global contact username.
409
A member with that particular "username" has already been added.
405
Unsupported method
415
Validation error
502
Internal server error

Response Headers

Location
Contains the URL to the new resource

Response Body

None - the response body is empty

Examples

Adding a member and check that the member has been added successfully

Get a members list before adding

Request

GET 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" : "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"
  } ]
}
 

Add a member

Request

POST http://localhost:6543/accounts/anh74902/exchange/ng-test-anh-080613.com/mailingLists/test_list/members
 
{ "username": "test_mail" }
 

Response

HTTP/1.0 201 Created
 

Get a members list after adding

Request

GET 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"
  } ]
}
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox