I have a MX64 and am trying to use the Meraki API for updating a policy following the directions here: https://developer.cisco.com/meraki/api-v1/#!update-network-client-policy
I get a 400 error If I send a PUT request for one of the clients on my network with whatever combination of mac, devicePolicy or groupPolicyID such as:
PUT /api/v1/networks/[MY_NETWORK_ID]/clients/[MY_CLIENT_ID]/policy HTTP/1.1
Host: [MERAKI_HOST_HERE]
X-Cisco-Meraki-API-Key: [REDACTED]
Accept-Language: en-US,en;q=0.9
Connection: close
Content-Length: 31
{
"groupPolicyId": "100"
}
The error message is verbatim as follows (note that the networkId and clientId are not printed in the error message):
HTTP/1.1 400 Bad Request
Server: nginx
[TRUNCATED HEADER]
Date: Sat, 04 Dec 2021 21:53:49 GMT
{"errors":["Error for /networks/{networkId}/clients/{clientId}/policy: None of the fields ('devicePolicy' or 'groupPolicyId') were specified."]}
I am certain I have the right client and network ID since I am able to use a GET request.
GET /api/v1/networks/[MY_NETWORK_ID]/clients/[MY_CLIENT_ID]/policy HTTP/1.1
Host: [MERAKI_HOST_HERE]
X-Cisco-Meraki-API-Key: [REDACTED]
Accept-Language: en-US,en;q=0.9
Connection: close
Content-Length: 2
and I am getting valid data for my specific client ID (200 OK).
The API indicating the mac address is needed aside, I feel am I missing something simple. Anyone have a suggestion?