cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change Device Name and API

Highlighted
New here

Change Device Name and API

Hi,

 

I'm pretty new to Meraki Systems Manager and we're in the middle of moving all our iPads over to it.  I've been tasked at finding out how to automate the process of renaming all devices once they have registered, in a short space of time.  I've read this article, which is exactly what we want to do but when I tried it I just get errors. 

 

https://documentation.meraki.com/SM/Other_Topics/Renaming_Systems_Manager_Client_Devices_with_a_.csv...

 

I'm pretty new with working with APIs, so apologies for any incorrect terminology.  I've got the API, organisation ID and the network ID and I can get a list of devices but if I were to run:

 

https://dashboard.meraki.com/api/v0/networks/network_id/sm/device/fields?serial={{serial}}&deviceFields={"name":"{{name}}"}

and change it to a GET, I assume I'm suppose to get no results as its dependent on the CSV with the serial and name in it?!?  Plus I get a 404 Not Found error.

 

Also if I change it to PUT and run the runner with the CSV I get a 500 internal server error.

 

I've seen other posts about working with APIs and I've seen people suggest using Powershell, which I tried and got to the point where I can pull a list of all devices but I can't figure out how to filter this or how I would be able to do a bulk update based on a CSV file.

 

Any help appreciated, thanks

 

Praf

2 REPLIES 2
Head in the Cloud

Re: Change Device Name and API

Update Client Name using API 

 

You might check and see if that helps.

Here to help

Re: Change Device Name and API

Hi, I did something similar to you with Python and a xlsx file. 

 

To read the xlsx file I used the pandas Module.

In the xlsx file I use two colomns, mac adress for filtering and the new name to be applied.

 

Here is the API i use (it's a POST request):

url = baseUrl+"/networks/"+net_id+"/clients/provision"	
body = {
  "mac":mac_client,
  "name": name_client,
  "devicePolicy": device_Policy
   }		

https://developer.cisco.com/meraki/api/#/rest/api-endpoints/clients/provision-network-clients

 

Axel

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