Retrieve details for a single policy

Returns a specific policy object for the authenticated user.

get
/policies/{id}

https://console.automox.com/api/policies/{id}
Request
Response
Request
Path Parameters
id
required
integer
Server Group ID for the specified policy
Headers
Authorization: Bearer
required
string
Your Automox API Key for authentication Format: Authorization: Bearer your_automox_api_key
Query Parameters
o
required
integer
Organization ID for the specified policy
Response
200: OK
{
"type": "object",
"required": [
"name",
"organization_id",
"policy_type_name",
"schedule_days",
"schedule_time",
"configuration",
"notes"
],
"properties": {
"configuration": {
"type": "object",
"required": [
"auto_patch",
"auto_reboot"
],
"properties": {
"auto_patch": {
"type": "boolean"
},
"auto_reboot": {
"type": "boolean"
},
"installation_code": {
"type": "string"
},
"os_family": {
"type": "string"
},
"package_name": {
"type": "string"
},
"evaluation_code": {
"type": "string"
},
"remediation_code": {
"type": "string"
},
"test_code": {
"type": "string"
}
}
},
"create_time": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"organization_id": {
"type": "integer",
"format": "int64"
},
"policy_type_name": {
"type": "string"
},
"schedule_days": {
"type": "integer",
"format": "int64"
},
"schedule_time": {
"type": "string"
}
}
}
404: Not Found
An attempt to get information about a device that was deleted returns a 404 error.
{
"description": "Unauthorized"
}

Note: Schedules

Policy schedules are the decimal value of a binary representation of True/False for each day/week/month.

Example days per week:

For scheduling days of the week there will be 7 digits with a trailing zero to mark the end. This starts on Sunday and ends on Monday. 1 represents ON and 0 represents OFF for each day of the week.

Sun|Sat|Fri|Thu|Wed|Tue|Mon|TrailingZero

Every Day: 11111110 = 254

Mon/Wed/Fri only: 00101010 = 42

Example weeks per month:

Weeks are scheduled similarly to days, except there are 5 digits with a trailing zero. This starts on the 5th week of the month and ends with the 1st week of the month.

5th|4th|3rd|2nd|1st|TrailingZero

Every Week: 111110 = 62

2nd/4th weeks only: 010100 = 20

Example months per year:

Months continue the trend with 12 digits with a trailing zero. Starting with December and ending with January.

Dec|Nov|Oct|Sep|Aug|Jul|Jun|May|Apr|Mar|Feb|Jan|TrailingZero

Every Month: 1111111111110 = 8190

Mar/Jun/Sep/Dec = 1001001001000 = 4680

Example Requests

cURL
Python http.client
Python requests
C#
PowerShell
cURL
curl -X GET \
'https://console.automox.com/api/policies/12345?o=0000' \
-H 'Authorization: Bearer your_automox_api_key'
Python http.client
import http.client
conn = http.client.HTTPConnection("console,automox,com")
headers = {
'Authorization': "Bearer your_automox_api_key"
}
conn.request("GET", "api,policies,12345", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Python requests
import requests
url = "https://console.automox.com/api/policies/12345"
querystring = {"o":"0000"}
headers = {
'Authorization': "Bearer your_automox_api_key"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
C#
var client = new RestClient("https://console.automox.com/api/policies/12345?o=0000");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer your_automox_api_key");
IRestResponse response = client.Execute(request);
PowerShell
$apiKey = 'your_automox_api_key'
$headers = @{ "Authorization" = "Bearer $apiKey" }
$url = "https://console.automox.com/api/policies/12345?o=0000"
$response = (Invoke-WebRequest -Method Get -Uri $url -Headers $headers).Content