Save User Group
1 min
POST
{{url}}/aioc-rest-web/rest/user/saveUserGroup
Path Parameters
- urlstringDefaulturl
Header Parameters
- Content-TypestringDefaultapplication/json
- X-XSRF-TOKENstringDefault{{csrftoken}}
Body Parameters
- bodyobjectDefault{ "eid": "UG_create", "users": [ { "id": "3f53ceec-3c3a-40a5-961a-a1ea0ec8f6de" } ], "managers": [ { "id": "3f53ceec-3c3a-40a5-961a-a1ea0ec8f6de" } ] }
Responses
200
curl
curl --request POST \
--url {{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}"'javascript
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));ruby
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
python
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)
200
{
"id": "a177be61-8850-4f03-be1c-3ce275f02c1f",
"eid": "testuser",
"personelId": "123123",
"name": "test",
"passwordAlgorithm": "MD5",
"password": "21232f297a57a5a743894a0e4a801fc3",
"email": "[email protected]",
"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
}