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

Description

The DeleteUser API allows the Account Owner to remove a User from the apstrata account user directory.

With Apstrata, you can build multi-user applications. In order to be able to read or write data to an apstrata account store, you have to be the Account Owner or you have to be registered as a User in the apstrata account. API requests signed with a User password are User requests as opposed to owner requests which are signed with the account secret.

When you register with Apstrata, an account will be created for you. With each account creation, there is a default user Schema named "apsdb_user" that gets created. The purpose of this Schema is to give the owner the possibility of defining custom user profiles. Hence, an owner can add new fields, define permissions, and define validation rules for each field. When saving users, custom user attributes can be set and validated automatically based on the rules defined for each one. The fields already defined in the default user Schema are required and should not be removed. This user schema is not meant to be used for saving non-user documents.

A User entity is persisted as a Document in the apstrata account user directory Store, based on the Schema named "apsdb_user".

A User can belong to zero or more Groups defining his read and write permissions.

A user can be suspended by calling SaveUser and setting the system field "isSuspended" to true. A suspended user still exists in the system but is treated as if he was deleted. Any request made to Apstrata with this user will return an exception saying that the signature is invalid. The user can be reactivated by calling SaveUser and setting the field "isSuspended" back to false. By default, the ACL of this field are set in a way that only the owner of the account can suspend or un-suspend a user but you are free to change those ACLs by updating your user schema.

Note that owners will always have the permission to call the GetUser and SaveUser APIs, but Users can only read or update their own profile Documents. In other words, the permissions defined in the Schema ACLs can only be used to restrict Users from accessing their own profile Document or other Users profile Documents.

For more details about schema definition, please refer to Document Schema Definition.

 

Specific Request Parameters

(Refer to Common Request Parameters)

Name

Description

Required

Default

Possible Values

login

The username used to authenticate a user’s requests.

Yes

 

 

Specific Response Elements

(Refer to Common Response Elements)

Specific Logical Errors

(Refer to Common Logical Error Codes)

Error

Message

Status Code

PARAMETER_REQUIRED

 

400

INVALID_USER

The specified user does not exist.

400

Examples

Sample Request

Request URL: http://sandbox.apstrata.com/apsdb/rest/[authenticationkey]/DeleteUser?apsws.time=[timestamp]&apsws.authSig=[signature] 



POST parameters:

login = [user_login]



Sample XML Response

Success XML:

<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd">
    <metadata>
        <requestId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</requestId>
        <status>success</status>       
    </metadata>
</response> 



Failure XML:

<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd">
    <metadata>
        <requestId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</requestId>
        <status>failure</status>
        <errorCode>[errorCode]</errorCode>
        <errorDetail>[failMsg]</errorDetail>
    </metadata>
</response> 



Sample JSON Response

{"response": {
    "metadata": {
        "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "status": "success"
    }
}} 


 

 

  • No labels