Difference between revisions of "Customer (Rest API)"
(add Rest API Customer page) |
m |
||
Line 9: | Line 9: | ||
[GET] /customers | [GET] /customers | ||
+ | |||
''Description'': | ''Description'': | ||
− | + | This operation returns the list of customers that the authenticated user has access to. | |
+ | |||
''Remarks'': | ''Remarks'': | ||
− | + | For the text/xml format, refer to the following schema document: [https://trac.iad.mlsrvr.com/trac/controlpanel3/browser/Api/trunk/lib/ControlPanel.Api/Schemas/Customers.xsd Customers.xsd] | |
+ | |||
''Example'': | ''Example'': | ||
Line 23: | Line 26: | ||
get '/customers?size=100&page=1&referenceNumber=102486', 'text/xml' | get '/customers?size=100&page=1&referenceNumber=102486', 'text/xml' | ||
</pre> | </pre> | ||
+ | |||
''Errors'': | ''Errors'': | ||
Line 42: | Line 46: | ||
[GET] /customers/(customer account number) | [GET] /customers/(customer account number) | ||
+ | |||
''Description'': | ''Description'': | ||
− | + | The show operation will return detailed information about the specified account. | |
+ | |||
''Remarks'': | ''Remarks'': | ||
− | + | The show operation only supports the GET HTTP verb. For text/xml format, refer to the following schema document: [https://trac.iad.mlsrvr.com/trac/controlpanel3/browser/Api/trunk/lib/ControlPanel.Api/Schemas/Customer.xsd Customer.xsd] | |
+ | |||
''Example'': | ''Example'': | ||
Line 56: | Line 63: | ||
get '/customers/999999', 'text/xml' | get '/customers/999999', 'text/xml' | ||
</pre> | </pre> | ||
+ | |||
''Errors'': | ''Errors'': | ||
Line 80: | Line 88: | ||
Add: [POST] /customers<br> | Add: [POST] /customers<br> | ||
Edit: [PUT] /customers/(customer account number) | Edit: [PUT] /customers/(customer account number) | ||
+ | |||
''Description'': | ''Description'': | ||
− | + | Add/Edit a new sub-account. Because the customer number is not known until the customer is added, the POST data will be sent to '/customers'. An account limit that does not exist will appear as -1. Sending -1 will also set it to not exist. | |
− | + | ||
+ | |||
{| border=1 class="simple" | {| border=1 class="simple" | ||
!''Field Name'' | !''Field Name'' | ||
Line 152: | Line 162: | ||
} | } | ||
</pre> | </pre> | ||
+ | |||
''Errors'': | ''Errors'': | ||
Line 187: | Line 198: | ||
[DELETE] /customers/(customer account number) | [DELETE] /customers/(customer account number) | ||
+ | |||
''Description'': | ''Description'': | ||
− | + | Deletes the account. | |
+ | |||
''Example'': | ''Example'': | ||
Line 197: | Line 210: | ||
delete '/customers/999999', 'text/xml' | delete '/customers/999999', 'text/xml' | ||
</pre> | </pre> | ||
+ | |||
''Errors'': | ''Errors'': | ||
Line 213: | Line 227: | ||
| Customer Not Found | | Customer Not Found | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 12:13, 25 August 2009
Contents
Customer
Index
URL:
[GET] /customers
Description:
This operation returns the list of customers that the authenticated user has access to.
Remarks:
For the text/xml format, refer to the following schema document: Customers.xsd
Example:
get '/customers?size=100&page=1&referenceNumber=102486', 'text/xml'
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Format is invalid | 406 | Invalid format |
Show
URL:
[GET] /customers/(customer account number)
Description:
The show operation will return detailed information about the specified account.
Remarks:
The show operation only supports the GET HTTP verb. For text/xml format, refer to the following schema document: Customer.xsd
Example:
get '/customers/999999', 'text/xml'
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Format is invalid | 406 | Invalid format |
Customer account number is invalid | 404 | Invalid account number |
Add/Edit
URL:
Add: [POST] /customers
Edit: [PUT] /customers/(customer account number)
Description:
Add/Edit a new sub-account. Because the customer number is not known until the customer is added, the POST data will be sent to '/customers'. An account limit that does not exist will appear as -1. Sending -1 will also set it to not exist.
Field Name | Data Type | Description |
---|---|---|
name | string | The customer's display name (Required for Add) |
referenceNumber | string | The reference number of this account |
exchangeMaxExtraStorage | integer | Megabytes of extra storage in Exchange (Only available for Edit) |
exchangeMaxMailboxes | integer | Number of extra mailboxes in Exchange (Only available for Edit) |
exchangeMaxActiveSyncUsers | integer | Number of ActiveSync users in Exchange (Only available for Edit) |
exchangeMaxBlackBerryUsers | integer | Number of BlackBerry Enterprise Server users in Exchange (Only available for Edit) |
exchangeMaxGoodMMUsers | integer | Number of GoodMM sync users in Exchange (Only available for Edit) |
rsEmailMaxExtraStorage | integer | Megabytes of extra storage in Rackspace Email (Only available for Edit) |
rsEmailMaxMailboxes | integer | Number of extra mailboxes in Rackspace Email (Only available for Edit) |
rsEmailMaxSyncUsers | integer | Number of Sync users in Rackspace Email (Only available for Edit) |
rsEmailMaxBccArchivingUsers | integer | Number of BCC Archiving users in Rackspace Email (Only available for Edit) |
Example:
post '/customers', 'text/xml', { 'name' => 'Name' }
put '/customers/999999', 'text/xml', { 'name' => 'NewName', 'referenceNumber' => '12345' }
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Format is invalid | 406 | Invalid format |
The name field was not specified | 400 | Missing required field: name |
The name field cannot be blank | 400 | Required field name cannot be empty |
Names cannot start with a space | 400 | Improper Customer Name |
The customer account was not found | 404 | Customer Not Found |
Delete
URL:
[DELETE] /customers/(customer account number)
Description:
Deletes the account.
Example:
delete '/customers/999999', 'text/xml'
Errors:
Description | HTTP Response Code | Sample Message |
---|---|---|
Format is invalid | 406 | Invalid format |
The customer account was not found | 404 | Customer Not Found |