The query API is not public.
All API access requires a key provided as the parameter secret
.
This key will be provided on demand by the Bandung OC team.
https://webhooks.mongodb-stitch.com/api/client/v2.0/app/birms-cvrbm/service/query-birms/incoming_webhook/get-by-ocid?secret=[secret]&ocid=[ocid]
Get one OCDS release document for the release with the given ocid
.
Example:
https://webhooks.mongodb-stitch.com/api/client/v2.0/app/birms-cvrbm/service/query-birms/incoming_webhook/get-by-ocid?secret=[secret]&ocid=ocds-afzrfb-s-2016-5043143
The following URL will search the database for all releases and optionally filter
them by the given query using the q
parameter. It can also limit the number of results
returned by the use of limit
parameter, with a default value of 20.
Pagination is provided using the last MongoDB document with _id
displayed, using fromId
parameter.
This is an efficient results pagination method described in detail here (Approach 2):
https://www.codementor.io/arpitbhayani/fast-and-efficient-pagination-in-mongodb-9095flbqr
The query syntax of the q
parameter follows the MongoDB query syntax
https://docs.mongodb.com/manual/tutorial/query-documents/
Examples:
https://webhooks.mongodb-stitch.com/api/client/v2.0/app/birms-cvrbm/service/query-birms/incoming_webhook/find-releases?secret=[secret]
https://webhooks.mongodb-stitch.com/api/client/v2.0/app/birms-cvrbm/service/query-birms/incoming_webhook/find-releases?secret=[secret]&limit=100
Get the releases in the system that have non-empty tender.value.amount
property and limit results to 50 per page
https://webhooks.mongodb-stitch.com/api/client/v2.0/app/birms-cvrbm/service/query-birms/incoming_webhook/find-releases?secret=[secret]&q={"tender.value.amount":{"$exists":true}}&limit=50
Get the releases in the system that have non-empty tender.value.amount
property and limit results to 2 per page, but start from the second page.
We know for the first page, the internal MongoDB _id
property of the last document was 5b7528ecb7d7c3728366810f
.
https://webhooks.mongodb-stitch.com/api/client/v2.0/app/birms-cvrbm/service/query-birms/incoming_webhook/find-releases?secret=[secret]&q={"tender.value.amount":{"$exists":true}}&limit=2&fromId=5b7528ecb7d7c3728366810f
This is similar to find releases endpoint above, but it just counts the items, hence it does not provide pagination.
Examples:
https://webhooks.mongodb-stitch.com/api/client/v2.0/app/birms-cvrbm/service/query-birms/incoming_webhook/count-releases?secret=[secret]
https://webhooks.mongodb-stitch.com/api/client/v2.0/app/birms-cvrbm/service/query-birms/incoming_webhook/count-releases?secret=[secret]&q={"tender.value.amount":{"$exists":true}}
https://webhooks.mongodb-stitch.com/api/client/v2.0/app/birms-cvrbm/service/query-birms/incoming_webhook/find-errors?secret=[secret]
https://webhooks.mongodb-stitch.com/api/client/v2.0/app/birms-cvrbm/service/query-birms/incoming_webhook/count-errors?secret=[secret]