Bad JSON reply

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bnl
    Junior Member
    • Nov 2012
    • 108

    #1

    Bad JSON reply

    Hi!
    usually I get a reply like this for listMarketBook

    Note the selectionIds are integers in the reply
    Code:
    {
    	"id": 15,
    	"jsonrpc": "2.0",
    	"result": [{
    		"numberOfWinners": 1,
    		"betDelay": 1,
    		"marketId": "1.112252671",
    		"totalAvailable": 0.00000E+00,
    		"bspReconciled": true,
    		"numberOfRunners": 4,
    		"numberOfActiveRunners": 0,
    		"totalMatched": 0.00000E+00,
    		"runners": [{
    			"handicap": 0.00000E+00,
    			"adjustmentFactor": 4.88000E+01,
    			"selectionId": 8016387,
    			"status": "WINNER"
    		},
    		{
    			"handicap": 0.00000E+00,
    			"adjustmentFactor": 2.08000E+01,
    			"selectionId": 8921,
    			"status": "LOSER"
    		},
    		{
    			"handicap": 0.00000E+00,
    			"adjustmentFactor": 2.94000E+01,
    			"selectionId": 6329771,
    			"status": "LOSER"
    		},
    		{
    			"handicap": 0.00000E+00,
    			"adjustmentFactor": 7.00000E-01,
    			"selectionId": 7314896,
    			"status": "LOSER"
    		}],
    		"inplay": true,
    		"status": "CLOSED",
    		"runnersVoidable": false,
    		"version": 660468439,
    		"isMarketDataDelayed": false,
    		"crossMatching": false,
    		"complete": true
    	}]
    }
    But today I got this,
    note the selectionIds are strings

    Code:
    {
    	"id": 15,
    	"jsonrpc": "2.0",
    	"result": [{
    		"numberOfWinners": 2,
    		"betDelay": 1,
    		"marketId": "1.112252672",
    		"totalAvailable": 0.00000E+00,
    		"bspReconciled": true,
    		"numberOfRunners": 4,
    		"numberOfActiveRunners": 0,
    		"totalMatched": 0.00000E+00,
    		"runners": [{
    			"handicap": 0.00000E+00,
    			"adjustmentFactor": 8.16910E+01,
    			"selectionId": "8016387",
    			"status": "WINNER"
    		},
    		{
    			"handicap": 0.00000E+00,
    			"adjustmentFactor": 7.68460E+01,
    			"selectionId": "8921",
    			"status": "LOSER"
    		},
    		{
    			"handicap": 0.00000E+00,
    			"adjustmentFactor": 7.96700E+01,
    			"selectionId": "6329771",
    			"status": "WINNER"
    		},
    		{
    			"handicap": 0.00000E+00,
    			"adjustmentFactor": 4.49400E+00,
    			"selectionId": "7314896",
    			"status": "LOSER"
    		}],
    		"inplay": true,
    		"status": "CLOSED",
    		"runnersVoidable": false,
    		"version": 660468457,
    		"isMarketDataDelayed": false,
    		"crossMatching": false,
    		"complete": false
    	}]
    }
    My JSON frameworks chokes on this, raising exceptions
    that it wants an integer here.

    Who is wrong, the framework, or Betfair.
    Clearly this is a change, but is it just a mistake
    or is it supposed to be like this in the future?


    The bot posts this

    Code:
    {
    	"method": "SportsAPING/v1.0/listMarketBook",
    	"jsonrpc": "2.0",
    	"id": 15,
    	"params": {
    		"marketIds": ["1.112256275"]
    	}
    }
    /Björn
Working...
X