Author Posts

July 18, 2016 at 5:22 am

HI guys I am getting an incomplete response from a web server , this is the function I am using and it yeilds to 5 parameters from the server , there should be 11)

##########################
#Getting Runners and Prices
##########################
Function get-marketbook {
$method = "SportsAPING/v1.0/listMarketBook"
$postdata = [ordered]@{"jsonrpc" = "2.0";
"method" = $method
"params" = @{"marketIds" = @($marketID);"priceProjection" = @{"PriceData" = "EX_All_OFFERS"}}
}

$postdata = $postdata | ConvertTo-Json -depth 5
$getmarketbook = invoke-webrequest -uri https://api.betfair.com/exchange/betting/json-rpc/v1 -Method Post -Headers @{"X-Application"="";"X-Authentication"=$sessiontoken} -ContentType "application/ json" -body $postdata
$getmarketbook | convertfrom-json

}

the response I get from the server is :-
slectionId
handicap
status
adjustmentfactor
lastpricetraded
totalMatched

but the complete response should have :-
slectionId
handicap
status
adjustmentfactor
lastpricetraded
totalMatched
removeDate
sp
ex
orders
matches

July 26, 2016 at 1:42 pm

There's unfortunately no good way to troubleshoot that from here ;). You'd have to contact whoever owns the server API, and ask them why you're not getting the response you expect. It could be a problem with the request you're sending, or it could be a problem on the server, but from here there's no way to tell.