You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,11 +90,11 @@ A full list of error codes can be found by navigating to /api/v1/system/api/erro
90
90
91
91
92
92
# Queries
93
-
pfSense API contains an advanced query engine to make it easy to query specific data from API alls. For endpoints supporting `GET` requests, you may query the return data to only return data you are looking for. To query data, you may add the data you are looking for to your payload. You may specify as many query parameters as you like to, in order to match the query, each parameter must match exactly, or utilize a query filter to set criteria. If no matches were found, the endpoint will return an empty array in the data field.
93
+
pfSense API contains an advanced query engine to make it easy to query specific data from API calls. For endpoints supporting `GET` requests, you may query the return data to only return data you are looking for. To query data, you may add the data you are looking for to your payload. You may specify as many query parameters as you need. In order to match the query, each parameter must match exactly, or utilize a query filter to set criteria. If no matches were found, the endpoint will return an empty array in the data field.
94
94
<details>
95
95
<summary>Targetting Objects</summary>
96
96
97
-
You may find yourself only needing to read objects with specific values set. For example, say an API endpoint normally returns a response like this without a query:
97
+
You may find yourself only needing to read objects with specific values set. For example, say an API endpoint normally returns this response without a query:
98
98
99
99
```json
100
100
{
@@ -111,7 +111,7 @@ You may find yourself only needing to read objects with specific values set. For
111
111
}
112
112
```
113
113
114
-
If you want the endpoint to only return the objects that had their `type` set to `type1` you could add `{"type": "type1"}` to your payload. This returns:
114
+
If you want the endpoint to only return the objects that have their `type` value set to `type1` you could add `{"type": "type1"}` to your payload. This returns:
115
115
116
116
```json
117
117
{
@@ -126,7 +126,7 @@ If you want the endpoint to only return the objects that had their `type` set to
126
126
}
127
127
```
128
128
129
-
Additionally, if you need to target values that are nested within an array, you could add `{"extra__tag": 100}` to recursively target the `tag` value within the `extra` array. This returns:
129
+
Additionally, if you need to target values that are nested within an array, you can add `{"extra__tag": 100}` to recursively target the `tag` value within the `extra` array. This returns:
130
130
131
131
```json
132
132
{
@@ -145,7 +145,7 @@ Additionally, if you need to target values that are nested within an array, you
145
145
<details>
146
146
<summary>Query Filters</summary>
147
147
148
-
Query filters allow you to apply logic to the objects you target. This makes it easy to target data that meets certain criteria:
148
+
Query filters allow you to apply logic to the objects you target. This makes it easy to target data that meets specific criteria:
149
149
150
150
### Starts With
151
151
@@ -387,7 +387,7 @@ If you wanted to target objects whose tag is greater than or equal to `100`, you
387
387
### Requirements for queries:
388
388
- API call must be successful and return `0` in the `return` field.
389
389
- Endpoints must return an array of objects in the data field (e.g. `[{"id": 0, "name": "Test"}, {"id": 1, "name": "Other Test"}]`).
390
-
- At least two objects must be present within the array to support queries.
390
+
- At least two objects must be present within the data field to support queries.
391
391
392
392
### Notes:
393
393
- For those using the Local database or API token authentication types, `client-id` and `client-token` are excluded from queries by default
0 commit comments