HTTP Request / Webservice too many requests / too fast?

Hmm I think I am just no familiar enough with these options, I tried various ways but all of them returned 0 for success, but where is the output?
I tried putting -s -o -stderr in your version @erAck but also tried this code below, all with the same result.

Could anyone of you perhaps help me out with this please? Sorry to bother all of you, I would not manage without your help.

url = “https://ndcdyn.interactivebrokers.com/Universal/servlet/FlexStatementService.SendRequest?t=280014687756071353099584&q=583344&v=3
response = Shell (“curl -s -S -o “”” & url & “”"")

I’ll try to make an example when I have time.

1 Like

An example is in the attached file. You need to run macro Test. Below is the text of the macro and the header of main function.

Option Explicit
Option Compatible

Sub Test
  Dim url As String, retval As String, result As String
  url="https://ndcdyn.interactivebrokers.com/Universal/servlet/FlexStatementService.SendRequest?t=280014687756071353099584&q=583344&v=3"
  retval=CurlCall(url)
  If Left(retval, 1)<>"*" Then ' Not error
    result=fileToStr(retval)
    Msgbox result
  End If    
End Sub

' lang:en
' Call the Curl utility.
' - arg:      utility argument (options).
' - postData: sets the data (body) for the POST request. If the first character is "@", then it is interpreted as a file name.
' - out:      redirect stdout output for curl. The file name or only the extension can be specified (will be redirected
'             to a temporary file with this extension). If you do not need to redirect, then specify an empty string or "-".
'             If the out parameter is omitted, then redirect to a temporary file.
'
' Returns:
' On normal completion, the name of the file with redirected output stdout, or an empty string if no output was redirected.
' `*1`: Error calling curl: The file specified by the --stderr parameter was not created.
' `*2`: Error: The file specified by the postData parameter does not exist.
' `*filename`: the name of the file containing the error log with a "*" at the beginning (in URL format).
Function CurlCall(Byval arg, Optional postData as String, Optional Byval out) as String

CurlCall.ods (13.0 KB)

1 Like

Holy!!! Thank you so much. I would never ever have managed that. Looking through all of your code I see you create temp folders, temporary files for errors, return value etc just to retrieve the shell output and then save it back. This is genius.

Thank you so much it works!.

Final question to this: Do I need to delete these temporary files? I am loading them a lot (e.g. 1/min) and they might be xml files of up to 1mb. Does the

The links I have provided have now been switched off as they exposed some private data. If you use them now the “correct” response will be :

Fail

1015

Token is invalid.

The incorrect response is still “fail , Error 1018, too many requests”. Thanks to everyone and especially @sokol92 for your awesome help. This one can be closed.