execute command from API

I’m trying to use the API to launch a command, specifically one launched using execute so that it runs async and the API returns success/finished/!done etc while the long running command stays running. I’ve tried every variation of API syntax I can think of, and while the sample below runs, it doesn’t actually remove the sample file
sample example command:

/execute
=script="/file remove samplefile.txt"

The actual command line command I want to launch from the API is:

/execute [/system sup-out file=api_supout.rif]

If I run the sup-out command as a regular API request it times out on the API call side, though the supout does eventually create, albeit using the default filename not the one specified. I need to run it from the API like it runs from the command line and immediately return, avoid the API timeout.

Download an replace your routeros api with this:
https://github.com/israelrmm/routeros-api/blob/israelrmm-patch-1/routeros_api.class.php

then add this code in your php file

$API->execmd(“/file remove samplefile.txt”);

enjoy