Announcement

Collapse
No announcement yet.

How to request getAccountDetails ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to request getAccountDetails ?

    I'm having a question in the Ask for information part in getAccountFunds, I'm using this https://api.betfair.com/exchange/acc...etAccountFunds endpoint passing in the X-Passing Application and X-Authentication in the Header. This returned the following error {"jsonrpc": "2.0", "error": {"code": - 32700, "message": "DSC-0008"}}

  • #2
    You have to give us more information. You have to tell us what question you asked. That means your JSON code. Don't send your user details but you have to show us the JSON code for your request. The link only shows the error message that was returned.

    -32700 means your JSON code contained invalid JSON code. It's in the documentation PDF:


    -32700 Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
    Last edited by jabe; 20-06-2019, 07:07 AM.

    Comment


    • #3
      Jabe, you are here for couple years, and from your answers one could think you use api. Do you not know that getAccountDetails method actually takes no parameters? So what JSON code you asked from him?

      He uses json-rpc endpoint

      Json-rpc is standard, so not only betfair uses json-rpc, and all json-rpc requests must fulfil:

      https://en.wikipedia.org/wiki/JSON-RPC

      {"jsonrpc": "2.0", "method": "subtract", "params": {"minuend": 42, "subtrahend": 23}, "id": 3}

      as getAccountDetails takes no parameters: "params" is {} so in betfair method and parameters are replaced by specific data depending on api method:

      {"jsonrpc":"2.0","method":"AccountAPING/v1.0/getAccountDetails","params":{},"id":3}

      "jsonrpc" "method" "params" "id" fields must be presented in every json-rpc request, for instance: listCurrencyRates, takes parameters, so:

      "jsonrpc":"2.0","method":"AccountAPING/v1.0/listCurrencyRates","params":{"fromCurrency":"GBP"} ,"id":5}

      What he forgot is include "params" or any of required fields I mentioned. https://www.jsonrpc.org/specification
      Betfair BOT SDK

      Comment


      • #4
        I have been here for a long time, but I've not used getAccountDetails and I haven't looked at its requirements. Progress on my main program has been interrupted.

        However, all requests are sent as JSON, and an error code of -32700 means the request contained invalid JSON.

        Comment


        • #5
          Originally posted by jabe View Post
          I have been here for a long time, but I've not used getAccountDetails and I haven't looked at its requirements. Progress on my main program has been interrupted.

          However, all requests are sent as JSON, and an error code of -32700 means the request contained invalid JSON.
          I dedicated this bot to you:

          https://github.com/StefanBelo/Bfexpl...ster/JayBeeBot
          Betfair BOT SDK

          Comment


          • #6
            Originally posted by bfexplorer View Post
            That's very kind of you. I shall definitely take a look, but it will be after the summer, alas. I am certainly interested in finding out more about F# and it will be interesting to see how you have worked around various problems I've encountered and dealt with in ways I'm not totally happy with. It's the first program I've had to code with async actions and one of the first with objects, so it's not as elegant as I'd like.

            Comment


            • #7
              Originally posted by jabe View Post

              That's very kind of you. I shall definitely take a look, but it will be after the summer, alas. I am certainly interested in finding out more about F# and it will be interesting to see how you have worked around various problems I've encountered and dealt with in ways I'm not totally happy with. It's the first program I've had to code with async actions and one of the first with objects, so it's not as elegant as I'd like.
              Bfexplorer BOT SDK can be used with any .net programming language, JayBeeBot is programmed in C#.
              Betfair BOT SDK

              Comment


              • #8
                Try this, note I am Australian user however I have to put in Wallet = UK? I do remember when I coded this a few years back there were to different end points? A different end point for your account


                URL endpoint I use is https://api.betfair.com/exchange/account/json-rpc/v1

                AccountAPING/v1.0/getAccountFunds With args: {"wallet":"UK"}

                Response: {"jsonrpc":"2.0","result":{"availableToBetBalan ce" :872.59,"exposure":-135.0,"retainedCommission":0.0,"exposureLimit":-15000.0},"id":1}

                BALANCE Betfair $872.59
                Last edited by troyedwards8; 20-07-2019, 10:35 AM.

                Comment


                • #9
                  getAccountFunds method takes no parameters, there is no AUS endpoint for betfair api.
                  Betfair BOT SDK

                  Comment

                  Working...
                  X