Add contact group using webapi to user created by ldap syncronization

It would be nice to be able to Add contact group using webapi to user created by ldap syncronization.
At this moment it is possible to do with a user that was created directly in check mk, but not a synchronized user.

use this:

root@linux# curl “http://myserver/mysite/check_mk/webapi.py?action=edit_users&_username=automation&_secret=myautomationsecret” -d ’ request={“users”:{“hhirsch”:{“set_attributes”:{“email":"hhirsch@myCompany.org”, “contactgroups”:[“windows”]},“unset_attributes”:[“pager”]}}}’

as you can see contactgroups is set to windows so you have change that and delete attributes which you dont want.

https://checkmk.de/cms_web_api_references.html#edit_users

Yes and as I mentioned that seems to work fine if the user was created directly in check MK, But if your user was created By LDAP sync, that command will result in an error

Do you test the same command for user created in check_mk and in LDAP ? If not try that… :slight_smile:

  1. Test the command for user created in WATO
  2. Test the same command for LDAP users

as i have mentioned, i have tested both scenarios, and it does work for the user created in WATO, but it does not work for the ldap user

Can you post that here…