I recommend to use the XRunAndWait command for the api calls. With XRUN… you can call an external script (e. g. Python) that makes the API call, and then return the result back to the UI Vision macro.
So technically you “outsource” the API calls to a scripting language like Python or Powershell that has dedicated support for this. Or you can use the command line tool cURL.
You did not ask for this, but just to be complete: If you can to call some kind of Javascript function inside a website, you can do this with ExecuteScript. But again, for your use case the XRunAndWait command + script or command line will work best.