Save Request
1 min
POST
{{url}}/aioc-rest-web/rest/rap/saveRequest
Path Parameters
- urlstringDefaulturl
Header Parameters
- X-XSRF-TOKENstringDefault{{csrftoken}}
Body Parameters
- bodyobjectDefault{ "userInfo": [ { "userInfoId": "f8ea68b3-fe96-4965-a295-b9e5ec0b3222", "userInfoEid": "user-all-001", "userType": "USER" } ], "deviceInfo": [ { "deviceInfoId": "dbcd3354-5fde-4de9-8305-f3ebde5cda29", "deviceType": "DEVICE", "deviceInfoEid": "10.20.42.55-LDAP - 10.20.42.55" }, { "deviceInfoId": "54826eea-f5c1-446f-94ac-fbb9d2685e06", "deviceType": "DEVICE", "deviceInfoEid": "10.20.42.129-Linux1 - 10.20.42.129" } ], "isSMSEnabled": true, "startTime": 17391937820000, "endTime": 17391937820001, "timeByDay": null }
Responses
200
curl
curl --request POST \
--url {{url}}/aioc-rest-web/rest/rap/saveRequest \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-xsrf-token: {{csrftoken}}' \
--data '"{\r\n \"userInfo\": [\r\n {\r\n \"userInfoId\": \"f8ea68b3-fe96-4965-a295-b9e5ec0b3222\",\r\n \"userInfoEid\": \"user-all-001\",\r\n \"userType\": \"USER\"\r\n }\r\n ],\r\n \"deviceInfo\": [\r\n {\r\n \"deviceInfoId\": \"dbcd3354-5fde-4de9-8305-f3ebde5cda29\",\r\n \"deviceType\": \"DEVICE\",\r\n \"deviceInfoEid\": \"10.20.42.55-LDAP - 10.20.42.55\"\r\n },\r\n {\r\n \"deviceInfoId\": \"54826eea-f5c1-446f-94ac-fbb9d2685e06\",\r\n \"deviceType\": \"DEVICE\",\r\n \"deviceInfoEid\": \"10.20.42.129-Linux1 - 10.20.42.129\"\r\n }\r\n ],\r\n \"isSMSEnabled\": true,\r\n \"startTime\": 17391937820000,\r\n \"endTime\": 17391937820001,\r\n \"timeByDay\": null\r\n}\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 \"userInfo\": [\r\n {\r\n \"userInfoId\": \"f8ea68b3-fe96-4965-a295-b9e5ec0b3222\",\r\n \"userInfoEid\": \"user-all-001\",\r\n \"userType\": \"USER\"\r\n }\r\n ],\r\n \"deviceInfo\": [\r\n {\r\n \"deviceInfoId\": \"dbcd3354-5fde-4de9-8305-f3ebde5cda29\",\r\n \"deviceType\": \"DEVICE\",\r\n \"deviceInfoEid\": \"10.20.42.55-LDAP - 10.20.42.55\"\r\n },\r\n {\r\n \"deviceInfoId\": \"54826eea-f5c1-446f-94ac-fbb9d2685e06\",\r\n \"deviceType\": \"DEVICE\",\r\n \"deviceInfoEid\": \"10.20.42.129-Linux1 - 10.20.42.129\"\r\n }\r\n ],\r\n \"isSMSEnabled\": true,\r\n \"startTime\": 17391937820000,\r\n \"endTime\": 17391937820001,\r\n \"timeByDay\": null\r\n}\r\n");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("{{url}}/aioc-rest-web/rest/rap/saveRequest", 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/rap/saveRequest")
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 \"userInfo\": [\r\n {\r\n \"userInfoId\": \"f8ea68b3-fe96-4965-a295-b9e5ec0b3222\",\r\n \"userInfoEid\": \"user-all-001\",\r\n \"userType\": \"USER\"\r\n }\r\n ],\r\n \"deviceInfo\": [\r\n {\r\n \"deviceInfoId\": \"dbcd3354-5fde-4de9-8305-f3ebde5cda29\",\r\n \"deviceType\": \"DEVICE\",\r\n \"deviceInfoEid\": \"10.20.42.55-LDAP - 10.20.42.55\"\r\n },\r\n {\r\n \"deviceInfoId\": \"54826eea-f5c1-446f-94ac-fbb9d2685e06\",\r\n \"deviceType\": \"DEVICE\",\r\n \"deviceInfoEid\": \"10.20.42.129-Linux1 - 10.20.42.129\"\r\n }\r\n ],\r\n \"isSMSEnabled\": true,\r\n \"startTime\": 17391937820000,\r\n \"endTime\": 17391937820001,\r\n \"timeByDay\": null\r\n}\r\n")
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "{{url}}/aioc-rest-web/rest/rap/saveRequest"
payload = json.dumps("{\r\n \"userInfo\": [\r\n {\r\n \"userInfoId\": \"f8ea68b3-fe96-4965-a295-b9e5ec0b3222\",\r\n \"userInfoEid\": \"user-all-001\",\r\n \"userType\": \"USER\"\r\n }\r\n ],\r\n \"deviceInfo\": [\r\n {\r\n \"deviceInfoId\": \"dbcd3354-5fde-4de9-8305-f3ebde5cda29\",\r\n \"deviceType\": \"DEVICE\",\r\n \"deviceInfoEid\": \"10.20.42.55-LDAP - 10.20.42.55\"\r\n },\r\n {\r\n \"deviceInfoId\": \"54826eea-f5c1-446f-94ac-fbb9d2685e06\",\r\n \"deviceType\": \"DEVICE\",\r\n \"deviceInfoEid\": \"10.20.42.129-Linux1 - 10.20.42.129\"\r\n }\r\n ],\r\n \"isSMSEnabled\": true,\r\n \"startTime\": 17391937820000,\r\n \"endTime\": 17391937820001,\r\n \"timeByDay\": null\r\n}\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
{
"dbId": "262a1d84-552f-43d0-9757-ab06b21fc902",
"timeByDay": null,
"userInfo": [
{
"id": "bf352193-dfb5-483f-ae0f-803dcdf623d8",
"requestId": null,
"userInfoId": "f8ea68b3-fe96-4965-a295-b9e5ec0b3222",
"userInfoEid": "user-all-001",
"userType": "USER"
}
],
"deviceInfo": [
{
"id": "876cf753-3286-4a66-9e6a-bbb6f3cc2558",
"requestId": null,
"deviceInfoId": "dbcd3354-5fde-4de9-8305-f3ebde5cda29",
"deviceInfoEid": "10.20.42.55-LDAP - 10.20.42.55",
"deviceType": "DEVICE"
},
{
"id": "5b46d333-9e7f-4af2-96d9-f51ca81a673f",
"requestId": null,
"deviceInfoId": "54826eea-f5c1-446f-94ac-fbb9d2685e06",
"deviceInfoEid": "10.20.42.129-Linux1 - 10.20.42.129",
"deviceType": "DEVICE"
}
],
"createdBy": {
"id": "25e53f47-ce66-4df2-9abc-6961dc668264",
"eid": "admin"
},
"startTime": 17391937820000,
"endTime": 17391937820001,
"isSMSEnabled": true,
"alreadyAssignedCheck": true
}