[SOLVED]PHP API - terminating the tool/fetch command

Hey All,
Attempting to use the PHP API (the one in the wiki) to run the tool/fetch command.
The command works great, and I am able to fetch a file. Unfortunately, doing anything after the command is impossibl.

It seems that the API read command keeps pulling the status even when the download is finished. It’s just repeating (“status=finished”) over and over again. This locks up my program. Is the PHP API just reading the same message over and over again, or is the Mikrotik API actually outputting this? When running the command in the terminal, it just terminates when status=finished, so why wouldn’t the API do the same?
I’ve tried this on 3.30, 5.2 and 5.5.

So my question is: how do I terminate the repetitive updates after tool/fetch and continue on with my API scripting?

Thanks for any help :slight_smile:

This is (since recently) a known issue with RouterOS itself (see this topic). Hopefully, it will be fixed soon.

In the meantime, you could try to use another client in which you don’t get all the responses, but instead read responses one by one and check if any one of them has “status=finished”.

Ah haha, thanks boen! The sad fact is I read that once upon a time, but completely forgot about it.

Much appreciated for the help.

Thanks!
-Issa