Hi Mr Ed
Firstly as betdynamics has kindly pointed out the request string has lots of errors (Missing brackets and commas, Semi Colons in wrong places etc)
However Copy and paste in these posts is dodgy at best of times (See my Response string below - it has spaces in it!)
So will assume you have an actual working string but have included one at the end for you that works that you can use which I think returns much of what you are looking for
Now for the Dates and Times which are a minefield anyway at the best of times!
The problem here is that Json is a Date Object not a String although you want a String to be finally displayed (No probs)
Also all the times are returned in GMT which is fine if you live in the UK and its Winter! Otherwise:
If you are still playing with that basic app then the first thing I would recommend is that you set the Json “marketStartTime” property to return you your computer time (ie Local Time) rather than having everything in GMT
So in MarketCatalogue.vb just modify to the below
Now back to the Call – The best way (I think) for this purpose is to use a couple of the DateTimePicker Control on your Form set to Time
This will allow you to get just Times and Dates of interest (Will shove an example here later)
However for now here are the basics of what you currently need for an Example of 5 Days
The response string returns
(This is just a snip start 13th and end 17th (5 Days inc) this taken at the mo)
{"jsonrpc":"2.0","result":[{"marketId":"1.115301112","marketName":"Match Odds","marketStartTime":"2014-09-13T11:15:00.000Z","totalMatched":24207.63,"runners":[{"selectionId":48759,"runnerName":"Birmingham","ha ndicap":0.0,"sortPriority":1},{"selectionId":48317 ,"runnerName":"Leeds","handicap":0.0,"sortPriority ":2},{"selectionId":58805,"runnerName":"The Draw","handicap":0.0,"sortPriority":3}],"eventType":{"id":"1","name":"Soccer"},"competiti on":{"id":"33","name":"The Championship"},"event":{"id":"27260378","name":"Bi rmingham v Leeds","countryCode":"GB","timezone":"Europe/London","openDate":"2014-09-13T11:15:00.000Z"}},{"marketId":"1.115259484","mar ketName":"Match Odds","marketStartTime":"2014-09-13T11:45:00.000Z","totalMatched":551052.75,"runner s":[{"selectionId":1096,"runnerName":"Arsenal","handic ap":0.0,"sortPriority":1},{"selectionId":47999,"ru nnerName":"Man City","handicap":0.0,"sortPriority":2},{"selection Id":58805,"runnerName":"The Draw","handicap":0.0,"sortPriority":3}],"eventType":{"id":"1","name":"Soccer"},"competiti on":{"id":"31","name":"Barclays Premier League"},"event":{"id":"27258582","name":"Arsenal v Man City","countryCode":"GB","timezone":"Europe/London","openDate":"2014-09-13T11:45:00.000Z"}}
{"selectionId":58805,"runnerName":"The Draw","handicap":0.0,"sortPriority":3}],"eventType":{"id":"1","name":"Soccer"},"competiti on":{"id":"35","name":"League One"},"event":{"id":"27263995","name":"Fleetwood Town v Barnsley","countryCode":"GB","timezone":"Europe/London","openDate":"2014-09-17T18:45:00.000Z"}}],"id":1}
‘When you run your App the Times (If you are in UK) will return 12:15 and 12:45 etc and not GMT as the Response above
Hope this will do ya for now
Dave
Firstly as betdynamics has kindly pointed out the request string has lots of errors (Missing brackets and commas, Semi Colons in wrong places etc)
However Copy and paste in these posts is dodgy at best of times (See my Response string below - it has spaces in it!)
So will assume you have an actual working string but have included one at the end for you that works that you can use which I think returns much of what you are looking for
Now for the Dates and Times which are a minefield anyway at the best of times!
The problem here is that Json is a Date Object not a String although you want a String to be finally displayed (No probs)
Also all the times are returned in GMT which is fine if you live in the UK and its Winter! Otherwise:
If you are still playing with that basic app then the first thing I would recommend is that you set the Json “marketStartTime” property to return you your computer time (ie Local Time) rather than having everything in GMT
So in MarketCatalogue.vb just modify to the below
Code:
Private m_marketStartTime As Date
<JsonProperty(PropertyName:="marketStartTime")> _
Public Property MarketStartTime() As Date
Get
'Note this is why we use a Set-Get instead of just declaring a property that always returns GMT!
Return m_marketStartTime.ToLocalTime ‘This was just “Return m_marketStartTime in GMT”
End Get
Set(value As Date)
m_marketStartTime = value
End Set
End Property '~~> "marketStartTime" any other Date Format can be done in the App (easier) or here
This will allow you to get just Times and Dates of interest (Will shove an example here later)
However for now here are the basics of what you currently need for an Example of 5 Days
Code:
‘First Declare the Dates required
Dim dFromDate As Date = Now
Dim dToDate As Date = Now.AddDays(5)
[B]'** Now you convert to the String **[/B]
Dim FromDate As String = dFromDate.ToString("yyyy-MM-ddTHH:mm:ssZ")
Dim ToDate As String = dToDate.ToString("yyyy-MM-ddTHH:mm:ssZ")
‘Send the request (One that works lol) Note I have just used “GB” as I don’t know what your marketCountries variable is
strRequest = "{""jsonrpc"": ""2.0"", ""method"":""SportsAPING/v1.0/listMarketCatalogue"",""params"":{""filter"":{""eventTypeIds"":[""1""],""marketCountries"":[""GB""] ,""marketTypeCodes"":[""MATCH_ODDS""],""marketStartTime"":{""from"":""" & FromDate & """,""to"":""" & ToDate & """},""venues"":[],""marketBettingTypes"":[] },""sort"":""FIRST_TO_START"",""maxResults"":""1000"",""marketProjection"":[""COMPETITION"",""EVENT"",""EVENT_TYPE"",""RUNNER_DESCRIPTION"",""MARKET_START_TIME""] },""id"":1}"
(This is just a snip start 13th and end 17th (5 Days inc) this taken at the mo)
{"jsonrpc":"2.0","result":[{"marketId":"1.115301112","marketName":"Match Odds","marketStartTime":"2014-09-13T11:15:00.000Z","totalMatched":24207.63,"runners":[{"selectionId":48759,"runnerName":"Birmingham","ha ndicap":0.0,"sortPriority":1},{"selectionId":48317 ,"runnerName":"Leeds","handicap":0.0,"sortPriority ":2},{"selectionId":58805,"runnerName":"The Draw","handicap":0.0,"sortPriority":3}],"eventType":{"id":"1","name":"Soccer"},"competiti on":{"id":"33","name":"The Championship"},"event":{"id":"27260378","name":"Bi rmingham v Leeds","countryCode":"GB","timezone":"Europe/London","openDate":"2014-09-13T11:15:00.000Z"}},{"marketId":"1.115259484","mar ketName":"Match Odds","marketStartTime":"2014-09-13T11:45:00.000Z","totalMatched":551052.75,"runner s":[{"selectionId":1096,"runnerName":"Arsenal","handic ap":0.0,"sortPriority":1},{"selectionId":47999,"ru nnerName":"Man City","handicap":0.0,"sortPriority":2},{"selection Id":58805,"runnerName":"The Draw","handicap":0.0,"sortPriority":3}],"eventType":{"id":"1","name":"Soccer"},"competiti on":{"id":"31","name":"Barclays Premier League"},"event":{"id":"27258582","name":"Arsenal v Man City","countryCode":"GB","timezone":"Europe/London","openDate":"2014-09-13T11:45:00.000Z"}}
{"selectionId":58805,"runnerName":"The Draw","handicap":0.0,"sortPriority":3}],"eventType":{"id":"1","name":"Soccer"},"competiti on":{"id":"35","name":"League One"},"event":{"id":"27263995","name":"Fleetwood Town v Barnsley","countryCode":"GB","timezone":"Europe/London","openDate":"2014-09-17T18:45:00.000Z"}}],"id":1}
‘When you run your App the Times (If you are in UK) will return 12:15 and 12:45 etc and not GMT as the Response above
Hope this will do ya for now
Dave

Originally posted by Mr Ed
View Post



(Unless you just mean start is grayed out once in the environment)
Comment