Skip to main content

API Requests PRO

Key name: APIRequests
Element type: Dictionary
Status: Optional

You can define here all the API requests you want Octory to make with a SendRequest action.
You can also define some useful keys that will be used by the requests.

Keys

NameTypePossible valuesRequired
JamfBaseURLString-
JamfProBaseURLString-
AirwatchBaseURLString-
DefaultMDMApiStringJamf, JamfPro, AirWatch
ModelsDictionary (API Request)-Required

Detail

JamfBaseURL

Type: String
Explanation: The base URL of your Jamf API. Example: https://mycompany.jamfcloud.com/JSSResource/

JamfProBaseURL

Type: String
Explanation: The base URL of your Jamf Pro API. Example: https://mycompany.jamfcloud.com/uapi/

DefaultMDMApi

Type: String
Possible values: Jamf, JamfPRo, AirWatch
Explanation: When defining a api request, you can specify the MDM API to target to Octory. This way, Octory will process the request accordingly to the MDM API requirements. You can specify here a default MDM API to use when it is omitted.

Models Required

Type: Dictionary (API Request)
Explanation: The API Requests you want to reuse in Actions.

Example

  • ComputerName: Retrieve the name of the computer with id 20 and write it inside the variable ComputerName.
  • TerminationSuccess: Modify the extension_attribute 7 of the computer with id 20. Give the extension_attribute a value depending on the dynamic placeholder.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>APIRequests</key>
<dict>
<key>JamfBaseURL</key>
<string>https://mycompany.jamfcloud.com/JSSResource/</string>
<key>DefaultMDMApi</key>
<string>Jamf</string>
<key>Models</key>
<dict>
<key>ComputerName</key>
<dict>
<key>Endpoint</key>
<string>computers/id/20</string>
<key>VariableReadingPaths</key>
<dict>
<key>ComputerName</key>
<string>computer->general->name</string>
</dict>
</dict>
<key>UserName</key>
<dict>
<key>Endpoint</key>
<string>accounts</string>
<key>VariableReadingPaths</key>
<dict>
<key>UserName</key>
<string>accounts->users->[0]->name</string>
</dict>
</dict>
<key>TerminationSuccess</key>
<dict>
<key>Endpoint</key>
<string>computers/id/20</string>
<key>Method</key>
<string>PUT</string>
<key>Body</key>
<dict>
<key>computer</key>
<dict>
<key>extension_attributes</key>
<dict>
<key>extension_attribute</key>
<dict>
<key>id</key>
<string>7</string>
<key>value</key>
<string>${INSTALLATION_COMPLETE}</string>
</dict>
</dict>
</dict>
</dict>
</dict>
</dict>
</dict>
<!-- ... -->
</dict>
</plist>