User:Bwinton/Account Provisioner API: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(→‎provision: Add a link to the schema.)
Line 14: Line 14:
* [http://bwinton.latte.ca/work/provision/suggestFromName.cgi?FirstName=Blake&LastName=Winton Success]
* [http://bwinton.latte.ca/work/provision/suggestFromName.cgi?FirstName=Blake&LastName=Winton Success]
     {"succeeded": true,
     {"succeeded": true,
     "addresses": ["blake@winton.com", "blake@winton.org", "b@winton.com"]}
     "addresses": ["blake@winton.com", "blake@winton.org", "b@winton.com"],
    "price": 20.00,
    /* Any other parameters will be sent back on the call to provision */}
* [http://bwinton.latte.ca/work/provision/suggestFromName.cgi?FirstName=Error&LastName=Winton Backend Failure]
* [http://bwinton.latte.ca/work/provision/suggestFromName.cgi?FirstName=Error&LastName=Winton Backend Failure]
     {"succeeded": false,
     {"succeeded": false,

Revision as of 16:21, 10 October 2010

Provisioning API

suggestFromName

Preference Name: extensions.accountprovisioner.suggestFromName

Default Url: http://bwinton.latte.ca/work/provision/suggestFromName.cgi

Inputs

  • FirstName - <String> All the names of the user before the last name.
  • LastName - <String> The last name of the user.

Outputs:

   {"succeeded": true,
    "addresses": ["blake@winton.com", "blake@winton.org", "b@winton.com"],
    "price": 20.00,
    /* Any other parameters will be sent back on the call to provision */}
   {"succeeded": false,
    "errors": {"FirstName": "Invalid first name."}}
   {"error": "Missing first or last name."}

checkAddress

Preference Name: extensions.accountprovisioner.checkAddress

Default Url: http://bwinton.latte.ca/work/provision/checkAddress.cgi

Inputs

  • username - <String> The requested username.
  • domain - <String> The requested domain.

Outputs:

   {"succeeded": true,
    "username": "bwinton", "domain": "latte.ca"}
   {"succeeded": false,
    "addresses": [
      {"domain": "latte.ca", 
       "alternates": ["error", "error1"]},
      {"domain": "gmail.com",
       "alternates": ["error1209", "error1337", "error16666"]},
      {"domain": "yahoo.com",
       "alternates": ["error", "error1"]}]}
   {"error": "Missing username or domain."}


provision

Preference Name: extensions.accountprovisioner.provision

Default Url: http://bwinton.latte.ca/work/provision/provision.cgi

Inputs

  • username - <String> The requested username.
  • domain - <String> The requested domain.
  • Whatever other fields the provisioning process requires. The current mock implementation also requires "FirstName".

Outputs:

   {"succeeded": true,
    "config": "<clientConfig version=\"1.1\">
                 <emailProvider id=\"latte.ca\">
                   <domain>latte.ca</domain>
                   <displayName>Latte.ca</displayName>
                   <displayShortName>Latte.ca</displayShortName>
                   <incomingServer type=\"imap\">
                     <hostname>imap.latte.ca</hostname>
                     <port>993</port>
                     <socketType>SSL</socketType>
                     <username>%EMAILLOCALPART%</username>
                     <authentication>password-cleartext</authentication>
                   </incomingServer>
                   <outgoingServer type=\"smtp\">
                     <hostname>smtp.latte.ca</hostname>
                     <port>587</port>
                     <socketType>STARTTLS</socketType>
                     <username>%EMAILLOCALPART%</username>
                     <authentication>password-cleartext</authentication>
                   </outgoingServer>
                 </emailProvider>
               </clientConfig>"}

The string in the config attribute should be XML which conforms to the Autoconfig schema.

   {"succeeded": false,
    "errors": {"FirstName": "Invalid first name.  Try \"Andrew\" instead."}}
   {"error": "Missing username or domain."}