Candle requests are failing for granularity below 180

@Raunak I tested this in the Playground as well and it's definitely not working anymore. Please fix urgently:

{
  "echo_req": {
    "granularity": "120",
    "count": "40",
    "ticks_history": "frxUSDJPY",
    "subscribe": "1",
    "style": "candles",
    "end": "latest"
  },
  "error": {
    "details": {
      "granularity": "does not have a value in the enumeration {0,60,120,180,300,600,900,1800,3600,7200,14400,28800,86400}"
    },
    "message": "Input validation failed: granularity",
    "code": "InputValidationFailed"
  },
  "msg_type": "ticks_history"
}

Comments

  • @DragonFly81 you are passing granularity as string i.e. in double quotes but its of integer type
    https://developers.binary.com/api/#ticks_history

    granularity 0 60 120 180 300 600 900 1800 3600 7200 14400 28800 86400
    

    Earlier as there was security issue in code due to type casting so you could use string for integer, we have fixed that please update your code accordingly

  • I thought that might be the issue, which is why I tested it (passing as an integer) and it still fails. I've confirmed this in Playground as well:

    {
      "echo_req": {
        "count": 40,
        "granularity": 120,
        "ticks_history": "frxUSDJPY",
        "subscribe": 1,
        "style": "candles",
        "end": "latest"
      },
      "error": {
        "details": {
          "granularity": "does not have a value in the enumeration {0,60,120,180,300,600,900,1800,3600,7200,14400,28800,86400}"
        },
        "message": "Input validation failed: granularity",
        "code": "InputValidationFailed"
      },
      "msg_type": "ticks_history"
    }
    
  • @DragonFly81 It worked for me all the time in playground as well, will inspect it further

  • Thanks @Raunak - I tested again and it's working now (must have been a residual issue). Now all that's needed is the "Wrong Response"-issue to be resolved and we're home free. :) Thanks for the prompt assistance.

  • edited April 2016

    @Raunak , i still got same error "Input validation failed: granularity".

    2016-04-25 15:06:44 GMT RFLT-ERROR-30 : InputValidationFailed - Input validation failed: granularity [{"echo_req":{"granularity":60,"count":2,"ticks_history":"R_100","end":"latest"},"error":{"details":{"granularity":"does not have a value in the enumeration {0,60,120,180,300,600,900,1800,3600,7200,14400,28800,86400}"},"message":"Input validation failed: granularity","code":"InputValidationFailed"},"msg_type":"ticks_history"}]

    and also many WrongResponse errors too, same as @DragonFly81

  • edited April 2016

    Will check this, if needed will release a patch to fix it and even if you use integer it still happens?

  • This has been fixed now and released

Sign In or Register to comment.