API endpoint that will return a list of records that match the given criteria.
Note: This API documentation is intended to give the reader an overview of the APIs capabilities and how to access them. When trying to write API calls, we strongly recommend you use the API documentation directly associated with the specific API key you will be calling. That documentation includes examples with the actual IDs of the form and form elements, includes examples for each field available in the associated forms etc. This will allow direct copy-paste of the code snippets from the documentation into your code. If you were to try and use the examples in this documentation, you would have to modify them for the fields, form ID, etc.
HTTP request
POST https://api.gwapps.com/v1/forms/formId/records/search
Parameters
Parameter | Description | Type | Default |
---|---|---|---|
Optional query parameters | |||
fields | Comma separated list of fields (See the Overview section to get the list of available fields) | string | |
maxResult | Maximum number of entries returned in one result page. By default the value is set to 100. Valid range is 1 – 200. | number | 100 |
pageNumber | The page number, the response will return the flag hasNext that can be used to check if there are more pages and increment the pageNumber until there are no more pages to return. | number | 1 |
orderBy | A field list comma separated. e.g. stage to sort the list in ascending order and -stage to sort the list in descending order. | string | |
q | A string to search against the record fields. | string |
Request Body
Parameter | Description | Type |
---|---|---|
Optional parameters | ||
filters | The array of filters to apply when searching records, (See Filters to get the list of available operators) | Array |
filters.fieldCode | Field Short Code | Each value is different depending on the field type |
filters.operator | The operator to apply for search | string |
filters.value | The value to search for | string |
Example Request
POST https://api.gwapps.com/v1/forms/66b18359dc7659dc4cb98d15/records/search
start
Note: If you pass a field that does not exist in the current form you will get a Bad Request
error response. You can take a look in the Overview section to review the available fields for this form.
{ "filters": [ { "fieldCode": "company1", "operator": "EQUALS", "value": "Vipe" }, { "fieldCode": "stage", "operator": "IN", "value": [ "stg0" ] } ] }
Refer to Filters to see the operators and further examples.
Response
The response returned will have an array of records, where
Attribute | Description | Type |
---|---|---|
count | Total users | number |
current | Current page number | number |
totalPages | Total pages | number |
hasNext | Has a next page | boolean |
records | List of records | Array |
records._id | The record ID | string |
records.stage | The record’s stage | Stage |
records.shortCode | Depends on field type | Each value is different depending on the field type |
Example Response
{ "kind": "form#records", "count": 5, "current": 1, "hasNext": false, "totalPages": 1, "records": [ { "_id": "recordId", "meta": { "appId": "6266db8cbd86d9001a70c9ea", "formId": "66b18359dc7659dc4cb98d15" }, "stage": "stg0" } ] }
Related API Articles
This article covers details for a specific API call/endpoint. Details of the overall Records API structure and calls/endpoints can be found in the GW Apps Records API article. Information on creating API Keys can be found within the API section of the Platform Settings, and in the Security > API Keys section of Edit App within each application.