Add Vault Group
1 min
POST
{{url}}/aioc-rest-web/rest/sc/sapm/addSapmGroup
Path Parameters
- urlstringDefaulturl
Header Parameters
- X-XSRF-TOKENstringDefault{{csrftoken}}
Body Parameters
- bodyobjectDefault{ "name":"sapmGroup1", "description":"new group", "parentSapmGroupId":1111 }
Responses
200
curl
curl --request POST \
--url {{url}}/aioc-rest-web/rest/sc/sapm/addSapmGroup \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-xsrf-token: {{csrftoken}}' \
--data '"{\n\t\"name\":\"sapmGroup1\",\n\t\"description\":\"new group\",\n \"parentSapmGroupId\":1111\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("{\n\t\"name\":\"sapmGroup1\",\n\t\"description\":\"new group\",\n \"parentSapmGroupId\":1111\n}");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("{{url}}/aioc-rest-web/rest/sc/sapm/addSapmGroup", 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/sc/sapm/addSapmGroup")
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("{\n\t\"name\":\"sapmGroup1\",\n\t\"description\":\"new group\",\n \"parentSapmGroupId\":1111\n}")
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "{{url}}/aioc-rest-web/rest/sc/sapm/addSapmGroup"
payload = json.dumps("{\n\t\"name\":\"sapmGroup1\",\n\t\"description\":\"new group\",\n \"parentSapmGroupId\":1111\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
{
"dbId": 61324,
"id": "62b9350a-fbf8-4df2-80a4-18ca5c746b45",
"name": "sapmGroup1",
"description": "new group",
"parentSapmGroupId": null,
"permissions": {},
"newPermission": {},
"permissionToDelete": {},
"children": [],
"userCreate": "admin",
"parent": null,
"userPermissionLevel": 3,
"managers": [],
"newGroupManager": null,
"groupManagerToDelete": null,
"approvalStatus": null,
"fullPath": "/sapmGroup1",
"approvalRequired": false,
"manager": false,
"newApprovalRequired": false,
"auditor": false
}