Add Application Token Account
1 min
POST
{{url}}/aioc-rest-web/rest/aapm/addAapmAccount
Path Parameters
- urlstringDefaulturl
Header Parameters
- x-xsrf-tokenstringDefault{{x-xsrf-token}}
Body Parameters
- bodyobjectDefault{ "applicationName": "ExampleApplication", "applicationIPs": [ "192.0.2.10/32" ], "sapmAccounts": [ 100001 ], "sapmGroups": [], "restrictions": { "allowListingAccounts": false, "expiryDate": 1893456000000, "maxUsageCount": "100" }, "level": "BASIC_PIN_PATH_HASH", "properties": { "appHash": "EXAMPLE_APP_HASH", "appPath": "C:\\Program Files\\Example\\example.exe", "OSType": "WINDOWS", "OSCredentialType": "SAPM", "OSCredentialSAPM": 100001, "pinPort": 8080 } }
Responses
200
curl
curl --request POST \
--url {{url}}/aioc-rest-web/rest/aapm/addAapmAccount \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-xsrf-token: {{x-xsrf-token}}' \
--data '"{\n \"applicationName\": \"ExampleApplication\",\n \"applicationIPs\": [\n \"192.0.2.10/32\"\n ],\n \"sapmAccounts\": [\n 100001\n ],\n \"sapmGroups\": [],\n \"restrictions\": {\n \"allowListingAccounts\": false,\n \"expiryDate\": 1893456000000,\n \"maxUsageCount\": \"100\"\n },\n \"level\": \"BASIC_PIN_PATH_HASH\",\n \"properties\": {\n \"appHash\": \"EXAMPLE_APP_HASH\",\n \"appPath\": \"C:\\\\Program Files\\\\Example\\\\example.exe\",\n \"OSType\": \"WINDOWS\",\n \"OSCredentialType\": \"SAPM\",\n \"OSCredentialSAPM\": 100001,\n \"pinPort\": 8080\n }\n}"'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("x-xsrf-token", "{{x-xsrf-token}}");
var raw = JSON.stringify("{\n \"applicationName\": \"ExampleApplication\",\n \"applicationIPs\": [\n \"192.0.2.10/32\"\n ],\n \"sapmAccounts\": [\n 100001\n ],\n \"sapmGroups\": [],\n \"restrictions\": {\n \"allowListingAccounts\": false,\n \"expiryDate\": 1893456000000,\n \"maxUsageCount\": \"100\"\n },\n \"level\": \"BASIC_PIN_PATH_HASH\",\n \"properties\": {\n \"appHash\": \"EXAMPLE_APP_HASH\",\n \"appPath\": \"C:\\\\Program Files\\\\Example\\\\example.exe\",\n \"OSType\": \"WINDOWS\",\n \"OSCredentialType\": \"SAPM\",\n \"OSCredentialSAPM\": 100001,\n \"pinPort\": 8080\n }\n}");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("{{url}}/aioc-rest-web/rest/aapm/addAapmAccount", 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/aapm/addAapmAccount")
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"] = "{{x-xsrf-token}}"
request.body = JSON.dump("{\n \"applicationName\": \"ExampleApplication\",\n \"applicationIPs\": [\n \"192.0.2.10/32\"\n ],\n \"sapmAccounts\": [\n 100001\n ],\n \"sapmGroups\": [],\n \"restrictions\": {\n \"allowListingAccounts\": false,\n \"expiryDate\": 1893456000000,\n \"maxUsageCount\": \"100\"\n },\n \"level\": \"BASIC_PIN_PATH_HASH\",\n \"properties\": {\n \"appHash\": \"EXAMPLE_APP_HASH\",\n \"appPath\": \"C:\\\\Program Files\\\\Example\\\\example.exe\",\n \"OSType\": \"WINDOWS\",\n \"OSCredentialType\": \"SAPM\",\n \"OSCredentialSAPM\": 100001,\n \"pinPort\": 8080\n }\n}")
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "{{url}}/aioc-rest-web/rest/aapm/addAapmAccount"
payload = json.dumps("{\n \"applicationName\": \"ExampleApplication\",\n \"applicationIPs\": [\n \"192.0.2.10/32\"\n ],\n \"sapmAccounts\": [\n 100001\n ],\n \"sapmGroups\": [],\n \"restrictions\": {\n \"allowListingAccounts\": false,\n \"expiryDate\": 1893456000000,\n \"maxUsageCount\": \"100\"\n },\n \"level\": \"BASIC_PIN_PATH_HASH\",\n \"properties\": {\n \"appHash\": \"EXAMPLE_APP_HASH\",\n \"appPath\": \"C:\\\\Program Files\\\\Example\\\\example.exe\",\n \"OSType\": \"WINDOWS\",\n \"OSCredentialType\": \"SAPM\",\n \"OSCredentialSAPM\": 100001,\n \"pinPort\": 8080\n }\n}")
headers = {
'accept': 'application/json',
'content-type': 'application/json',
'x-xsrf-token': '{{x-xsrf-token}}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
{
"dbId": 200001,
"token": "REDACTED_EXAMPLE_TOKEN"
}