Hi,
I'm having a problem using the API for for getting devices by filter.
My example of getting a device with mac filter:
$ch = curl_init($this->apiurl."/device");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , "Authorization: Bearer " . $this->apikey ));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post));
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE,1);
json_encode($post) returns:
{"filter":{"mac":"54-EE-75-6B-8F-A6"}}
I believe this is how the filter is supposed to look like.
When executing the post i get this error:
"{"validation_messages":{"mac":{"error":"MAC address must be specified"}},"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html","title":"Unprocessable Entity","status":422,"detail":"MAC address must be specified"}"
Am i missing something here? For all i can see, the mac IS defined.
Br,
Thomas