Hey,

using the PRTG API with PHP I'd like to clone a master device and after that resume my new device.

As shown in the API reference I duplicate my master device:
http://yourserver/api/duplicateobject.htm?id=id_of_device_to_clone&name=new_name&host=new_hostname_or_ip&targetid=id_of_target_group&username=myusernam&passhash=mypasshash As response I get the PRTG login page as html code. Same response running the request with the API platform Postman.

In order to resume my new device I need it's objectid:
http://yourserver/api/pause.htm?id=objectid&action=1&username=myusernam&passhash=mypasshash
Is there any way getting the objectid of my new device directly after duplicating it?
Or is there another way to go duplicating a device and resuming it?


PRTG Version: 22.1.75.1594+


Article Comments

Solved the problem by myself.
The new objectid can be found in the redirect url returned after the duplicating the device.


Apr, 2022 - Permalink

Hi Felix,

Thank you for your message and update.

Glad to hear that you already found the objectid of the duplicated object. It is indeed provided in the redirect URL.

If you have further questions, do not hesitate.

Have a great day.

Regards, Florian


Apr, 2022 - Permalink