Skip to main content

GET Data from Slate

GET requests are very easy. Create your query and turn it into a web service with theย Edit Web Service button. Then click Edit Permissions and Add Grantee. The most straightforward grantee type is Username, which allows you to specify a username, password, and token. After saving permissions, click the "JSON" link and select your grantee to get the endpoint URL.

View Query Web Service.png

Authentication can be Basic or none. Unauthenticated web services have their place, such as a JSON feed of public events that the school wishes to promote. For an unauthenticated web service, select User Token as the Type under Edit Permissions.

GET Parameters

Click Edit Web Service, then define a parameter with XML. You might define a person ID like this:

<param id="pid" type="uniqueidentifier" />

After defining the parameter, you may use it as @pid in your query filters. Parameter names are arbitrary.

As of Jan 2024, parameters support default values: <param id="days_ago" type="int">7</param>
Static variables are also supported: <var id="enrl_target" type="int">2000</var>

Parameter typing is optional but recommended. Use SQL-like types, like varchar, int, and uniqueidentifier.