placeOrders ACCESS_DENIED with Delayed Key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • suthy
    Junior Member
    • May 2017
    • 6

    #1

    placeOrders ACCESS_DENIED with Delayed Key

    Hi,

    I'm getting the following error attempting to call placeOrders using the delayed API key:

    { code: -32099,
    message: 'ANGX-0015',
    data:
    { APINGException:
    { requestUUID: 'prdang043-04180848-006043bdfa',
    errorCode: 'ACCESS_DENIED',
    errorDetails: '' },
    exceptionname: 'APINGException' } }

    I'm seeing conflicting information in previous similar posts, some saying that place orders only works with live key, others having delayed keys with betting disabled and then subsequently having betting enabled on delayed key.

    For further info, here is the request:

    { request:
    { jsonrpc: '2.0',
    id: 18,
    method: 'SportsAPING/v1.0/placeOrders',
    params: { marketId: '1.131379950', instructions: [Object] } }

    Of which the instructions object is made up of:

    [ { orderType: 'LIMIT',
    selectionId: 424762,
    side: 'LAY',
    limitOrder: { price: 1.8, size: '4.24', persistenceType: 'PERSIST' } },
    { orderType: 'LIMIT',
    selectionId: 12942908,
    side: 'LAY',
    limitOrder: { price: 1.8, size: '4.24', persistenceType: 'PERSIST' } },
    { orderType: 'LIMIT',
    selectionId: 12787742,
    side: 'LAY',
    limitOrder: { price: 1.8, size: '4.24', persistenceType: 'PERSIST' } },
    { orderType: 'LIMIT',
    selectionId: 12925606,
    side: 'LAY',
    limitOrder: { price: 1.8, size: '4.24', persistenceType: 'PERSIST' } },
    { orderType: 'LIMIT',
    selectionId: 12973175,
    side: 'LAY',
    limitOrder: { price: 1.8, size: '4.24', persistenceType: 'PERSIST' } },
    { orderType: 'LIMIT',
    selectionId: 12973176,
    side: 'LAY',
    limitOrder: { price: 1.8, size: '4.24', persistenceType: 'PERSIST' } },
    { orderType: 'LIMIT',
    selectionId: 12899177,
    side: 'LAY',
    limitOrder: { price: 1.8, size: '4.24', persistenceType: 'PERSIST' } },
    { orderType: 'LIMIT',
    selectionId: 12899179,
    side: 'LAY',
    limitOrder: { price: 1.8, size: '4.24', persistenceType: 'PERSIST' } } ]

    Any help appreciated.

    Regards

    Andy
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    You need a live key to place bets.

    Comment

    • suthy
      Junior Member
      • May 2017
      • 6

      #3
      Thanks Jabe,

      The API documentation states that Bet Placement (Live Exchange) is available with the delayed key.

      http://docs.developer.betfair.com/do...pplicationKeys

      And thread here talks about delayed key being disabled for betting:

      http://forum.bdp.betfair.com/showthr...hlight=delayed

      Have things changed since then and the docs are out of date?

      Comment

      • jabe
        Senior Member
        • Dec 2014
        • 705

        #4
        Originally posted by suthy View Post
        Thanks Jabe,

        The API documentation states that Bet Placement (Live Exchange) is available with the delayed key.

        http://docs.developer.betfair.com/do...pplicationKeys

        And thread here talks about delayed key being disabled for betting:

        http://forum.bdp.betfair.com/showthr...hlight=delayed

        Have things changed since then and the docs are out of date?
        I do beg your pardon, looks like I was wrong. Perhaps that was changed when the fee for a full key was introduced.

        Comment

        • suthy
          Junior Member
          • May 2017
          • 6

          #5
          No problem Jabe, using the live key seems to be the "answer" on other similar threads, but I'm not ready to shell out for one while still developing.

          Anyone help out?

          Comment

          • LiamP
            Junior Member
            • Oct 2015
            • 284

            #6
            Do your headers include your app key and session token?

            Comment

            • KJIB
              Junior Member
              • Jan 2017
              • 6

              #7
              I'm using the delayed key and can place bets and if there's a match then they get matched to. I can also cancel unmatched bets using the delayed key and it will cancel unmatched bets made from my app or with other live apps too, if you tell it to.

              Obviously you're going need to be mega careful placing bets with a delayed key as you can't see if it makes sense without another app that has a live key to show you the real data.

              So, if you can't place bets with your delayed key, I think you've a bug. Check your parameters.

              Comment

              • jabe
                Senior Member
                • Dec 2014
                • 705

                #8
                You'll need to have placed a bet on your Betfair account that has been settled within the last 3 months (or something like this).

                Comment

                • suthy
                  Junior Member
                  • May 2017
                  • 6

                  #9
                  Headers as follows (same as other working requests to API). My actual delayed key replaced with MYAPPLICATIONKEY for snippet:

                  { 'X-Authentication': 'I2qTpJEiqHzGcTh5wgRluDkEpp5cs73SpRmkdFUW+qU=',
                  'Content-Type': 'application/json',
                  'Content-Length': 1252,
                  Connection: 'keep-alive',
                  'X-Application': 'MYAPPLICATIONKEY' }

                  There are lots of recently settled bets on my account, but I'll place another noddy bet manually to check that angle.

                  Thank's all

                  Comment

                  • BigSprout
                    Junior Member
                    • Feb 2011
                    • 60

                    #10
                    Hi Suthy,
                    looking at your code in your original post it seems that you have the size as a type string?

                    e.g.
                    shouldn't these lines:
                    limitOrder: { price: 1.8, size: '4.24', persistenceType: 'PERSIST' } },

                    read:
                    limitOrder: { price: 1.8, size: 4.24, persistenceType: 'PERSIST' } },

                    I code in VB.Net and it uses double quotes to signify a string, not sure what the single quotes mean?
                    cheers

                    Comment

                    • jabe
                      Senior Member
                      • Dec 2014
                      • 705

                      #11
                      [QUOTE=BigSprout;14484]Hi Suthy,
                      looking at your code in your original post it seems that you have the size as a type string?/QUOTE]

                      It's okay to do this. In some situations, it appears to be safer.

                      Comment

                      • BigSprout
                        Junior Member
                        • Feb 2011
                        • 60

                        #12
                        Thanks Jabe, something I didn't know

                        Comment

                        • suthy
                          Junior Member
                          • May 2017
                          • 6

                          #13
                          Same response after placing £2 losing exchange bet on some Chinese football team I'd never heard of before

                          Comment

                          • jabe
                            Senior Member
                            • Dec 2014
                            • 705

                            #14
                            Originally posted by suthy View Post
                            Same response after placing £2 losing exchange bet on some Chinese football team I'd never heard of before
                            Can only think it's the live key thing then. If the request contained code errors, I would have expected that to be rejected before access was denied.

                            Comment

                            • suthy
                              Junior Member
                              • May 2017
                              • 6

                              #15
                              Quick update.

                              Created a new set of application keys on a different betfair account and am now placing live orders using the delayed key.

                              Must be an issue with the specific key I was using.

                              Thanks for all your help.

                              Comment

                              Working...
                              X