Does someone have a list of country codes used in the new system

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • monkeymagix
    Junior Member
    • Jul 2010
    • 105

    #1

    Does someone have a list of country codes used in the new system

    Does anyone have a full list of Country Codes and Course Abbreviations for the new API-ING system as I have seen they have changed everything about from the old SOAP system e.g UK is now GB and FRA is now FR.

    Also the API is now using venue names like Toulouse instead of the old abbreviation codes for courses.

    As I have a well formed DB using the old codes I need to map these to the new ones..

    If anyone has a list of all the course & country codes that the new API uses it would be much appreciated.

    Thanks
  • bnl
    Junior Member
    • Nov 2012
    • 108

    #2
    http://en.wikipedia.org/wiki/ISO_3166-1

    /Björn

    Comment

    • monkeymagix
      Junior Member
      • Jul 2010
      • 105

      #3
      Thanks

      Ok, thanks, it's a bit anoying that they have changed all their country codes / courses from the old API.

      I have a table full of country/courses using the 3 letter ISO codes and now they are using 2 letter ISO. Plus I have noticed many horses that have apostrophes in their names are not supplied correctly in the JSON responses so you have to do checks stripping them out if you already have runner data to match with.
      Also for horses with duplicate names they are not supplying the country code in brackets either.

      Also I am constantly getting ERROR_IN_MATCHER and INVALID_BET_SIZE errors in my place/cancel instruction reports even though the Status = SUCCESS and there is a BetID (or a cancelled Bet). I have no idea why I am getting them but the status shows the bet has been placed (and I have checked on the website) so something is going haywire.

      It's been a real nightmare getting this new API working!

      Thanks for the list though.

      Comment

      • bnl
        Junior Member
        • Nov 2012
        • 108

        #4
        Post an example of a bad reply/request.
        Easier to see strange stuff, if there is something to see...
        /Björn

        Comment

        • monkeymagix
          Junior Member
          • Jul 2010
          • 105

          #5
          Error in responses

          This is the same info I sent to BDP and they keep saying that they cannot see anything in the respones to me to suggest errors.

          However as you can see even though the STATUS=SUCCESS I get errors in my instruction and placement reports. This happens with placeOrders, cancelOrders and other API requets whether I use JsonRPC or Rescript to login with.

          The code WORKD e.g I get a BetID back when placing a BET and the bet gets cancelled when I call cancelOrders. However I have to rely on the status value and ignore the reports otherwise my BOT would think the bet placmement/cancellation had failed when in reality it hadn't.

          Maybe you can help me (I don't know if this should be in a new thread or not)

          Request

          EndPoint = https://api.betfair.com/exchange/betting/json-rpc/v1/

          Calling: SportsAPING/v1.0/placeOrders With args: {"marketId":"1.112881779","instructions":[{"orderType":"LIMIT","selectionId":7534086,"handic ap":0.0,"side":"BACK","limitOrder":{"size":2.0,"pr ice":1000.0,"persistenceType":"LAPSE"}}],"customerRef":"123456"}


          Response

          {"jsonrpc":"2.0","result":{"status":"SUCCESS","errorCode":"ERROR_IN_MATCHER","marketId":"1.112881779","instructionReports ":[{"status":"SUCCESS","errorCode":"INVALID_BET_SIZE", "instruction":{"orderType":"LIMIT","selectionId":75 34086,"handicap":0.0,"side":"BACK","limitOrder":{" size":2.0,"price":1000.0,"persistenceType":"LAPSE" }},"betId":"34375696212","placedDate":"2014-02-17T12:04:19Z","averagePriceMatched":0.0,"sizeMatch ed":0.0}],"customerRef":"123456"},"id":1}


          Let me know if you can see anything wrong with that.

          As you can see even though I am getting a status of SUCCESS and a BetID which I can verify on the website the reports that are returned show ERROR_IN_MATCHER and INVALID_BET_SIZE errors for some reason.

          The code is all based on top of the C# example API-ING provided on the BDP deelopment website.

          If you can think of any reason this is happening then please let me know as Betfair don't.

          Thanks

          Rob

          Comment

          • jptrader
            Junior Member
            • Nov 2009
            • 82

            #6
            Do you get this for every response?

            Comment

            • monkeymagix
              Junior Member
              • Jul 2010
              • 105

              #7
              Yes

              Yes I get these errors in the response for every bet I place or cancel. However the status is always SUCCESS even though there are errors which is weird.

              BDP don't have an answer for me and I am basing my code on their example C# API-ING code so it should work as I haven't touched the code that does the JSON HTTP Requests and Responses.

              Comment

              • jptrader
                Junior Member
                • Nov 2009
                • 82

                #8
                There is a bug in the C# sample from BDP. The ExecutionReportErrorCode enum does not have a state saying that there is no error. So, when you try to parse a response from the API, which does not contain any error code, the best the parser could do is to give the ExecutionReportErrorCode the default first value. One way to fix this is adding an extra entry 'OK' to the enum as below.

                Code:
                public enum ExecutionReportErrorCode
                {
                    OK,
                    ERROR_IN_MATCHER,			
                    PROCESSED_WITH_ERRORS,		
                    BET_ACTION_ERROR,
                    etc...
                }
                I have also added a constructor to the PlaceExecutionReport class that sets the error code to the OK status.
                Code:
                public PlaceExecutionReport()
                {
                    ErrorCode = ExecutionReportErrorCode.OK;
                }
                You should do the same for the InstructionReports errorcode and for cancelbets.

                I am not sure if this is what you are seeing, since you provided a json string containing the errors. But if you haven't fixed these enums, a correct json string from the API would give the errors you describe in the C# objects.

                Comment

                • monkeymagix
                  Junior Member
                  • Jul 2010
                  • 105

                  #9
                  Ok

                  Thanks for this I will check out the code and see if that is the problem!

                  Cheers for your help.

                  Comment

                  • monkeymagix
                    Junior Member
                    • Jul 2010
                    • 105

                    #10
                    Yep

                    Yes that fixed it - thanks!

                    The amount of debugging and error hunting we must have done for Betfair with this new API is beyond belief.

                    I personally have told them about 4 errors and the solutions to them, and now with this one I am going to make it 5

                    Thanks for your help!

                    Comment

                    • monkeymagix
                      Junior Member
                      • Jul 2010
                      • 105

                      #11
                      By the way

                      By the way I have also added OK to the InstructionReportErrorCode ENUM as the first value was INVALID_BET_SIZE which would explain why I was getting that error as well.

                      Comment

                      Working...
                      X