KRON PAM API Collection v3.7.0
User Management
Add Assigned Credentials For User
1 min
code examples curl location globoff '{{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}"'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));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 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) responses success