Hi, I'm trying to update psk using Apps Script. But I can't seem to make the put method works.
function updateSSID(apiKey, netId, t0, t1) {
var payload = {'psk': 'abcdefghij'};
var options = {
'method' : 'PUT',
'headers':{'X-Cisco-Meraki-API-Key': apiKey},
'contentType': 'application/json',
// Convert the JavaScript object to a JSON string.
'payload' : JSON.stringify(payload)
};
var response = UrlFetchApp.fetch("https://api.meraki.com/api/v0/networks/"+netId+"/ssids/2", options);
Logger.log(response);
}
Here is the response I get:
{"number":2,"name":"Meeting","enabled":true,"splashPage":"None","ssidAdminAccessible":false,"authMode":"psk","psk":"oldpassword","encryptionMode":"wpa","wpaEncryptionMode":"WPA1 and WPA2","ipAssignmentMode":"NAT mode","minBitrate":1,"bandSelection":"Dual band operation","perClientBandwidthLimitUp":5120,"perClientBandwidthLimitDown":5120}
Please help.