When I tried to update user’s department through API using Update User’s Departments - Kintone Developer Program as reference, this error appeared
My code:
var body = {
'code': 'my_user_code',
'organizations': [
{
'orgCode': 'department_code',
'titleCode': null
}
]
};
kintone.api(kintone.api.url('/v1/userOrganizations', true), 'PUT', body, function(resp) {
// success
console.log(resp);
}, function(error) {
// error
console.log(error);
});
Note that my_user_code
and department_code
is correct as I used correctly in other APIs and I have admin permission.
i also try to update using this body ( mean remove all user’s department) but the same error occurred.
var body = {
'code': 'my_user_code',
'organizations': [
]
};