Difference between revisions of "Admin (Rest API)"

From Rackspace Email & Apps API
Jump to: navigation, search
(create admin page)
 
m
Line 42: Line 42:
 
       <adminId>apiadmin37</adminId>
 
       <adminId>apiadmin37</adminId>
 
       <type>super</type>
 
       <type>super</type>
       <isActive>true</isActive>
+
       <enabled>true</enabled>
       <isLocked>false</isLocked>
+
       <locked>false</locked>
 
     </admin>
 
     </admin>
 
     <admin>
 
     <admin>
 
       <adminId>apiadmin76</adminId>
 
       <adminId>apiadmin76</adminId>
 
       <type>super</type>
 
       <type>super</type>
       <isActive>true</isActive>
+
       <enabled>true</enabled>
       <isLocked>false</isLocked>
+
       <locked>false</locked>
 
     </admin>
 
     </admin>
 
     <admin>
 
     <admin>
 
       <adminId>apiadmin94</adminId>
 
       <adminId>apiadmin94</adminId>
 
       <type>super</type>
 
       <type>super</type>
       <isActive>true</isActive>
+
       <enabled>true</enabled>
       <isLocked>false</isLocked>
+
       <locked>false</locked>
 
     </admin>
 
     </admin>
 
   </admins>
 
   </admins>
Line 65: Line 65:
  
 
<pre>
 
<pre>
{"admins":[{"adminId":"apiadmin37","isActive":true,"isLocked":false,"type":"super"},{"adminId":"apiadmin76","isActive":true,"isLocked":false,"type":"super"},{"adminId":"apiadmin94","isActive":true,"isLocked":false,"type":"super"}],"offset":0,"size":50,"total":3}
+
{"admins":[{"adminId":"apiadmin37","enabled":true,"locked":false,"type":"super"},{"adminId":"apiadmin76","enabled":true,"locked":false,"type":"super"},{"adminId":"apiadmin94","enabled":true,"locked":false,"type":"super"}],"offset":0,"size":50,"total":3}
 
</pre>
 
</pre>
  
Line 100: Line 100:
 
   <adminId>apiadmin1</adminId>
 
   <adminId>apiadmin1</adminId>
 
   <type>super</type>
 
   <type>super</type>
   <isActive>true</isActive>
+
   <enabled>true</enabled>
   <isLocked>false</isLocked>
+
   <locked>false</locked>
 
   <firstName>First</firstName>
 
   <firstName>First</firstName>
 
   <lastName>Last</lastName>
 
   <lastName>Last</lastName>
Line 118: Line 118:
 
''Json Result Example'':
 
''Json Result Example'':
 
<pre>
 
<pre>
{"adminId":"apiadmin1","allowSimultaneousLogins":false,"email":"first.last@rackspace.com","firstName":"First","isActive":true,"isLocked":false,"lastName":"Last","passwordExpiration":10,"restrictedIps":["1.1.1.1","1.1.1.2","1.1.1.3"],"type":"super"}
+
{"adminId":"apiadmin1","allowSimultaneousLogins":false,"email":"first.last@rackspace.com","firstName":"First","enabled":true,"locked":false,"lastName":"Last","passwordExpiration":10,"restrictedIps":["1.1.1.1","1.1.1.2","1.1.1.3"],"type":"super"}
 
</pre>
 
</pre>
  

Revision as of 19:35, 31 October 2010


Index

URL:

[GET] https://api.emailsrvr.com/v0/customers/(customer account number)/admins
[GET] https://api.emailsrvr.com/v0/admins


Description:

This operation returns a list of admins under the account. If a customer account is specified, then a list of admins under that specific account will be returned.


Remarks:

To retrieve a list of admins owned by the account that is logged in, use "me" as the customer account number i.e. 'https://api.emailsrvr.com/v0/customers/me/domains'.

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


Example:

get '/customers/999999/admins?size=5&page=1', 'text/xml'


XML Result Example:

<?xml version="1.0" encoding="utf-8"?>
<adminList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:adminList">
  <offset>0</offset>
  <size>50</size>
  <total>3</total>
  <admins>
    <admin>
      <adminId>apiadmin37</adminId>
      <type>super</type>
      <enabled>true</enabled>
      <locked>false</locked>
    </admin>
    <admin>
      <adminId>apiadmin76</adminId>
      <type>super</type>
      <enabled>true</enabled>
      <locked>false</locked>
    </admin>
    <admin>
      <adminId>apiadmin94</adminId>
      <type>super</type>
      <enabled>true</enabled>
      <locked>false</locked>
    </admin>
  </admins>
