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

Description

The DeleteDocument API deletes all versions of a specified Document from the specified Store.

In apstrata, data and digital assets are grouped into Documents, where each Document corresponds to a collection of name-value pairs known as fields. Each field within a Document has a type and can be specified to be indexed for full text searching.

In addition to the data itself, a Document contains metadata information such as the creator, creation time, last modification time, etc.

Documents may have Schemas defining their structure, in a declarative way, in terms of field groups, field types, field validations and field groups ACLs. Apstrata does not enforce the use of Schemas when persisting Documents. However, in this case, no security or validation rules can be applied at the level of the fields.

Each Document is persisted in a Store with a key that uniquely identifies it within that Store.

All Documents saved in an apstrata Store are secured individually with ACLs (from wikipedia: Access Control Lists), allowing developers to specify the Users and/or Groups that can view, update or delete a Document, or more granularly individual fields within that Document.

A developer can create as many Documents as needed per Store. However, there is a limit on the number of fields a Document can have, as well as on the size of digital assets within that Document. This limit is based on the apstrata account type that a developer has.

A developer can choose to create multiple versions of a certain Document. Each Document version is identified by a number which is automatically assigned to it upon creation time. This number is equivalent to the last version number of the Document plus one. At any point in time, a developer can retrieve a particular version of a Document. However, only the latest version of a Document can be updated. Reverting back to an old version of a Document simply means creating a new version with the data retrieved from that old version.

ACL

The user is not allowed to delete a document if the user doesn't have delete ACL on this document

Specific Request Parameters

(Refer to Common Request Parameters)

Name

Description

Required

Default

Possible Values

apsdb.store

The store name from which you are to delete your document.

No

DefaultStore

 

apsdb.documentKey

The unique document identifier. It is unique in its store.

Yes

 

 

apsdb.runAs

It allows the owner to run a service as one of his own users. The possible values are any of the usernames.

No

 

 

apsdb.authTokenThis parameter is used to sign the request with a token that was initially obtained by calling VerifyCredentails  API. For more details on signing requests, please refer to the page entitled Authentication .No  

Specific Response Elements

(Refer to Common Response Elements)

Specific Logical Errors

(Refer to Common Logical Error Codes)

Error

Message

Status Code

STORE_NOT_FOUND

The store was not found

404

DOCUMENT_NOT_FOUND

The document with “document_key” “[documentKey]” could not be found for update

404

PARAMETER_REQUIRED

 

400

Examples

Sample Request

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



POST parameters:

apsdb.store=ClevelandMain
apsdb.documentKey=doc_key_1 



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