Querying The Database
Remember when we set the dqlFormula
of the schema to @True
and added dql
form mode in Contact
form? Both of these steps are required in order for us to run a DQL query.
Getting Contacts for a Customer
- Hover over the
Domino-REST-API-NewDB
collection name and click on the ellipsis (three dots). Select Add Request. - Name the request
get contact from customer UNID
and click Save. - Change the method from GET to POST.
- Set the URL as
{{HOST}}/query?dataSource=customers&action=execute
. - Set the headers for Authorization and Content-Type.
- On the Body tab change the type to
Raw
and also change the type fromText
toJSON
. - Set the request body content as below, but setting the UNID variable to the value for
unid
you received when creating the customer:
{
"query": "form = 'contact' and customerUNID = ?UNID",
"maxScanDocs": 500000,
"maxScanEntries": 200000,
"timeoutSecs": 300,
"viewRefresh": true,
"noViews": false,
"variables": {
"UNID": "{{parentUNID}}"
}
}
- Click Send.
- Save and close the request.
You have queried all contacts for the company requested.
Previous Page Next Page