Hello!
There is not parking intervals in response.
You can get only trips, and trips with less speed (stops).
The parkings are calculated as difference between trips time.
First load, then get all full trips, and then get trips intervals (with speed less) as stops.
https://hst-api.wialon.com/wialon/ajax.html?svc=events/load¶ms={"ivalType":1,"itemId":21728414,"timeFrom":1609718400,"timeTo":1609891199,"detectors":[{"type":"trips","filter1":0}]}&sid=026499c89bc755056c401314b35bfa9f
https://hst-api.wialon.com/wialon/ajax.html?svc=events/get¶ms={"selector":{"type":"trips","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}&sid=026499c89bc755056c401314b35bfa9f
https://hst-api.wialon.com/wialon/ajax.html?svc=events/get¶ms={"selector":{"expr":"trips{s<1}","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}&sid=026499c89bc755056c401314b35bfa9f
All 3 requests can be execute at one svc=core/batch
Format like
https://hst-api.wialon.com/wialon/ajax.html?svc=core/batch&sid=026499c89bc755056c401314b35bfa9f¶ms={"params":[{},{},{}]}
where JSON object in array is a request {"svc":"...","params":{...}}
Example
https://hst-api.wialon.com/wialon/ajax.html?svc=core/batch&sid=026499c89bc755056c401314b35bfa9f¶ms={"params":[{"svc":"events/load","params":{"ivalType":1,"itemId":21728414,"timeFrom":1609718400,"timeTo":1609891199,"detectors":[{"type":"trips","filter1":0}]}},{"svc":"events/get","params":{"selector":{"type":"trips","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}},{"svc":"events/get","params":{"selector":{"expr":"trips{s<1}","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}}],"flags":0}
The response will contain full trips (in example 5 full trips) and stops intervals (in example 6 intervals)
[{"events":{"trips":{"0":5}},"states":{"trips":{"updateTime":1606694400}},"selector":{}},{"trips":{"0":[{"from":{"t":1609740136,"y":46.8365631104,"x":-2.789290905},"to":{"t":1609740381,"y":46.3055648804,"x":-2.789290905},"m":1609740681,"f":2},{"from":{"t":1609747691,"y":46.3055648804,"x":-2.789290905},"to":{"t":1609748071,"y":43.3003921509,"x":-2.0059273243},"m":1609748385,"f":2},{"from":{"t":1609748558,"y":43.3003921509,"x":-2.0059273243},"to":{"t":1609748851,"y":43.4693832397,"x":-3.83861064911},"m":1609749180,"f":2},{"from":{"t":1609749642,"y":43.4693832397,"x":-3.83861064911},"to":{"t":1609750584,"y":43.3473701477,"x":-8.48857975006},"m":1609750884,"f":2},{"from":{"t":1609753417,"y":43.3473701477,"x":-8.48857975006},"to":{"t":1609754439,"y":42.4268341064,"x":-8.6491394043},"m":1609754768,"f":2}]}},{"trips":{"0":[{"from":{"t":1609740321,"y":46.3055648804,"x":-2.789290905},"to":{"t":1609740351,"y":46.3055648804,"x":-2.789290905},"m":0,"f":0},{"from":{"t":1609747781,"y":46.2055625916,"x":-2.98929095268},"to":{"t":1609747981,"y":43.3233222961,"x":-2.00242733955},"m":0,"f":0},{"from":{"t":1609748041,"y":43.3003921509,"x":-2.0059273243},"to":{"t":1609748041,"y":43.3003921509,"x":-2.0059273243},"m":0,"f":0},{"from":{"t":1609748588,"y":43.3103904724,"x":-2.0059273243},"to":{"t":1609748822,"y":43.4533843994,"x":-3.83861064911},"m":0,"f":0},{"from":{"t":1609750500,"y":43.3473701477,"x":-8.40155792236},"to":{"t":1609750500,"y":43.3473701477,"x":-8.40155792236},"m":0,"f":0},{"from":{"t":1609753595,"y":42.4268341064,"x":-8.6491394043},"to":{"t":1609754408,"y":42.4268341064,"x":-8.6491394043},"m":0,"f":0}]}}]
If you need to load trips from new interval, you need to execute request svc=events/unload, then load new intervals.
Diana Cheley
Wialon Hosting Expert
Gurtam