Meraki API returns "'enabled' must be a boolean"

Solved
The_Roo
Getting noticed

Meraki API returns "'enabled' must be a boolean"

Hi All,

I'm working on increasing my knowledge of the Meraki API, doing it through Postman, and I've had good success so far with "GET" actions. Now I'm trying to do some "PUT" actions, specifically trying one that's in the Meraki Collection (to set/reset bonjour forwarding):

 

{{baseUrl}}/networks/:networkId/wireless/ssids/:number/bonjourForwarding

 

I have set some variables as shown

The_Roo_0-1733228938421.png

Now these variables all work with "GET" actions so I'm confident they are right. However, when I send the "PUT" shown above, I get the response:

{"errors":["'enabled' must be a boolean"]}

So I tried putting a new variable in: "enabled". I tried it with and without quotes, and tried the value as 1/0 or true/false (with and without quote marks) but it made no difference, I still got the same error.

 

What I've learned from my "GET" experiments are that in the string:

 

{{baseUrl}}/networks/:networkId/wireless/ssids/:number/bonjourForwarding

 

I need to supply the items preceeded with a ":" mark, so I have variables for networkId and number.

 

I've googled this, but there is only one other similar error shown, and that does not have a conclusive fix.

 

So what am I doing wrong? What do I need to address the

{"errors":["'enabled' must be a boolean"]}

error?

 

Thanks in anticipation!

Roo

 

1 Accepted Solution
John_on_API
Meraki Employee
Meraki Employee

Unwrap the 'true' -- for booleans, send only true in either the body of the request or the query param, based on the docs.

 

In your case, the operation probably has enabled as a body attribute and not a query param. So instead of sending as a query param, send it in the appropriate place in the body of the request.

View solution in original post

2 Replies 2
Mloraditch
A model citizen

I'm no dev but use postman a lot, although perhaps not quite the way you are.

 

Take a look here: https://developer.cisco.com/meraki/api-v1/update-network-wireless-ssid-bonjour-forwarding/

This site is great for figuring out issues with your JSON. You can use the gui form to build the JSON and see the formatting that needs to exist.

 

I will caution that the get output does not always match the put for API calls that otherwise seem to match up. There are sometimes added values in gets that don't get put in a put.


Hopefully this helps steer you onto the right path

 

John_on_API
Meraki Employee
Meraki Employee

Unwrap the 'true' -- for booleans, send only true in either the body of the request or the query param, based on the docs.

 

In your case, the operation probably has enabled as a body attribute and not a query param. So instead of sending as a query param, send it in the appropriate place in the body of the request.

Get notified when there are additional replies to this discussion.