Override Network's PSK from its template by using API

SOLVED
rajiw017
Here to help

Override Network's PSK from its template by using API

Hi all, I'm currently trying to change my network PSK by overriding from its binded template. I've tried this https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid but the return is 'Authentication mode is not a valid SSID override option.'.
Is this even possible?
Thank you in advance.

1 ACCEPTED SOLUTION

@rajiw017  I was able to do it via Postman.

 

I first tried with the bare minimum value of just the psk. It gave the "Authentication mode is not a valid SSID override option" error. I then added " "authMode": "psk" and the error changed to "Pre-shared key mode requires a valid encryption mode". So, last I added ""encryptionMode": "wpa" and that allowed the PUT to work.

 

Screen Shot 2021-11-19 at 7.18.44 AM.png

View solution in original post

8 REPLIES 8
rymiles
Meraki Employee

The error sounds like you're trying to change the auth type and not just the PSK. What exactly are you sending in the API call? Can you paste it here (minus a PSK for privacy)?

Dear rymiles, thank you for your reply

 

the response when I requested for 'get'

{'number': 0, 'name': 'SSIDSSIDSSID', 'enabled': True, 'splashPage': 'None', 'ssidAdminAccessible': False, 'authMode': 'psk', 'psk': 'sssssssssss', 'dot11w': {'enabled': False, 'required': False}, 'dot11r': {'enabled': False, 'adaptive': False}, 'encryptionMode': 'wpa', 'wpaEncryptionMode': 'WPA2 only', 'ipAssignmentMode': 'NAT mode', 'adultContentFilteringEnabled': False, 'dnsRewrite': {'enabled': False, 'dnsCustomNameservers': []}, 'minBitrate': 11, 'bandSelection': 'Dual band operation', 'perClientBandwidthLimitUp': 0, 'perClientBandwidthLimitDown': 0, 'perSsidBandwidthLimitUp': 0, 'perSsidBandwidthLimitDown': 0, 'mandatoryDhcpEnabled': False, 'visible': True, 'availableOnAllAps': True, 'availabilityTags': []}

 

the response when I requested for 'put' with data={"psk": 'testtest'}

{'errors': ['Authentication mode is not a valid SSID override option.']}
 
ww
Kind of a big deal
Kind of a big deal

network_id = 'L_123123123'
number = '0' ##number off ssid##

response = dashboard.wireless.updateNetworkWirelessSsid(
network_id, number,
name='NAMEOFSSID',
enabled=True,
psk='HerePSK'
)

hi ww, thank you for your reply.

 

I already did your suggestion using python, here some snippet of my code:

headers_api={'X-Cisco-Meraki-API-Key':'xxx'}
network_id='L_123123123'
ssid_id='0'
url_final=url_base+'/networks/'+network_id+'/wireless/ssids/'+ssid_id
data={
        'network_id':network_id,
        'number':ssid_id,
        'name':'SSIDSSIDSSID',
        'enabled':True,
        'psk':'testtest'
    }
r=requests.put(url_final,headers=headers_api,data=change)
 
the response was:
<Response [400]>
{'errors': ['Authentication mode is not a valid SSID override option.']}
ww
Kind of a big deal
Kind of a big deal

Are you sure you are using the template network id? You have seen the error before

 

https://community.meraki.com/t5/Developers-APIs/Cisco-Meraki-API-v1-configure-Template-PSK/m-p/12716...

Dear ww, thanks for your reply,

 

This is a different case. I'm trying to do like this one.merakioverride.PNG

I'm trying to override Network's PSK from its template. Is this even possible?

@rajiw017  I was able to do it via Postman.

 

I first tried with the bare minimum value of just the psk. It gave the "Authentication mode is not a valid SSID override option" error. I then added " "authMode": "psk" and the error changed to "Pre-shared key mode requires a valid encryption mode". So, last I added ""encryptionMode": "wpa" and that allowed the PUT to work.

 

Screen Shot 2021-11-19 at 7.18.44 AM.png

View solution in original post

hi rymiles,

 

it works! thank you very much!!!

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.