How to update individual DNS settings using API

Meraki-User-713
Comes here often

How to update individual DNS settings using API

Hi,

 

We need help in order to update DNS field associate Access Points (AP) on sites.

So in brief, we need to update DNS values by AP.

We are able to obtain DNS field via CURL GET method:

curl -L -H 'X-Cisco-Meraki-API-Key: MY-API-KEY' -H 'Content-Type: application/json' -X GET 'https://api.meraki.com/api/v1/organizations/organizationID/devices/statuses?serials[]=MY-AP-SN'

 

PUT method used is this one:

curl -L -H 'X-Cisco-Meraki-API-Key: MY-API-KEY' -H 'Content-Type: application/json' -X PUT --data-binary '{"secondaryDns":"8.8.8.8"}' 'https://api.meraki.com/api/v1/organizations/organizationID/devices/statuses?serials[]=MY-AP-SN'

 

The error message is thois one: "The page you are looking for may have been moved or does not exist."

 

 

Have you got a solution for this case please ?

Regards,

6 Replies 6
RaphaelL
Kind of a big deal
Kind of a big deal

You are using the wrong endpoints.

 

I think it would be getDeviceManagementInterface

https://developer.cisco.com/meraki/api-v1/get-device-management-interface/

 

and  

updateDeviceManagementInterface

https://developer.cisco.com/meraki/api-v1/update-device-management-interface/

 

I couldn't test that one , since static IPs on a AP is just painful and not useful. 

Meraki-User-713
Comes here often

Thanks for your return.

In our case, we have HP switches, and we do not use  Alternate Management Interface (AMI).

 

Have you got another solution ? 

RaphaelL
Kind of a big deal
Kind of a big deal

If the 2 provided endpoints do not work , then I'm afraid I'm not sure there is an endpoint at all to achieve that.

Meraki-User-713
Comes here often

Ok, no problem.

 

Regards, 

Meraki-User-713
Comes here often

As noted in my first post, GET method is operational, and allow us to obtain DNS information, but PUT method return an error.  If a custom is made on this API in the next weeks, please don't hesitate to contact us cause we still have hundred of sites to update.

 

Thanks in advance.   

RaphaelL
Kind of a big deal
Kind of a big deal

https://api.meraki.com/api/v1/organizations/organizationID/devices/statuses?serials[]=MY-AP-SN 

 

Has nothing to do with DNS settings and it is not a 'PUT' endpoint.  It is to 'GET' the devices statuses ( hence statuses in the URI )

 

Here is the documentation about this endpoint : https://developer.cisco.com/meraki/api-v1/api-reference-early-access-api-platform-monitor-devices-st...

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