Using /tool fetch in script

Hello,
New user here with a 750Gr3

I’m using the Mail-In-A-Box software, found here, that helps you make your own mail server. Due to the nature of the install, it takes over the DNS. It does provide a method to use custom DNS using a curl command such as:

# sets laptop.mydomain.com to point to the IP address of the machine you are executing curl on
curl -X PUT https://box.mydomain.com/admin/dns/custom/laptop.mydomain.com --user me@mydomain.com:yourpassword

I found this example of how to use PUT using fetch but I can’t see an output to see if it is working. Would I put the username and password in the http-data field?

Thanks,
Tom

Figured this out. For those that are looking to execute a curl command in RouterOS with PUT, use the following:

/tool fetch mode=https url="https://my.domainname.com/admin" user="username" password="password" http-method=put;
:log info "DDNS update triggered"