KRON PAM API Collection v3.5
User Management
Save User Group
1 min
code examples curl location globoff '{{url}}/aioc rest web/rest/user/saveusergroup' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'x xsrf token {{csrftoken}}' \\ \ data '"{\r\n\t\\"eid\\" \\"ug create\\",\r\n \\"users\\" \[\r\n {\r\n \\"id\\" \\"3f53ceec 3c3a 40a5 961a a1ea0ec8f6de\\"\r\n \r\n }\r\n ],\r\n \\"managers\\" \[\r\n {\r\n \\"id\\" \\"3f53ceec 3c3a 40a5 961a a1ea0ec8f6de\\"\r\n }\r\n \t]\r\n}"'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("x xsrf token", "{{csrftoken}}"); var raw = json stringify("{\r\n\t\\"eid\\" \\"ug create\\",\r\n \\"users\\" \[\r\n {\r\n \\"id\\" \\"3f53ceec 3c3a 40a5 961a a1ea0ec8f6de\\"\r\n \r\n }\r\n ],\r\n \\"managers\\" \[\r\n {\r\n \\"id\\" \\"3f53ceec 3c3a 40a5 961a a1ea0ec8f6de\\"\r\n }\r\n \t]\r\n}"); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("{{url}}/aioc rest web/rest/user/saveusergroup", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("{{url}}/aioc rest web/rest/user/saveusergroup") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["x xsrf token"] = "{{csrftoken}}" request body = json dump("{\r\n\t\\"eid\\" \\"ug create\\",\r\n \\"users\\" \[\r\n {\r\n \\"id\\" \\"3f53ceec 3c3a 40a5 961a a1ea0ec8f6de\\"\r\n \r\n }\r\n ],\r\n \\"managers\\" \[\r\n {\r\n \\"id\\" \\"3f53ceec 3c3a 40a5 961a a1ea0ec8f6de\\"\r\n }\r\n \t]\r\n}") response = http request(request) puts response read body import requests import json url = "{{url}}/aioc rest web/rest/user/saveusergroup" payload = json dumps("{\r\n\t\\"eid\\" \\"ug create\\",\r\n \\"users\\" \[\r\n {\r\n \\"id\\" \\"3f53ceec 3c3a 40a5 961a a1ea0ec8f6de\\"\r\n \r\n }\r\n ],\r\n \\"managers\\" \[\r\n {\r\n \\"id\\" \\"3f53ceec 3c3a 40a5 961a a1ea0ec8f6de\\"\r\n }\r\n \t]\r\n}") headers = { 'accept' 'application/json', 'content type' 'application/json', 'x xsrf token' '{{csrftoken}}' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses { "id" "a177be61 8850 4f03 be1c 3ce275f02c1f", "eid" "testuser", "personelid" "123123", "name" "test", "passwordalgorithm" "md5", "password" "21232f297a57a5a743894a0e4a801fc3", "email" "test\@test com", "surname" "user", "internal" true, "properties" { "phonenumber" "5550000000", "ubathreshold" "50" }, "groups" \[ "default group sysyem admins", "default group sysyem users" ], "managergroups" \[], "lastlogin" null, "lastloginip" null, "recordlimit4search" null, "passworddirty" false, "passwordautogenerated" false, "phonenumber" "5550000000", "forcechangepasswordonnextlogin" false, "lockreason" null, "unlockonpasswordchanged" false, "unlocktime" null, "tempuserendtime" null, "tempuserstarttime" null, "tempuser" false, "externaldirectorysource" null, "userpropertykey4search" null, "userpropertyvalue4search" null, "locked" false }