URL query parameters
URL query parameters allow you to pass values through the API via the URL in the format ?key=value. They also work within encoded URLs.
To use URL query parameters:
Define a query parameters object in pronghorn.json
In the pronghorn.json, define a parameter with type object. This object will contain all query parameters.
Add properties to the schema
Add all properties you want to access via the URL as properties inside the schema. Include a data type so the URL parameter is correctly parsed.
Example pronghorn.json method input:
Example function call:
Example object passed into function:
Passing objects in URLs
While using objects in URLs is not recommended, it can be done in one of two ways:
-
As a JSON string:
-
In square-brackets notation:
Order of operations
If parameters are passed through both the request body and the URL query string, the request body takes priority and the query parameters are ignored entirely. In the following example, the value of the string parameter will be world:
URL query parameters can be used with all request types (POST, GET, DELETE, PUT), but are recommended primarily for GET requests.