INPUT_VALIDATION_ERROR Error Code while trying to Logic

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • David Sutcliffe
    Junior Member
    • Sep 2014
    • 30

    #1

    INPUT_VALIDATION_ERROR Error Code while trying to Logic

    Hello I am trying to login with Curl Using PHP. I have used Betfair Interactive Login API. But as a response I get Following response.
    {
    token: "",
    product: "MY_KEY_VALUE",
    status: "FAIL",
    error: "INPUT_VALIDATION_ERROR"
    }
    Please help me out of this problem.
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    Most likely you have a password that contains certain punctuation characters (like #)

    Comment

    • David Sutcliffe
      Junior Member
      • Sep 2014
      • 30

      #3
      Php Login

      Hello,

      I am trying to login betfair using php.when i execute the program with login url :- https://identitysso.betfair.com/api/login.

      The api response with below message.

      HTTP/1.1 200 OK Content-Type: application/json Content-Length: 90 Date: Tue, 24 Feb 2015 09:56:39 GMT

      {"token":"","product":"ZRStFMlXRaFXeDsw","status": "FAIL","error":"INPUT_VALIDATION_ERROR"}

      Also check password that can not contains certain punctuation characters (like #).

      Please guide me.how to resolve problem.

      Please find the below Php Code which i used for login.

      $appKey="";
      $data = array('username'=>urlencode(''),'password'=>urlenc ode(''));
      $data_json = json_encode($data);
      $url="https://identitysso.betfair.com/api/login";
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_POST,true);
      curl_setopt($ch, CURLOPT_HEADER, true);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

      curl_setopt($ch, CURLOPT_HTTPHEADER,
      array('Accept: application/json','X-Application:'.$appKey,'Content-Type: application/json'));
      curl_setopt($ch, CURLOPT_POSTFIELDS,$data_json);
      //$result = curl_exec($ch);
      $response = curl_exec($ch);
      echo $response;
      curl_close($ch);

      Comment

      • David Sutcliffe
        Junior Member
        • Sep 2014
        • 30

        #4
        Hello,

        Please do the needful as soon as possible.

        Thanks

        Comment

        • Merlin
          Junior Member
          • Jan 2009
          • 56

          #5
          Hi David,
          have you tried passing the username and password as plain strings, rather than urlencoding them first? You have already set the Content-Type to 'application/json', so as long as the body is valid json, it should take anything alphanumeric or any of the following punctuation marks

          $!?()*+,:;=@_./-[]{}

          without needing to urlencode them.
          I'm not sure that this is the problem, though, as I would expect this to produce a, 'INVALID_USERNAME_OR_PASSWORD' error rather than an 'INPUT_VALIDATION_ERROR'. Those usually happen if you mis-spell or wrongly capitalise a parameter name, and yours look ok (don't know any PHP, so I can't comment on your code)

          Cheers
          Merlin

          Comment

          • ChubbyChaser
            Junior Member
            • Sep 2014
            • 1

            #6
            David,

            Did you manage to resolve this issue? I am having the exact same problem.

            The strange thing is that when I run curl from the command line it works ok. So I assuming the problem is with the php code.
            Last edited by ChubbyChaser; 21-03-2015, 02:13 PM.

            Comment

            • Anderson Oliveira
              Junior Member
              • Mar 2017
              • 1

              #7
              I am having the exact same problem in Angular (JavaScript)

              Comment

              • jabe
                Senior Member
                • Dec 2014
                • 705

                #8
                I can't see your code from here.

                Comment

                • rye
                  Junior Member
                  • Sep 2019
                  • 4

                  #9
                  Originally posted by David Sutcliffe View Post
                  Hello I am trying to login with Curl Using PHP. I have used Betfair Interactive Login API. But as a response I get Following response.
                  {
                  token: "",
                  product: "MY_KEY_VALUE",
                  status: "FAIL",
                  error: "INPUT_VALIDATION_ERROR"
                  }
                  Please help me out of this problem.
                  Because the password contains special symbols, PHP uses the rawurlencode() function to escape the password and then sends it, so you can log in normally.

                  Comment

                  Working...
                  X