POST Exchange Email Alias
(Difference between revisions)
				
																
				
				
								
				Mike.robski  (Talk | contribs) m (1 revision: Release 95)  | 
		 (→Examples)  | 
		||
| Line 20: | Line 20: | ||
| − | ; username - ''''  | + | ; username - ''string''  | 
: - Username of email address. Allowed are only letters, numbers, underscores, dashes and nonconsecutive dots.  Dots cannot be at the beginning or the end of the value. From 1 to 52 characters long.  | : - Username of email address. Allowed are only letters, numbers, underscores, dashes and nonconsecutive dots.  Dots cannot be at the beginning or the end of the value. From 1 to 52 characters long.  | ||
| Line 64: | Line 64: | ||
  Date : Fri, 01 Jun 2012 23:51:29 GMT  |   Date : Fri, 01 Jun 2012 23:51:29 GMT  | ||
  Connection : keep-alive  |   Connection : keep-alive  | ||
| − |   Location : http://coreapi01.ote.chicago.hostway:8098/accounts/popescu300021/exchange/ng-test-hwus-petre-120120b.com/emailAliases /john/  | + |   Location : http://coreapi01.ote.chicago.hostway:8098/accounts/popescu300021/exchange/ng-test-hwus-petre-120120b.com/emailAliases/john/  | 
  Content-Length : 0  |   Content-Length : 0  | ||
Revision as of 08:28, 15 July 2014
Create an Email Alias
POST {server_name}/accounts/{account_number}/exchange/{domain_name}/emailAliases
Contents | 
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
 
Request Body
 {
    "emailalias" : {
          "username": "john",
	  "emailForward": "johnjello@domainname.com"
  }
}
  
- username - string
 - - Username of email address. Allowed are only letters, numbers, underscores, dashes and nonconsecutive dots. Dots cannot be at the beginning or the end of the value. From 1 to 52 characters long.
 
- emailForward - string
 - - Target email address. Must be a valid email address. The domain-name of the address must be the same as the domain-name associated with the Exchange resource.
 
Expected Response Codes
- 201
 - Created
 
- 400
 - External forward; Email forwarding to the same address; Validation error
 
- 405
 - Unsupported method
 
- 409
 - Username already exists
 
- 502
 - Internal server error
 
Examples
POST {server_name}/accounts/account300021/exchange/ng-test-hwus-120120b.com/emailAliases
- Request Headers:
Content-Type:application/json Charset=UTF-8 Authorization:Base64-encoded username & password string
- Request Body:
 {
    "emailalias" : {
          "username": "john",
	  "emailForward": "johnjello@ng-test-hwus-120120b.com"
  }
}
  
- Response: Created (201):
Server : nginx/0.6.32 Date : Fri, 01 Jun 2012 23:51:29 GMT Connection : keep-alive Location : http://coreapi01.ote.chicago.hostway:8098/accounts/popescu300021/exchange/ng-test-hwus-petre-120120b.com/emailAliases/john/ Content-Length : 0
- There will be a Location in the response header pointing to the newly created resource.
 
- Request Body with Invalid data:
 {
   "emailalias": {
         "username": "new_alias",
         "emailForward": "new_alias@ng-test-hwus-petre-120120b.com"
   }
}
  
- Response:
BadRequest (400): 
 {
   "computeFault": {
         "message": "Email forwarding to the same address is not allowed",
         "code": 400, "details": ""
   }
}