Hi,
Hope I'm not going crazy or made some stupid mistake or even worse it's already been posted !
Server version is 6.0.6
I'm calling the API through curl in a bash script and I want to get only the latest history value of multiple items
All items are Text (4)
This is my request:
I'm expecting to get the latest value from all items listed in the array.
Yet I always get only the value returned from the last item in the array.
As soon as I remove the 'limit' parameter I get values from all items in the array.
So my itemids array works fine, but not with the limit parameter.
Is this expected behaviour ?
Kind regards,
Leslie
Hope I'm not going crazy or made some stupid mistake or even worse it's already been posted !
Server version is 6.0.6
I'm calling the API through curl in a bash script and I want to get only the latest history value of multiple items
All items are Text (4)
This is my request:
Code:
response=$(curl -s -X POST -H 'Content-Type: application/json-rpc' -d " \
{
\"jsonrpc\": \"2.0\",
\"method\": \"history.get\",
\"params\": {
\"output\": [\"itemid\",\"value\"],
\"itemids\": [76172,76180],
\"history\": 4,
\"sortfield\": \"clock\",
\"sortorder\": \"DESC\",
\"limit\": 1
},
\"auth\": \"$auth\",
\"id\": 1
}
" $url )
I'm expecting to get the latest value from all items listed in the array.
Yet I always get only the value returned from the last item in the array.
As soon as I remove the 'limit' parameter I get values from all items in the array.
So my itemids array works fine, but not with the limit parameter.
Is this expected behaviour ?
Kind regards,
Leslie
Comment