Params Filter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • uncletone1
    Junior Member
    • Oct 2012
    • 24

    #1

    Params Filter

    Hi, I'm having a little success with the following (C#)

    String Call = "{\"jsonrpc\": \"2.0\", \"method\": \"SportsAPING/v1.0/listEventTypes\", \"params\": {\"filter\}";

    Which is bringing back all the eventtypes.

    I'm trying to apply a filter to bring 'BPL' and its bringing erorr 32602. Can someone help point me in hte direction of filtering correctly.

    String Call = "{\"jsonrpc\": \"2.0\", \"method\": \"SportsAPING/v1.0/listCompetitions\", \"params\": {\"filter\":{\"competitionIds\": \"31\"}}}";
  • AlgoTrader
    Junior Member
    • Mar 2012
    • 243

    #2
    filter is mandatory field, so it should be filter: {} in JSON. filter is object, empty object is {}
    Betfair Bots Made Easy

    Comment

    • uncletone1
      Junior Member
      • Oct 2012
      • 24

      #3
      Originally posted by AlgoTrader View Post
      filter is mandatory field, so it should be filter: {} in JSON. filter is object, empty object is {}
      Thanks Algo.. It was my mistake i pasted it wrong from my code.

      String CALL = "{\"jsonrpc\": \"2.0\", \"method\": \"SportsAPING/v1.0/listEventTypes\", \"params\": {\"filter\":{}}, \"id\": 1}";

      This works OK. (The empty object).

      I'm trying to now add some parameteres to filter my search down but i'm struggling to work out the layout and the formatting.

      I took a look at
      https://api.developer.betfair.com/se...s-MarketFilter

      and figured i could add competitionIds into the filter to restrict it down. Have i formatted it wrongly? am i using the wrong naming?

      String Call = "{\"jsonrpc\": \"2.0\", \"method\": \"SportsAPING/v1.0/listCompetitions\", \"params\": {\"filter\":{\"competitionIds\": \"31\"}}}";

      Thanks

      Comment

      • AlgoTrader
        Junior Member
        • Mar 2012
        • 243

        #4
        If you want my advice - stop to work with JSON as string and start to work with JSON as object then serialize it. When you prepare JSON string manually, you make lots of errors.

        In you case, you miss '[' and ']' for arrays. "competitionIds" is plural but you provide a single id, I think array should be provided
        Betfair Bots Made Easy

        Comment

        • uncletone1
          Junior Member
          • Oct 2012
          • 24

          #5
          Originally posted by AlgoTrader View Post
          If you want my advice - stop to work with JSON as string and start to work with JSON as object then serialize it. When you prepare JSON string manually, you make lots of errors.

          In you case, you miss '[' and ']' for arrays. "competitionIds" is plural but you provide a single id, I think array should be provided
          Thanks Algo. I will give it a shot makin the parameters.

          I'm attempting the string approach to get my head around JSON first (It might seem a little strange to some but I thought it should be "human readable" (to a degree)). Once i have the basic premise of how the string should look I will start on building objects and then serialisation.

          Further Question not quite related, but as i've got your attention.

          Is there a way to "Trace/View" the submitted query / Response when using the Visualiser? and if possible is there tools for this process??

          Thanks.

          Comment

          Working...
          X