stuck on the simplest thing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hellaeon
    Junior Member
    • Mar 2016
    • 5

    #1

    stuck on the simplest thing

    Hi all,

    I am trying to get the json correct for placing a bet on a non horse racing sport.
    Im having little success and getting access denied, so I am nowhere near where I should be...

    This is my json payload, but I just want to simply place an order on 'Match Odds' for a team from a sport such as Australian rules or cricket.

    This is what I have so far:

    Code:
    [
              {
                  "jsonrpc" => "2.0",
                  "method" => "SportsAPING/v1.0/placeOrders",
                  "params" => {
                      "marketId" => "2.101358654",
                      "instructions" => [
                          {
                              "selectionId" => "39981",
                              "handicap" => "0",
                              "side" => "LAY",
                              "orderType" => "LIMIT",
                              "limitOrder" => {
                                  "size" => "10",
                                  "price" => "1.27",
                                  "persistenceType" => "LAPSE"
                              }
                          }
                      ]
                  },
                  "id" => 1
              }
          ]
    Could anyone poke me in the right direction? I think this example is specific to horse racing.
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    JSON uses colons. I've not seen your => notation before.

    The inner part of my placeOrders JSON string looked like this:

    Code:
    "params": 
    {
       "marketId": "1.123270756",
       "instructions": 
       [
          {
          "selectionId": "3",
          "handicap": "0.0",
          "side": "BACK",
          "orderType": "LIMIT",
          "limitOrder": 
             {
             "size": "2.0",
             "price": "990",
             "persistenceType": "PERSIST"
             }
          }
       ]
    }
    Much like yours, but with colons. If you're new to JSON, there's a tutorial on the w3c site.

    Comment

    • hellaeon
      Junior Member
      • Mar 2016
      • 5

      #3
      its ruby sorry, it does get transposed to proper json on the way out.
      I should have mentioned that. Im thinking more around what is the minimal json I need to place an order? This should work in my mind but

      * I have changed mine to look more like yours now, except no matter what I try I always get and error

      Code:
      [
        { 
          "jsonrpc"=>"2.0", 
          "error"=> {
            "code"=>-32099, 
            "message"=>"ANGX-0015", 
            "data"=> { 
              "exceptionname"=>"APINGException", 
              "APINGException"=> { 
                "errorDetails"=>"", 
                "errorCode"=>"ACCESS_DENIED", 
                "requestUUID"=>"prdang012-11240711-00352c5c87"
              }
           }
        }, "id"=>1
      }]

      Comment

      • hellaeon
        Junior Member
        • Mar 2016
        • 5

        #4
        Ok...I feel a little silly now....

        I am working in my dev environment with a dev api key.

        http://forum.bdp.betfair.com/showthr...ight=ANGX-0015

        tells me this wont work. Am I able to place virtual bets while offline?

        Comment

        • jabe
          Senior Member
          • Dec 2014
          • 705

          #5
          Ah! Yes, you get two keys - a delayed one and an ordinary one. I believe you can't place bets with the delayed one.

          I haven't looked at Ruby, so I didn't recognise it. The rest of your parameters look fine to me.

          Are you able to place virtual bets while offline? If you're offline, Betfair won't talk to you.
          Last edited by jabe; 24-03-2016, 04:34 AM.

          Comment

          • hellaeon
            Junior Member
            • Mar 2016
            • 5

            #6
            Im unsure what I need to do to place a virtual bet.
            I can get everything such as event id's and the market id's of what I am interested in, but to place a virtual bet I am unsure of the process.

            I expect the only difference is the endpoint?
            All the json payloads should be the same?

            Thanks for your help too.

            Comment

            • jabe
              Senior Member
              • Dec 2014
              • 705

              #7
              I think the term "virtual bet" is not what you're thinking. It's not a way to make practice bets. Its naming is perhaps unfortunate.

              Virtual bets, as I understand it, means that because Betfair uses a cross-matching algorithm, it is possible to fill bet orders by combining a selection of available prices. So, for instance, if you want to back a price on a football match (perhaps on a home win), and there isn't enough for your request, Betfair attempts to combine money available for lay prices from the away win and the draw to fulfill your bet.

              This is the explanation (such as it is) in the documentation:
              https://api.developer.betfair.com/se...listMarketBook

              When you put in a listMarketBook request, you can choose whether the data returned to you includes the results of all the virtual bets or just the actual amounts staked for each price.

              Comment

              • betdynamics
                Junior Member
                • Sep 2010
                • 534

                #8
                There is no ability to place dummy ("virtual") bets with the API.

                Comment

                Working...
                X