Add Assigned Credentials For User
1 min
POST
{{url}}/aioc-rest-web/rest/sc/assignedCredentials/ui/saveAssignedCredentials
Path Parameters
- urlstringDefaulturl
Header Parameters
- X-XSRF-TOKENstringDefault{{csrftoken}}
Body Parameters
- bodyobjectDefault{ "userSelection": "USER", "assignedCredentialUserId": "a40e6211-f510-4ad0-a4f7-8aa6cd169c56", "assignedCredentialGroupId": null, "credentialSourceAsEnum": "SAPM", "sapmAccountId": 1887375, "devicesOrDeviceGroups": [ { "deviceId": null, "deviceGroupId": 607096 } ], "applyForAllDevices": false }
Responses
200
curl
curl --request POST \
--url {{url}}/aioc-rest-web/rest/sc/assignedCredentials/ui/saveAssignedCredentials \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-xsrf-token: {{csrftoken}}' \
--data '"{\r\n \"userSelection\": \"USER\",\r\n \"assignedCredentialUserId\": \"a40e6211-f510-4ad0-a4f7-8aa6cd169c56\",\r\n \"assignedCredentialGroupId\": null,\r\n \"credentialSourceAsEnum\": \"SAPM\",\r\n \"sapmAccountId\": 1887375,\r\n \"devicesOrDeviceGroups\": [\r\n\t{\r\n\t\t\"deviceId\": null,\r\n\t\t\"deviceGroupId\": 607096 \r\n\t}\r\n ],\r\n \"applyForAllDevices\": false\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 \"userSelection\": \"USER\",\r\n \"assignedCredentialUserId\": \"a40e6211-f510-4ad0-a4f7-8aa6cd169c56\",\r\n \"assignedCredentialGroupId\": null,\r\n \"credentialSourceAsEnum\": \"SAPM\",\r\n \"sapmAccountId\": 1887375,\r\n \"devicesOrDeviceGroups\": [\r\n\t{\r\n\t\t\"deviceId\": null,\r\n\t\t\"deviceGroupId\": 607096 \r\n\t}\r\n ],\r\n \"applyForAllDevices\": false\r\n}");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("{{url}}/aioc-rest-web/rest/sc/assignedCredentials/ui/saveAssignedCredentials", 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/assignedCredentials/ui/saveAssignedCredentials")
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 \"userSelection\": \"USER\",\r\n \"assignedCredentialUserId\": \"a40e6211-f510-4ad0-a4f7-8aa6cd169c56\",\r\n \"assignedCredentialGroupId\": null,\r\n \"credentialSourceAsEnum\": \"SAPM\",\r\n \"sapmAccountId\": 1887375,\r\n \"devicesOrDeviceGroups\": [\r\n\t{\r\n\t\t\"deviceId\": null,\r\n\t\t\"deviceGroupId\": 607096 \r\n\t}\r\n ],\r\n \"applyForAllDevices\": false\r\n}")
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "{{url}}/aioc-rest-web/rest/sc/assignedCredentials/ui/saveAssignedCredentials"
payload = json.dumps("{\r\n \"userSelection\": \"USER\",\r\n \"assignedCredentialUserId\": \"a40e6211-f510-4ad0-a4f7-8aa6cd169c56\",\r\n \"assignedCredentialGroupId\": null,\r\n \"credentialSourceAsEnum\": \"SAPM\",\r\n \"sapmAccountId\": 1887375,\r\n \"devicesOrDeviceGroups\": [\r\n\t{\r\n\t\t\"deviceId\": null,\r\n\t\t\"deviceGroupId\": 607096 \r\n\t}\r\n ],\r\n \"applyForAllDevices\": false\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
SUCCESS