Description
The GetSavedQuery API allows the Account Owner to retrieve a previously saved Query.
Specific Request Parameters
(Refer to Common Request Parameters)
Name | Description | Required | Default | Possible Values |
---|---|---|---|---|
apsdb.queryName | Represents the saved query name | Yes |
|
|
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": "XML definition of the requested saved query" }
Specific Logical Errors
(Refer to Common Logical Error Codes)
Error | Message | Status Code |
---|---|---|
PARAMETER_REQUIRED |
| 400 |
INVALID_QUERY_NAME | Query name should start with (a-z A-Z) followed by any alphanumeric character (a-z A-Z 0-9) and underscores (_). It should not be shorter than 3 characters or exceed 32. | 400 |
SAVED_QUERY_NOT_FOUND | The query that you are trying to update doesn't exist. | 404 |
Examples
Sample Request
Request URL: http://sandbox.apstrata.com/apsdb/rest/[authenticationkey]/GetSavedQuery?apsws.time=[timestamp]&apsws.authSig=[signature]
POST parameters:
apsdb.queryName=myQuery1
Sample XML Response
Success XML:
<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd"> <metadata> <requestId>550e8400-e29b-41d4-a716-446655440000</requestId> <status>success</status> </metadata> <result> <query> <executeACL>creator</executeACL> <store>myStore1</store> <condition>startingDate[date]={startdate}</condition> <ftsQuery>word</ftsQuery> <returnedFields> <field>firstName</field> <field>lastName</field> </returnedFields> <sort> <field> <name>firstName</name> <type>string</type> <order>DESC</order> </field> </sort> <count>true</count> <aggregate> <expression>MAX($age)</expression> <page>true</page> <global>true</global> </aggregate> <resultsPerPage>10</resultsPerPage> <forceCurrentSnapShot>false</forceCurrentSnapShot> </query> </result> </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" }, "result": "<query> <executeACL>creator</executeACL> <store>myStore1</store> <condition>startingDate[date]={startdate}</condition> <ftsQuery>word</ftsQuery> <returnedFields> <field>firstName</field> <field>lastName</field> </returnedFields> <sort> <field><name>firstName</name><type>string</type><order>DESC</order></field> </sort> <count>true</count> <aggregate><expression>MAX($age) </expression><page>true</page><global>true</global> </aggregate> <resultsPerPage>10</resultsPerPage> <forceCurrentSnapShot>false</forceCurrentSnapShot></query> " }}