Hello,
I am trying to update the data in a device-scoped Ledger and running into issues. I'm following the API docs at: Cloud API reference | Reference Documentation | Particle
I'm doing this in Python but trying the curl commands as well. The curl command and Python equivalent I'm trying are:
curl -i -X PUT "https://api.particle.io/v1/orgs/MY_ORG/ledgers/MY_LEDGER/instances/MY_DEVICE_ID" \
-H "Authorization: Bearer MY_API_TOKEN" \
--data @data.json
where data.json
contains what my Ledger data has and what I want to update it to:
{
"test_var": true,
"test_var_2": 20
}
However the response that comes back is:
{"ok":false,"error_description":"Body JSON was not in the correct format! missing field `instance` at line 1 column 54"}
Can someone please provide a sample JSON payload for what the data is supposed to look like? If I wrap the JSON Ledger data.json in an instance
to look like:
{
"instance": {
"test_var": true,
"test_var_2": 20
}
}
then I still get back
{"ok":false,"error_description":"Body JSON was not in the correct format! missing field `instance` at line 1 column 74"}
So what should the data.json actually contain for my example?
Thank you