</adminList>


Json Result Example:

{"admins":[{"adminId":"apiadmin37","enabled":true,"locked":false,"type":"super"},{"adminId":"apiadmin76","enabled":true,"locked":false,"type":"super"},{"adminId":"apiadmin94","enabled":true,"locked":false,"type":"super"}],"offset":0,"size":50,"total":3}


Show

URL:

[GET] https://api.emailsrvr.com/v0/customers/(customer account number)/admins/(admin name)
[GET] https://api.emailsrvr.com/v0/admins/(admin name)


Description:

The show operation will return detailed information about the specified admin.


Remarks:

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


Example:

get '/customers/999999/admins/admin1', 'text/xml'

XML Result Example:

<?xml version="1.0" encoding="utf-8"?>
<admin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:admin">
  <adminId>apiadmin1</adminId>
  <type>super</type>
  <enabled>true</enabled>
  <locked>false</locked>
  <firstName>First</firstName>
  <lastName>Last</lastName>
  <email>first.last@rackspace.com</email>
  <passwordExpiration>10</passwordExpiration>
  <allowSimultaneousLogins>false</allowSimultaneousLogins>
  <restrictedIps>
    <restrictedIps>1.1.1.1</restrictedIps>
    <restrictedIps>1.1.1.2</restrictedIps>
    <restrictedIps>1.1.1.3</restrictedIps>
  </restrictedIps>
</admin>


Json Result Example:

{"adminId":"apiadmin1","allowSimultaneousLogins":false,"email":"first.last@rackspace.com","firstName":"First","enabled":true,"locked":false,"lastName":"Last","passwordExpiration":10,"restrictedIps":["1.1.1.1","1.1.1.2","1.1.1.3"],"type":"super"}

Add/Edit

URL:

 Add: [POST] https://api.emailsrvr.com/v0/customers/(customer account number)/admins/(admin name)
      [POST] https://api.emailsrvr.com/v0/admins/(admin name)

 Edit: [PUT] https://api.emailsrvr.com/v0/customers/(customer account number)/admins/(admin name)
       [PUT] https://api.emailsrvr.com/v0/admins/(admin name)
 


Description:

Add a new admin or edit an existing admin under the specified account.


Field Name Data Type Description
type string Admin type (Required for Add). Must be "super", "standard" or "limited". Can't change permissions and domain access for limited admin at this point.
password string Admin log in password (Required for Add)
firstName string Admin first name (Required for Add)
lastName string Admin last name (Required for Add)
email string Admin contact email (Required for Add)
securityQuestion string Security question (Required for Add)
securityAnswer string Security answer (Required for Add)
passwordExpiration int The number of days in which password expires. 0 means password never expires.
allowSimultaneousLogins boolean Allow simultaneous logins using this Administrative ID
restrictedIps string Login restricted to IP address(es). Can be up to 3 valid addresses separated by commas.
enabled boolean Enable/disable admin account
locked boolean Lock/unlock admin account


Example:

post '/customers/999999/admins/admin1', 
     { 
       'type' => 'super',
       'password' => 'password',
       'firstName' => 'First',
       'lastName' => 'Last',
       'email' => 'first.last@rackspace.com',
       'securityQuestion' => 'Q',
       'securityAnswer' => 'A'
     },
     'text/xml'
put '/customers/999999/admins/admin2', 
     { 
       'enabled' => 'true',
       'locked' => 'false',
       'passwordExpiration' => '0',
       'allowSimultaneousLogins' => 'true',
       'restrictedIps' => '1.1.1.1'
     },
     'text/xml'


Errors:

Description HTTP Response Code Sample Message
Password doesn't meet the requirements 400 Password must be 7 to 30 characters.
Invalid email address 400 Invalid email address.
Invalid restricted to IP address(es) 400 IP addresses must be valid addresses separated by commas. A maximum of 3 addresses may be entered.


Delete

URL:

[DELETE] https://api.emailsrvr.com/v0/customers/(customer account number)/admins/(admin name)
[DELETE] https://api.emailsrvr.com/v0/admins/(admin name)


Description:

Deletes the admin.


Example:

delete '/customers/999999/admins/admin1', 'text/xml'