Posted on 12-13-2018 08:00 AM
I can successfully call get api in the uapi, but have yet to get a post to work... any ideas out there?
$curl = new Curl();
// we successfully get our token
<token code removed>
// testing code
$curl->setHeader('authorization','jamf-token '.$token);
$curl->setHeader('accept','application/json');
// the get works, I get the list of mobile devices, and the device number exisits
$curl->get($_SERVER['uapi'].'/inventory/obj/mobileDevice/3');
// ===> this returns 500
$test = json_encode(array("updatedExtensionAttributes"=> array("id"=>0, "name"=>"CheckedOutBy","type"=> "STRING", "value"=>"GreenEggs")));
// var_dump ($curl->response);
//this post returns 500, I've trie sending it as a php array too
$curl->post($_SERVER['JAMF_NURL'].'/inventory/obj/mobileDevice/3/update',array("updatedExtensionAttributes"=> array("id"=>0, "name"=>"CheckedOutBy","type"=> "STRING", "value"=>"GreenEggs")));
// ===> and this returns 500
$test = json_encode(array("updatedExtensionAttributes"=> array("id"=>0, "name"=>"CheckedOutBy","type"=> "STRING", "value"=>"GreenEggs")));
//this post returns 500, I've trie sending it as a php array too
$curl->post($_SERVER['JAMF_NURL'].'/inventory/obj/mobileDevice/3/update',$test);