Saved Queries
Last updated
Last updated
Table of Contents |
---|
See Saved Queries on how to create a saved query. The URL can be found on the Execute Query screen.
GET
https://<Cinchy Web URL>/API/MyDomain/MyQuery
To access any Cinchy Saved Query API, pass the access token received from the Bearer Token Request in the Authorization header, prefixed by "Bearer".
%40 is the URL encoded version of @, if you are passing them in as parameters you will need to include the %40 in front of your parameter name.
https://<Cinchy Web URL>/BasicAuthAPI/MyDomain/MyQuery
The following instructions detail how to allow anonymous access to your saved query API endpoint.
Navigate to the table your query will be referencing. In this example, it is the Accessibility Assessments table (Image 1).
Navigate to Data Controls > Entitlements.
On a new row, add in the Anonymous user and ensure that either "View All Comuns" (to expose all the data) or "View Selected Columns" (to select individual columns) is checked off (Image 1).
Clicking on inline images in Gitbook will open a larger version.
4. Design your query (Image 2). For more information on creating new saved queries, click here.
5. Once you have written your query, navigate to Design Query > Info, on the left navigation bar.
6. Change your API Result Format to JSON (Image 3).
7. Navigate to Design Controls from the left navigation bar.
8. To ensure that anonymous users have the correct permission needed to execute the query that generates the API response, add the "Anonymous" user to the users permission group uiunder "Who can execute this query?" (Image 4).
9. Navigate to "Execute Query" from the left navigation bar.
10. Copy your REST API endpoint URL (Image 5).
11. To confirm that anonymous access has been successfully set up, paste the URL into an incognito/private browser (Image 6).
401
errors likely mean you have not added the Anonymous
user to the list of users (not "Groups") that can execute the query.
400
errors likely mean that you have not added the Anonymous
user to the list of users that (not "Groups") that can view column data from the tables that your query uses.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
WrapSingleRecordInArray
boolean
Default is true. Add this parameter and set to false if you want single record results returned as an object instead of within an array.
@param
string
If you have parameters in your query, you pass them indirectly as query parameters.
CompressJSON
boolean
Default is true. Add this parameter and set to false if you want the JSON that is returned to be expanded rather than having the schema being returned separately.
Authorization
string
Bearer <token goes here>