[API-NG] Having trouble to get account founds

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MachineBot
    Junior Member
    • Aug 2012
    • 6

    #1

    [API-NG] Having trouble to get account founds

    Hi

    I'am using the sample code of API-NG for java and as the title says, i'am having trouble to get the account founds.

    I can use the listEventTypes but not the getAccountFunds as it keeps returning the error {"jsonrpc":"2.0","error":{"code":-32601,"message":"DSC-0021"},"id":"1"}, that means that "The operation specified does not exist".

    I used the base code from the sample and only added a new parameter to differentiate a request to the Account API from a Betting API and a if statement:



    Now the debug part, for the listEventTypes:

    -The Request


    -The Response


    For the getAccountFounds:

    -The Request


    -The Response


    Can anyone point what i'am doing wrong?

    Best Regards!
    Last edited by MachineBot; 03-03-2014, 11:31 PM.
  • AlgoTrader
    Junior Member
    • Mar 2012
    • 243

    #2
    Code:
    getAccountFunds err=null duration=0.043
    Request:{
      "jsonrpc": "2.0",
      "id": 2,
      "method": "AccountAPING/v1.0/getAccountFunds",
      "params": {
      }
    }
    
    Response:{
      "jsonrpc": "2.0",
      "result": {
        "availableToBetBalance": XXXXXXXX,
        "exposure": XXXXXXXX,
        "retainedCommission": XXXXXXXX,
        "exposureLimit": XXXXXXXX
      },
      "id": 2
    }
    I use JavaScript, as it is more JSON friendly
    Last edited by AlgoTrader; 03-03-2014, 08:33 AM.
    Betfair Bots Made Easy

    Comment

    • MachineBot
      Junior Member
      • Aug 2012
      • 6

      #3
      Ok, i found what was missing...

      I was sending the correct JSON for the wrong destination and that is why i was receiving the "The operation specified does not exist"..

      For those who are starting like me and might be stuck in this, check the function sendPostRequestJsonRpc as that apiNgURL is the url for the Betting API and not for the Account API. You can check the different url's in https://api.developer.betfair.com/se...i/Accounts+API in the Endpoint column. Note that for the JsonRPC you need to add the method name to the url.

      Best Regards!

      Comment

      Working...
      X