Query REST Web API
Every VisualQuery you create has a REST URL. If you set the permissions, you can then read from the Query through REST. You can also pass query-parameters in the URL. Queries are Read APIs.
Standard Query Calls
The Query endpoint can be accessed on
.../app/auto/query/[your-query-name]when you're accessing a query of the current App (from a dnn-page with this module), as then 2sxc uses auto-detect
.../app/[app-folder]/query/[your-query-name]using this endpoint from external (other module, other page, other website) as then auto-detect can't work.
👉 read more about different URLs depending on how you access it
Read Only Certain Streams
A query may have many streams that your client may not necessarily need. To limit the results to only specific streams, add the stream name to the url, like this:
HTTP GET only
Note that Query endpoints only support the http-verb GET.
As the query-name is used in the path it's best-practice to use query-names without spaces and special characters. You can get it to work even with such specials, but we recommend you don't do that for simplicity.
POST with GUID filter (WIP)
In 2sxc 11.20 we're experimenting with a post-access to the query which will allow you to also specify GUIDs to filter. This is not final yet.
Querying a query requires read-permissions on that query.
- Introduced Content-REST API in 2sxc 5.x
- Queries introduced ca. 2sxc 6
- Query-API enhanced with Polymorph Editions in 2sxc 9.35 (allowing subfolder/api)
- Option to provide GUIDs to limit what is returned 2sxc 11.20 WIP