Originally posted by API NG
View Post
VBNet Sample (Yes really)
Collapse
This is a sticky topic.
X
X
-
Navigation Data
does any one have working example for making treeview using navigation data.. because I couldn't get that as it was in API v6. if someone can give example it will be really appreciated. thanks in advance
Leave a comment:
-
To make a treeview, use the Navigation data - see https://api.developer.betfair.com/se...r+Applications
Leave a comment:
-
BetDynamics : TreeView
Hi BetDynamics Thanks for the reply.. can u help me out for making treeview using NG.. first I req for listEventTypes then listEvents but it directly return AA vs BB doesn't show other nodes like worldcup2015 ==> Fixture 19Feb ==> AA vs BB (1st ODI) ==> matchodds,completed,tied and others like was in API v6. Plus listeventtypes doesn't get horseracing todays card and greyhound today card...
if I load jsong.txt and make treeview from it taking so much time further more it update in after every 5 minutes..
is there any other good way to do this..
Please BetDynamics must reply because just few days are left
Leave a comment:
-
As far as I am aware the API v6 WILL expire on the 1st November.
The API v6 and API-NG have been running in parallel for a year already.
Leave a comment:
-
API v6 Expiry Date
Is it correct that API v6 will not expire on 1st of November instead API v6 and API NG will run simultaneously / parallel.
please enlighten me on this thanks in advance...
Leave a comment:
-
Something wrong there then as its not even grayed out on the start page!Originally posted by Mr Ed View PostDebug/start debugging is greyed out, so f5 does nothing
It points to Attach!
(Unless you just mean start is grayed out once in the environment)
I take it that you are Opening Studio from Windows menu and NOT opening it from the sin or proj file?
Or you will probably have to have your form visible - Add it from Solution Explorer and leave it there when you close
Is the current Project in Bold in Solution Explorer == Right Click on it and Choose "Set as Startup Project"
Otherwise All I can suggest there is to install/re-install of Studio Update 3
http://www.microsoft.com/en-us/downl....aspx?id=43721
Sorry
DaveLast edited by davecon; 16-09-2014, 08:06 AM.
Leave a comment:
-
Attach Thingy
Hi Ed
I know what you mean as it happened to me a couple of times, can’t remember if it was after a crash or update
So can only make a few suggestions as I always see it because I use the Start Page option at StartUp so I can see the announcements/updates first and its always on Attach then (It always goes to Start when I load my Solution though)
When it did it last time (Stayed on Attach) – I just started it the Old Way using Debug/Start Debugging (Just press F5 on keyboard) It stayed there after that
Try playing with your Start Up Page – Tools/Options/Environment/StartUp then try Load Last Solution or Show Start Page and vice versa
I know its no big deal but it would annoy me as well if it was not on Start first thing (I would just F5 it!)
Just one more thing – Make sure it says Ready on your status bar as it loads slowly sometimes depending how many projects you have in your Solution (Its easier to have just one solution and Add all your Projects to it rather than have loads of different Solutions with 1 Project)
I do remember the last Update in July to the latest Studio (Update3) was a full Install (Took forever!)
Dave
Originally posted by Mr Ed View PostOnce again thanks for all your help.
I have now managed to get my program working properly using the new api and it didn't take that long because of your assistance. I was worried I wouldn't even get it done in time !!
I may end up with a problem in the future due to the limit of 1000 results, but I will just be able to use the start time to get around that.
Actually maybe you could answer on final question for me (which in no way affects my program)
Whenever I open my project, instead of Start it just says Attach.
If I click on project properties it changes back instantly.
It is weird. I read somewhere it was to do with multiple start up project, but mine just says single anyway.
Leave a comment:
-
Once again thanks for all your help.
I have now managed to get my program working properly using the new api and it didn't take that long because of your assistance. I was worried I wouldn't even get it done in time !!
I may end up with a problem in the future due to the limit of 1000 results, but I will just be able to use the start time to get around that.
Actually maybe you could answer on final question for me (which in no way affects my program)
Whenever I open my project, instead of Start it just says Attach.
If I click on project properties it changes back instantly.
It is weird. I read somewhere it was to do with multiple start up project, but mine just says single anyway.
Leave a comment:
-
Cheers
It is working now. I think the wrongly placed } may have been the main culprit !
thanks
Leave a comment:
-
Date and Time Picker Example
Hi Mr Ed (give my regards to Wilbur)
No Probs, there is a lack of information but then again the API and programming in general is just so vast!
I can see that you are just like me and prefer to try and work things out rather than rely on others to code stuff for you
So only too happy to help – Anytime
Anyways here is the DateTimePicker stuff that may be of interest to yourself and others
You can just select the Times and/or Dates to return the Data of Interest
Eg Today Racing between 3.00 and 4.00 only or the Next 10 Days Football etc between given certain hours
Dont forget Json returns GMT so you will have to cater for this when in other time zones or DST in Summer etc
Add to your Form 2 x DateTimePicker Controls and set the following Properties
Name ---- dtpFROM and dtpTO
Format ---- Time
ShowUpDown --- False ‘This is the default so you can pick dates from Dropdown (if its set True then its for Time Only)
You can leave the Value property as it is (We set these in the Form Load below)
Now in the Form_Load Event you can add what Times are first displayed at Start Up
This is just an example and you can set the times as you choose as you can change to anything at run time anyway
‘Then the Request Call as before but now with the pickersCode:Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'Set what you want to see at Start up dtpFROM.Value = Now.AddHours(0) 'Use Current Time and Date in Form Picker dtpTO.Value = Now.AddHours(2) 'Add some Hours to display other race/match times etc ‘You may need to play around with this to suit yourself based on how your program returns the time strings ‘You would put something similar in your Request-Response Buttons so times correspond with displayed Response Text if required ‘Example how to adjust to DST if your Form already displays Local Times Dim DST As Boolean = TimeZone.CurrentTimeZone.IsDaylightSavingTime(Now) 'Now as the Json Response returns GMT then your Time Picker must return GMT to get all the races 'This is UK example and so only the Day Light Saving hour is added DTS 'You may need to adjust these times to suit yourself If DST = True Then 'We added the Hour to GMT 'So knock it off the Time Picker to get Earlier Races from Json GMT Times dtpFROM.Value = dtpFROM.Value.AddHours(-1) dtpTO.Value = dtpTO.Value.AddHours(-1) Else 'If its already GMT then evertythings Normal End If 'DST End Sub ‘Form Load
Have FunCode:'See form Load the picker is set at Now and +2 hrs Dim FromDate As String = dtpFROM.Value.ToString("yyyy-MM-ddTHH:mm:ssZ") Dim ToDate As String = dtpTO.Value.ToString("yyyy-MM-ddTHH:mm:ssZ") ‘Call the Racing etc strRequest = "{""jsonrpc"": ""2.0"", ""method"":""SportsAPING/v1.0/listMarketCatalogue"",""params"":{""filter"":{""eventTypeIds"":[""7""],""marketCountries"":[""GB"",""IE""] ,""marketTypeCodes"":[""WIN"",""PLACE""],""marketStartTime"":{""from"":""" & FromDate & """,""to"":""" & ToDate & """},""venues"":[],""marketBettingTypes"":[""ODDS""] },""sort"":""FIRST_TO_START"",""maxResults"":""100"",""marketProjection"":[""COMPETITION"",""EVENT"",""EVENT_TYPE"",""RUNNER_DESCRIPTION"",""MARKET_START_TIME""] },""id"":1}"
Dave
Originally posted by Mr Ed View PostThanks a lot for that. I will have a go later today.
I really did try and try to find the information myself but it just doesn't seem to be out there!
I really appreciate your help.
Leave a comment:
-
Thanks a lot for that. I will have a go later today.
I really did try and try to find the information myself but it just doesn't seem to be out there!
I really appreciate your help.
Leave a comment:
-
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 TimeCode: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
The response string returnsCode:‘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 PostI have made great advances with my program now thanks to your help
However I cant seem to get the marketstarttime filter work.
No matter what dates I set I get the same result. I think it could be to do with the formatting of the dates but Ive tried everything without any luck. I tried basic formatting no formatting & ISO 8601
Dim fromdate As String = DateAndTime.Now.ToString("yyyy-MM-ddThh:mm:ss.000Z")
Dim todate As String = DateAndTime.Now.AddDays(2).ToString("yyyy-MM-ddThh:mm:ss.000Z")
strRequest = "{""jsonrpc"": ""2.0"", ""method"":""SportsAPING/v1.0/listMarketCatalogue"",""params"": " & "{""filter"":{""eventTypeIds"":[""1""],""marketCountries"":[" & countries & "] ,""marketTypeCodes"":[""MATCH_ODDS""]},""marketStartTime"":{""from"":""" & fromdate & """,""to"":""" & todate & """},""venues"":[],""sort"":""FIRST_TO_START"",""maxResults"":1000," "marketProjection"":[""EVENT"",""EVENT_TYPE"",""MARKET_START_TIME""], ""marketStatus"":""OPEN"" }" & ", ""id"": 1}" '~~>Edit,""EVENT"",""MARKET_START_TIME"",""RUNNER_ METADATA"",""EVENT_TYPE"",""COMPETITION"",""MARKET _DESCRIPTION""
ANy help greatly apreciated
Leave a comment:


Leave a comment: