Jamf "computercommands" API Returns 200 But Does Not Send Command

derek_ritchison
Contributor

I'm using the not-very-well-documented computercommands API to trigger device locks during termination events. I got it working on a test device last week, but it has not sent out the command to two separate devices in PROD just today even though when I run the script in verbose it returns a 200 from JSS.

Does anyone else use this API or seen something similar?

Here is my code:


$ch = curl_init($uri);
$curlOptions = array(
    CURLOPT_HTTPHEADER => array(
        'Content-Type: application/json',
        'Accept: application/json'
    ),
    CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
    CURLOPT_USERPWD => "$jssUser:$jssPass",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_VERBOSE => true, // Enable verbose output
);

curl_setopt_array($ch, $curlOptions);
$result = curl_exec($ch);
print_r($result);
1 REPLY 1

Tangentism
Contributor III

Youre getting a 200 code because the API has successfully queued the MDM command!

What does the management log say on the device? (Computer Inventory > Management > Management Commands)? Is the command pending or showing as failed?

If there is nothing there, whats showing under the Computer Inventory > History > Management History? Can you find the command at all?