Difference between revisions of "Customer (Rest API)"

From Rackspace Email & Apps API
Jump to: navigation, search
(remove account setting info)
(update schema file link)
Line 18: Line 18:
 
''Remarks'':
 
''Remarks'':
  
For the text/xml format, refer to the following schema document: [Customers.xsd]
+
For the text/xml format, refer to the following schema document: [http://api.emailsrvr.com/v0/Schemas/CustomerList.xsd CustomerList.xsd]
  
  
Line 55: Line 55:
 
''Remarks'':
 
''Remarks'':
  
The show operation only supports the GET HTTP verb. For text/xml format, refer to the following schema document: [Customer.xsd]
+
Keyword "me" is equivalent to the reseller's own account number.
 +
 
 +
The show operation only supports the GET HTTP verb. For text/xml format, refer to the following schema document: [http://api.emailsrvr.com/v0/Schemas/Customer.xsd Customer.xsd]
  
  
Line 61: Line 63:
  
 
<pre>
 
<pre>
get '/customers/999999', 'text/xml'
+
get '/customers/me', 'text/xml'
 
</pre>
 
</pre>
  
Line 92: Line 94:
 
''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'.
+
Add/Edit a new sub-account. Note that customer number is not known until the customer is added.
  
  

Revision as of 22:37, 29 August 2009

PageOutline

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: CustomerList.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:

Keyword "me" is equivalent to the reseller's own account number.

The show operation only supports the GET HTTP verb. For text/xml format, refer to the following schema document: Customer.xsd


Example:

get '/customers/me', '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. Note that customer number is not known until the customer is added.


Field Name Data Type Description
name string The customer's display name (Required for Add)
referenceNumber string The reference number of this account


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