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

Description

The DeleteSavedQuery API allows the Account Owner to delete a Saved Query by name.

 

In apstrata, Documents that are saved in a Store can be retrieved by running a Dynamic Query or a Saved Query.

A Dynamic Query is one that is built every time on the fly by specifying the condition, fields to return, sort order, and aggregates.

A Saved Query is one whose definition is saved for later use. Rather than every time specifying the condition, fields to return, sort order, and aggregates, a developer can add a Saved Query whose definition specifies all the previously mentioned query constructs. Each Saved Query has a name which is used to run the Query and get back the results.

Moreover, a developer can implement a pagination model for the matching results by specifying the number of Documents per page as well as the number of the page to return. This is very useful for cases where a huge number of Documents matches the Query condition. In these cases, the results will be returned in pages or chunks rather than a whole block which impacts the performance of the application at hand.

Furthermore, when running a Query, a developer can look for documents matching a specific full text search criteria. In this case, documents satisfying both the Query condition and the full text search criteria will be returned in the results.

In terms of security, Documents or fields within a Document are returned in the results only if their read ACL contains the User or one of the Groups of the User running the Query

A developer may run as many Queries as needed per store. However, based on the apstrata account type, there is a limit on the number of predicates used in the Query condition, on the number of Documents returned in the results, and on the total size of the result set.

 

Specific Request Parameters

(Refer to Common Request Parameters)

Name

Description

Required

Default

Possible Values

apsdb.queryName

The name of the saved query to delete

Yes

 

 

Specific Response Elements

(Refer to Common Response Elements)

Specific Logical Errors

(Refer to Common Logical Error Codes)

Error

Message

Status Code

SAVED_QUERY_NOT_FOUND

The query requested doesn’t exist.

404

INVALID_QUERY_NAME

Invalid query name [queryName]

400

PARAMETER_REQUIRED

 

400

Examples

Sample Request

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



POST parameters:

apsdb.queryName=selectNewEmployees 



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-xxxxxxxxxxxxfckgOpenPAREN/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