HarryMuscle
Contributor
- Joined
- Nov 15, 2021
- Messages
- 161
I'm trying to figure out how to set a nested attribute with the user.set_attribute API. If you retrieve information about a user using the GET based user API call you get amongst other things the following:
So clearly nested attributes are possible, however, I can't figure out how to specify the nesting via the API call. The basic API call is:
But I need the "dateFormat" key to be nested inside "preferences" and I'm not sure how to accomplish that.
Thanks,
Harry
Code:
{
...
"microsoft_account": false,
"attributes": {
"preferences": {
"platform": "freenas",
"retroLogo": false,
"timestamp": "2021-12-30T17:02:16.695Z",
...
"dateFormat": "YYYY-MM-DD",
"timeFormat": "HH:mm:ss",
...
}
}
},
"email": null,
...
}
So clearly nested attributes are possible, however, I can't figure out how to specify the nesting via the API call. The basic API call is:
Code:
midclt call user.set_attribute 1 "dateFormat" "MMMM d, yyyy"
But I need the "dateFormat" key to be nested inside "preferences" and I'm not sure how to accomplish that.
Thanks,
Harry