@@ -7,7 +7,9 @@ There are several API endpoints:
77
88- [ ` GET / ` ] ( #index ) : check if API is running (just returns ` It works! ` message)
99- [ ` POST /datapoints ` ] ( #insert-datapoints ) : insert datapoints into DP³
10- - [ ` GET /entity/<entity_type> ` ] ( #list-entities ) : list current snapshots of all entities of given type
10+ - ~~ [ ` GET /entity/<entity_type> ` ] ( #list-entities ) : list current snapshots of all entities of given type~~
11+ - [ ` GET /entity/<entity_type>/get ` ] ( #get-entities ) : get current snapshots of entities of entity type
12+ - [ ` GET /entity/<entity_type>/count ` ] ( #count-entities ) : get total document count for query of entity type
1113- [ ` GET /entity/<entity_type>/<entity_id> ` ] ( #get-eid-data ) : get data of entity with given entity id
1214- [ ` GET /entity/<entity_type>/<entity_id>/get/<attr_id> ` ] ( #get-attr-value ) : get attribute value
1315- [ ` GET /entity/<entity_type>/<entity_id>/set/<attr_id> ` ] ( #set-attr-value ) : set attribute value
@@ -198,8 +200,46 @@ v -> some_embedded_dict_field
198200
199201## List entities
200202
203+ !!! warning "Deprecated"
204+
205+ This endpoint is deprecated and will be removed in the future,
206+ Use [`GET /entity/<entity_type>/get`](#get-entities) to get paged documents and
207+ [`GET /entity/<entity_type>/count`](#count-entities) to get total document count for query.
208+
201209List latest snapshots of all ids present in database under entity type,
202210filtered by ` generic_filter ` and ` fulltext_filters ` .
211+ Contains only the latest snapshot per entity.
212+
213+ Counts all results for given query.
214+
215+ ### Request
216+
217+ ` GET /entity/<entity_type> `
218+
219+ ** Optional query parameters:**
220+
221+ - skip: how many entities to skip (default: 0)
222+ - limit: how many entities to return (default: 20)
223+ - fulltext_filters: dictionary of fulltext filters (default: no filters)
224+ - generic_filter: dictionary of generic filters (default: no filters)
225+
226+ ### Response
227+
228+ ``` json
229+ {
230+ "time_created" : " 2023-07-04T12:10:38.827Z" ,
231+ "data" : [
232+ {}
233+ ]
234+ }
235+ ```
236+
237+ ---
238+
239+ ## Get entities
240+
241+ Get a list of latest snapshots of all ids present in database under entity type,
242+ filtered by ` generic_filter ` and ` fulltext_filters ` .
203243Contains only the latest snapshot per entity.
204244
205245Uses pagination, default limit is 20, setting to 0 will return all results.
@@ -244,6 +284,31 @@ Generic and fulltext filters are merged - fulltext overrides conflicting keys.
244284
245285---
246286
287+ ## Count entities
288+
289+ Count latest snapshots of all ids present in database under entity type,
290+ filtered by ` generic_filter ` and ` fulltext_filters ` .
291+ See [ ` GET /entity/<entity_type>/get ` ] ( #get-entities ) for details on filter format.
292+
293+ ### Request
294+
295+ ` GET /entity/<entity_type>/count `
296+
297+ ** Optional query parameters:**
298+
299+ - fulltext_filters: dictionary of fulltext filters (default: no filters)
300+ - generic_filter: dictionary of generic filters (default: no filters)
301+
302+ ### Response
303+
304+ ``` json
305+ {
306+ "total_count" : 0
307+ }
308+ ```
309+
310+ ---
311+
247312## Get Eid data
248313
249314Get data of entity type's eid.
0 commit comments