API problems with update SSID

Adrian4
Head in the Cloud

API problems with update SSID

Hello,

I am trying to build a script that copies SSID info from one network and updates another network with that info.

PUT endpint

https://api.meraki.com/api/v1/networks/{destination_id}/wireless/ssids/{ssid['number']}



It seems to work ok with PSK SSIDS but on one which is Enterprise with Radius - it has problems.


The first error was "encryptionMode' must be one of: 'wep' or 'wpa"
I found this that advised just removing that key:
https://community.meraki.com/t5/Wireless-LAN/quot-Update-the-attributes-of-an-SSID-quot-AP-endpoint-...

Which I did, but then I got another error {'errors': ["'radiusFailoverPolicy' must be a string"]}

I don't understand why I am getting these errors, if the fields are correct for the network I copied from, why is the API saying they are wrong when I try to copy to a network?


API payload data:

 

 

{
    "number": 0,
    "name": "Redacted",
    "enabled": true,
    "splashPage": "None",
    "ssidAdminAccessible": false,
    "authMode": "8021x-radius",
    "dot11w": {
        "enabled": true,
        "required": true
    },
    "dot11r": {
        "enabled": false,
        "adaptive": false
    },
    "encryptionMode": "wpa-eap",
    "wpaEncryptionMode": "WPA2 only",
    "radiusServers": [
        {
            "host": "0.0.0.0",
            "port": 0000,
            "id": "000000000000000000",
            "openRoamingCertificateId": null,
            "caCertificate": null
        },
        {
            "host": "0.0.0.0",
            "port": 0000,
            "id": "000000000000000000",
            "openRoamingCertificateId": null,
            "caCertificate": null
        }
    ],
    "radiusAccountingEnabled": false,
    "radiusTestingEnabled": false,
    "radiusServerTimeout": 1,
    "radiusServerAttemptsLimit": 3,
    "radiusFallbackEnabled": false,
    "radiusProxyEnabled": false,
    "radiusCoaEnabled": false,
    "radiusCalledStationId": "$NODE_MAC$:$VAP_NAME$",
    "radiusAuthenticationNasId": "$NODE_MAC$:$VAP_NUM$",
    "radiusAttributeForGroupPolicies": "Filter-Id",
    "radiusFailoverPolicy": null,
    "radiusLoadBalancingPolicy": null,
    "ipAssignmentMode": "Bridge mode",
    "useVlanTagging": true,
    "defaultVlanId": 0000,
    "radiusOverride": false,
    "minBitrate": 11,
    "bandSelection": "Dual band operation",
    "perClientBandwidthLimitUp": 0,
    "perClientBandwidthLimitDown": 0,
    "perSsidBandwidthLimitUp": 0,
    "perSsidBandwidthLimitDown": 0,
    "mandatoryDhcpEnabled": false,
    "lanIsolationEnabled": false,
    "visible": true,
    "availableOnAllAps": true,
    "availabilityTags": [],
    "speedBurst": {
        "enabled": false
    }
}

 

 



2 Replies 2
PhilipDAth
Kind of a big deal
Kind of a big deal

I think the "GET" method is returning additional non-configurable information, which you must remove if you want to do a PUT.

Brash
Kind of a big deal
Kind of a big deal

@PhilipDAth is correct.
To further the answer, it's because when performing the GET request, you're getting all attributes of the SSID - some of which are NULL as they have not been configured or are not applicable/configurable.

 

When sending that configuration back into a PUT, you're sending NULL values for attributes which are NULL by default but require a valid value for configuring (or are not configurable) - hence "radiusFailoverPolicy' must be a string"

 

You'll need to parse out some values from the GET request (such as NULL's) and ignore them rather than trying to send them into the PUT request.

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.
Labels