Child pages
  • CreateAccount
Skip to end of metadata
Go to start of metadata

Description

This API creates an account and returns its authentication key and secret. This API call can only be signed with an authentication key and secret corresponding to an account with provisioning allowance. By default, when an account is created, it is flagged as active. When an account is created, a store named "DefaultStore" will automatically be created. In addition, a users schema named "apsdb_user" is also created by default. Finally, the account and default store configurations are set to their default values. 

Specific Request Parameters

(Refer to Common Request Parameters)

Name

Description

Required

Default

Possible Values

accountId

The account ID of the new account. Multiple accounts can have the same account ID but different authentication keys.
You can think of this as the ID of a customer owning multiple accounts

Yes

 

 

emailThe email address of the account administratorYes  
nameThe label of the account to be created. This makes it easier to refer to the accountYes  
provisioningAccountA boolean value indicating whether the account is a provisioning oneNoFalseTrue
False 

Specific Response Elements

(Refer to Common Response Elements)

The following specific "result" element is a child of the common root element "response" and a sibling of the common "metadata" element:

{
	"result": {
    		"aps_authKey": "authentication key of the created account",
	    	"aps_authSecret": "secret of the created account"
	}
}

Specific Logical Errors

(Refer to Common Logical Error Codes)

Error

Description

Status Code

PARAMETER_REQUIRED

Generated if a required parameter is not sent in the request

400

INVALID_PARAMETER_VALUE

Generated if a certain parameter value is not valid

400

INVALID_REQUESTGenerated if the request or call is made over HTTP and not HTTPS
Generated if if the request or call is signed by the authentication key and secret of a non-provisioning account
400

NOTE: Errors resulting from CreateStore, SaveSchema and SaveConfiguration APIs are propagated to this API.

Examples

Sample Request

Request URL: https://sandbox.apstrata.com/apsdb/rest/[provisioner_authentication_key]/CreateAccount?apsws.time=[timestamp]&apsws.authSig=[signature]


POST parameters:

accountId=companyA
email=admin@companyA.com
name=UserManager
provisioningAccount=false


Sample Response

Success XML:

<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd">
  <metadata>
    <requestId>0d6d6081-2d1e-4e36-bd18-cbb4f7847747</requestId>
    <status>success</status>
    <statusCode>200</statusCode>
  </metadata>
  <result>
    <field name="aps_authKey">XXXXXXXXXX</field>
    <field name="aps_authSecret">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</field>
  </result>
</response>


Failure XML:

<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd">
  <metadata>
    <requestId>82f9e125-e143-4e59-9c07-434505fe3d0d</requestId>
    <status>failure</status>
    <errorCode>PARAMETER_REQUIRED</errorCode>
    <errorDetail>
      <![CDATA[
        The parameter [accountId] is required in CreateAccount
      ]]>
    </errorDetail>
    <statusCode>400</statusCode>
  </metadata>
</response>


Sample JSON Response

{"response": {
  "metadata": {
    "requestId": "c6898010-992b-4a45-a780-6ea7136f3bdc",
    "status": "success",
    "statusCode": "200"
  },
  "result": {
    "aps_authKey": "XXXXXXXXXX",
    "aps_authSecret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  }
}}

  • No labels