API error help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ruffian
    Junior Member
    • May 2020
    • 2

    #1

    API error help

    Hi,

    I have been placing bets using betfairlightweight python module.
    I have seen the below error which occurred before and has resurfaced today.

    Can anyone please advise how to correct this? or specify what I might be doing wrong

    APIError: SportsAPING/v1.0/placeOrders Params: {'marketId': '1.184628908', 'instructions': [{'orderType': 'LIMIT', 'selectionId': '35676943.0', 'side': 'BACK', 'limitOrder': {'price': 5.4, 'persistenceType': 'LAPSE', 'size': 46.0}}], 'customerStrategyRef': 'back'} Exception: None Error: {'code': -32602, 'message': 'DSC-0018'} Full Response: {'jsonrpc': '2.0', 'error': {'code': -32602, 'message': 'DSC-0018'}, 'id': 1}
  • ruffian
    Junior Member
    • May 2020
    • 2

    #2
    Disregard this, I have found the issue and is resolved now.

    Comment

    • Ramstyler
      Junior Member
      • Oct 2022
      • 4

      #3
      It would be very helpful to others with similar issues if you had explained how you resolved this.

      Comment

      • jabe
        Senior Member
        • Dec 2014
        • 705

        #4
        Originally posted by Ramstyler View Post
        It would be very helpful to others with similar issues if you had explained how you resolved this.
        It's been a while since he posted, so I'll tell you what I do with these things.

        I paste the call text into a text editor first. Then I go through it, parameter by parameter, pressing Enter after every bracket and comma. After this, I indent lines by sets of three spaces, depending on brackets; an opening bracket. Every opening bracket adds three more spaces and every closing bracket removes three spaces from how many I'm adding to each line (but after the closing bracket line, so that opening and closing brackets for a chunk of code are indented the same amount). With the call from the first post, I've ended up with this:


        Code:
        [
           {
           'orderType': 'LIMIT',
           'selectionId': '35676943.0',
           'side': 'BACK',
           'limitOrder':
              {
              'price': 5.4,
              'persistenceType': 'LAPSE',
              'size': 46.0
              }
           }
        ],
        'customerStrategyRef': 'back'
        }​
        At this point I'll look for unbalanced brackets, missing commas, wrong brackets, and anything other incorrect syntax. There's nothing obvious in the above, so the next port of call is the documentation, where I'll check to see what exactly a DSC-0018 or -32602 error is (I might do this first of all). The documentation suggests likely errors for each call and for placeOrders, the -32602 is listed, and it says
        -32602 Problem parsing the parameters, or a mandatory parameter was not found

        I would check that all the required parameters are there. If they are, I'd check that all their subparameters are there too. However, since the poster didn't post the complete call text, I have no idea what the error was, and I'd generally ask the poster to post the full call string.

        Comment

        Working...
        X