nightscout / cgm-remote-monitor

nightscout web monitor
GNU Affero General Public License v3.0
2.38k stars 71.59k forks source link

Sensor Change Treatments disappear when older than 4 days on api/v1 #8094

Closed Joerg-Schoemer closed 11 months ago

Joerg-Schoemer commented 11 months ago

When using REST API v1 to query sensor changes they disappear after approximately 4 days.

To Reproduce Query with type filter on v1/treatments…

Expected behavior Get all Sensor Change Treatments when query on api/v1 even when the treatment was entered more than 4 days ago.

setup information

sulkaharo commented 11 months ago

The API only returns recent data, unless you query it with a date filter or a count parameter.

Joerg-Schoemer commented 11 months ago

I'm currently using the following request: /api/v1/treatments.json?token=(token)&find[eventType]=Site%20Change&count=1

bewest commented 11 months ago

Add a query component to filter the find[created_at][$gte]=0, or a more relevant timestring like the ISO8601 date from four days ago. If the query parameter is absent, only a limited amount of data is queried by default.

Joerg-Schoemer commented 11 months ago

I‘ll give it a try 😀

Joerg-Schoemer commented 11 months ago

it works 😄

Joerg-Schoemer commented 11 months ago

The API only returns recent data, unless you query it with a date filter or a count parameter.

only count parameter doesn't work