I'm currently trying to grab and assign the N_596164000673190002
to a variable from a curl command.
This is the command:
curl -L -H 'X-Cisco-Meraki-API-Key: mykeygoeshere' -X POST -H'Content-Type: application/json' --data-binary '{"name":"'"$NETWORK_NAME"'", "type":"appliance", "timeZone":"'"$TIME_ZONE"'"}' 'https://dashboard.meraki.com/api/v0/organizations/foobar/networks'
This is the response:
{"id":"N_596164000673190002","organizationId":"foo","type":"appliance","name":"bar","timeZone":"America/Chicago","tags":""}
How do I successfully read and grab the variable after id
(without the double quotes), while also simutaneously assigning it to a variable, $NETWORK_ID
? I imagine this can all be done in one line.
If this is successful, echo $NETWORK_ID
should return N_596164000673190002