Table of Contents

Query REST Web API

you are here (click to zoom) - discover the stack

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:

.../app/auto/query/[your-query-name]/Default

HTTP GET only

Note that Query endpoints only support the http-verb GET.

Naming Recommendations

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.

Setting Security

Querying a query requires read-permissions on that query.

History

  1. Introduced Content-REST API in 2sxc 5.x
  2. Queries introduced ca. 2sxc 6
  3. Query-API enhanced with Polymorph Editions in 2sxc 9.35 (allowing subfolder/api)
  4. Option to provide GUIDs to limit what is returned 2sxc 11.20 WIP