Problem with account API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cj2233
    Junior Member
    • Nov 2013
    • 4

    #1

    Problem with account API

    Hi,

    I'm new to python and betfair so please be patient. I'm having issues getting my account's funds from my python code (getAccountFunds). I've been able to get it from the API visualiser so I think that my session token and app key are correct, but always get an error when calling it from my code.

    Could anyone please help me figure out what's wrong with the code below?

    account_url = "https://api.betfair.com/exchange/account/json-rpc/v1/"
    headers = { 'X-Application' : app_key, 'X-Authentication' : session_token ,'content-type' : 'application/json' }
    req = '{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/getAccountFunds"}'
    response = requests.post(account_url, data=req, headers=headers)
    print(response.json())

    I'm always getting the following error: {'jsonrpc': '2.0', 'error': {'code': -32601, 'message': 'DSC-0021'}}

    I've tried it with different method names
    req = '{"jsonrpc": "2.0", "method": "getAccountFunds"}'
    but i'm also getting the same error...

    All my betting requests (listEventTypes, ListMarketCatalogue, etc...) work fine.

    Thanks for the help
  • Oscar Jack
    Junior Member
    • Nov 2013
    • 9

    #2
    Hi,

    Method name should be: AccountAPING/v1.0/getAccountFunds

    Comment

    • notehat
      Junior Member
      • Jan 2017
      • 1

      #3
      I know this was a while ago, but thanks for posting this code, really helped me out!

      Comment

      Working...
      X