Skip to main content
Question

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

  • September 6, 2023
  • 1 reply
  • 1 view

Forum|alt.badge.img+5

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

Tangentism
Forum|alt.badge.img+10
  • Honored Contributor
  • 144 replies
  • September 7, 2023

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?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings