API request

When I put this command in my Winbox Terminal:

/tool fetch url="https://my.hidrive.com/oauth2/token" http-method=post http-data="client_id=2client_idc&client_secret=client_secret&grant_type=refresh_token&refresh_token=refresh_token" dst-path=token.txt

I get this as an output:
status: finished
downloaded: 0KiBC-z pause]
total: 0KiB
duration: 1s

Now my question is, how can I access the status so i can use this as a variable for my following script (for instants, when the status is finished do…)
I already tried

:local status [/tool fetch url="https://my.hidrive.com/oauth2/token" http-method=post http-data="client_id=2client_idc&client_secret=client_secret&grant_type=refresh_token&refresh_token=refresh_token" dst-path=token.txt  without-paging as-value]
:log info $status

and in my Log it was just empty, meaning either I got no response for a reason or it was just wrong.
In my attempts ive always checkted if my script or command was syntactically correct which it was.

You can’t get http response status code from fetch tool, fetch result also has status finished if sucess (I guess only when http status code is in 2xx range), but for other response codes or connection errors throws error. See more in documentation regarding status.
Examples:

:do {
  :put [/tool/fetch url="https://httpstat.us/200" as-value output=user]
} on-error={
  :put "request error"
}

returns: data=200 OK;downloaded=0;status=finished
but

:do {
  :put [/tool/fetch url="https://httpstat.us/401" as-value output=user]
} on-error={
  :put "request error"
}

prints “request error”