VBNet Sample (Yes really)

Collapse
This is a sticky topic.
X
X
 
  • Time
  • Show
Clear All
new posts

  • betdynamics
    replied
    Mr Ed

    Are you sure that the date format is the problem?

    It looks like there is an errant closing curly bracket before the start of the marketStartTime element. See:

    Code:
    ,""marketTypeCodes"":[""MATCH_ODDS""]},""marketStartTime"":
    Perhaps this causing the request to be truncated?

    Should it be:

    Code:
    ,""marketTypeCodes"":[""MATCH_ODDS""],""marketStartTime"":
    Is it possible to show the actual string that is produced as well as the code used to produce it, as that can make it easier to spot incorrect formatting?

    Leave a comment:


  • Pedro Manso
    replied
    I have a full project in ASP.NET c# called C Sharp which is developed with the APIv6, I would like to know if there is a new version of this project for the new version of the API-NG. If soo please can you make available the ZIP for it?

    Leave a comment:


  • Mr Ed
    replied
    I 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:


  • API NG
    replied
    betdynamics thanks for your reply , I had used the json but problem is getting new updated json then making treeview from that json Is taking so much time . further more horseracing todays card, soccer fixture and greyhound todays card is not there plus horseracing node shows GB,RSA and other country codes and after that it shows so much markets like 1m2f and etc... its quite lengthy ... is there any short way ?
    Can I first use ListEventTypes ==> then send parented like 4 cricket and get all the upcoming tournaments like pak vs bang , indian premier league, English domestic and after that I send and get odiseries/t20/testseries and then get pak vs bang and in the end get matchodds,completematch,tiedmatch,inningruns and others as it was in old api and currently on betfair's website
    Last edited by API NG; 11-09-2014, 03:35 PM.

    Leave a comment:


  • betdynamics
    replied
    See response on the other thread.

    Leave a comment:


  • doctormike
    replied
    listMarketBook issue

    I have a ListMarketBook query

    This returns the expected string response:

    Dim strRequest As String
    strRequest = "{""jsonrpc"": ""2.0"",""method"":""SportsAPING/v1.0/listMarketBook"", ""params"":{""marketIds"[""1.115258230""],""priceProjection"":{""priceData"":[""EX_BEST_OFFERS""]}}, ""id"": 1}"

    But if I try to limit the depth of prices returned to 1 thus:

    strRequest = "{""jsonrpc"": ""2.0"", ""method"": ""SportsAPING/v1.0/listMarketBook"", ""params"":{""marketIds"":[""1.115258230""],""priceProjection"":{""priceData"":[""EX_BEST_OFFERS""],""exBestOffersOverrides"":{""bestPricesDepth"":"" 1""}}, ""id"": 1}"

    I get a Bad Request error. Can anyone see where I’m going wrong?

    With regards
    Mike

    Leave a comment:


  • Mr Ed
    replied
    Thanks for your help

    I've sorted it now

    Much appreciated

    Leave a comment:


  • davecon
    replied
    Hi Mr Ed

    Public Class MarketInfo '~~> Level 2
    '~~> 2nd Level from "result":[{"marketId":"1.112335549","marketName":"2m Nov Hrd","marketStartTime"


    'PUT IT ANYWHERE IN HERE BUT ABOVE THE NEXT LIST BELOW

    Private m_name As String
    <JsonProperty(PropertyName:="name")> _
    Public Property Name() As String 'Start Name with a Capital or something that is different to Json prop name always in small case "name" Or eg MyName etc So you know its yours
    Get
    Return m_name
    End Get
    Set(value As String)
    m_name = value
    End Set
    End Property

    ''VVVVV PUT IT ABOVE THIS LIST BELOW VVVV

    Private m_runners As List(Of Selections)
    <JsonProperty(PropertyName:="runners")> _
    Public Property Runners() As List(Of Selections)


    Hope that will give you the idea
    Dave


    Originally posted by Mr Ed View Post
    Thanks
    My request is
    strRequest = "{""jsonrpc"": ""2.0"", ""method"":""SportsAPING/v1.0/listCompetitions"",""params"": " & "{""filter"":{""eventTypeIds"":[""1""],""marketCountries"":[""GB""] ,""marketTypeCodes"":[""MATCH_ODDS""]}, ""marketStatus"":""OPEN"" }" & ", ""id"": 1}"

    Leave a comment:


  • Mr Ed
    replied
    Thanks
    My request is
    strRequest = "{""jsonrpc"": ""2.0"", ""method"":""SportsAPING/v1.0/listCompetitions"",""params"": " & "{""filter"":{""eventTypeIds"":[""1""],""marketCountries"":[""GB""] ,""marketTypeCodes"":[""MATCH_ODDS""]}, ""marketStatus"":""OPEN"" }" & ", ""id"": 1}"




    Originally posted by davecon View Post
    Hi Mr Ed
    Yep you do need to enter your own App Key (Dont use the delayed one it dont work on half the stuff)
    That Basic app was just to give that Guy an example I have no interest whatsover in anything else except horse racing so I dont even know what request you are sending
    You need to send the Request - Get the Response and then set them out into classes based on the resulting String
    The Market info in the basic app will be totally different because of the array lists etc
    If you show me the request you are sending etc I could take a peek for you - No promises though - The weather looks to be fine again next Week so I wont be here lol
    Dave

    Leave a comment:


  • betdynamics
    replied
    To build the treeview, you need to use the Navigation data. See https://api.developer.betfair.com/se...r+Applications

    Leave a comment:


  • API NG
    replied
    TreeView

    Can Someone help me out on this .. SportsAPING/v1.0/listEventTypes returns all the event type like cricket,horseracing and etc but not returning Horse Racing Todays Card and further more how can I build treeview as on betfair website...
    I am very confused here that if request for events with in cricket it returning the end node like matchodds,top batsman etc and this is not I need, please help me out on this I want to build treeview control as on betfair website.

    Leave a comment:


  • davecon
    replied
    Hi Mr Ed
    Yep you do need to enter your own App Key (Dont use the delayed one it dont work on half the stuff)
    That Basic app was just to give that Guy an example I have no interest whatsover in anything else except horse racing so I dont even know what request you are sending
    You need to send the Request - Get the Response and then set them out into classes based on the resulting String
    The Market info in the basic app will be totally different because of the array lists etc
    If you show me the request you are sending etc I could take a peek for you - No promises though - The weather looks to be fine again next Week so I wont be here lol
    Dave

    Originally posted by Mr Ed View Post
    Right - I'm stuck again.

    Finally started to get it to do what I want to do.
    My response form strCatalogue is (not included it all)
    "{"jsonrpc":"2.0","result":[{"competition":{"id":"35","name":"League One"},"marketCount":13,"competitionRegion":"GBR"}, {"competition":{"id":"33","name":"The Championship"},"marketCount":12

    So I added (to Public Class MarketInfo)

    Private m_name As String
    <JsonProperty(PropertyName:="name")> _
    Public Property name() As String
    Get
    Return m_name
    End Get
    Set(value As String)
    m_name = value
    End Set
    End Property

    Why is that then not picking up the market names?
    I think I must be missing something else somewhere

    Leave a comment:


  • Mr Ed
    replied
    Right - I'm stuck again.

    Finally started to get it to do what I want to do.
    My response form strCatalogue is (not included it all)
    "{"jsonrpc":"2.0","result":[{"competition":{"id":"35","name":"League One"},"marketCount":13,"competitionRegion":"GBR"}, {"competition":{"id":"33","name":"The Championship"},"marketCount":12

    So I added (to Public Class MarketInfo)

    Private m_name As String
    <JsonProperty(PropertyName:="name")> _
    Public Property name() As String
    Get
    Return m_name
    End Get
    Set(value As String)
    m_name = value
    End Set
    End Property

    Why is that then not picking up the market names?
    I think I must be missing something else somewhere

    Leave a comment:


  • Mr Ed
    replied
    I think I sorted it - I need to enter it myself??

    Leave a comment:


  • Mr Ed
    replied
    Ok

    Probably going to show my stupidity again.
    The code doesn't seem to work properly for me, but that's no big issue as I'm just trying to use if for reference.
    I was looking at the APP_KEY and cant see where it is created in your app.

    If you can point me in the right direction that would be most helpful

    Thanks

    Leave a comment:

Working...
X