Взял самый первый пример по VBA
Sub Button4_Click() Dim Request: Request = "{""jsonrpc"": ""2.0"", ""method"": ""SportsAPING/v1.0/listEventTypes"", ""params"": {""filter"":{}}, ""id"": 1}" Dim Url: Url = "https://api.betfair.com/exchange/betting/json-rpc/v1/" Dim ListEventTypesResponse As String: ListEventTypesResponse = SendRequest(Url, "T*******w", "c******************b0aok=", Request) End Sub Function SendRequest(Url, AppKey, Session, Data) As String On Error GoTo ErrorHandler: Dim xhr: Set xhr = CreateObject("MSXML2.XMLHTTP") With xhr .Open "POST", Url & "/", False .setRequestHeader "X-Application", AppKey .setRequestHeader "Content-Type", "application/json" .setRequestHeader "Accept", "application/json" End With If Session <> "" Then xhr.setRequestHeader "X-Authentication", Session End If xhr.send Data SendRequest = xhr.responseText If xhr.Status <> 200 Then Err.Raise vbObjectError + 1000, "Util.SendRequest", "The call to API-NG was unsuccessful. Status code: " & xhr.Status & " " & xhr.statusText & ". Response was: " & xhr.responseText End If Set xhr = Nothing Exit Function ErrorHandler: HandleError End Function
При нажатии кнопки выдает вот такую ошибку:
{"jsonrpc":"2.0","error":{"code":-32099,"message":"ANGX-0003","data":{"exceptionname":"APINGException","APINGException": {"errorDetails":"", "errorCode":"INVALID_SESSION_INFORMATION", "requestUUID":"prdang034-02170718-0085d83362"}}},"id":1}
Подскажите что не так.