0 Replies Latest reply on Aug 20, 2013 12:40 AM by jayati453

    407 Proxy Authorization:Jive Apps

    jayati453

      Hi

      I am trying to connect to a different domain from my app which is in Sandbox mode. But I am getting 407 Proxy Authorization Error.

      I am copying here my code snippet -


      var api_url ="http://0.0.0.0:8080/SugarCRM/service/v4_1/rest.php";

       

      var user_name = 'username';    //SugarCRM username

      var password = 'password';    //SugarCRM password

       

      var params = {

          user_auth:{

              user_name:user_name,

              password:password,

              encryption:'PLAIN'

          },

          application: 'SugarCRM RestAPI Example'

      };

      var json = JSON.stringify(params);

      //request.setRequestHeader("Proxy-Authorization", value);

      $.ajax({

       

              url: api_url,

              type: "POST",

              data: { method: "login", input_type: "JSON", response_type: "JSON", rest_data: json },

              dataType: "json",

              success: function(result) {

       

                  if(result.id) {

                          //HERE: you will have out put from rest

                      alert("sucessfully LOGIN Your session ID is : " + result.id);

                   }

                   else

                       alert("Error");

                   

              },

              error: function(result) {

                 alert("In Error : "+result);

              }

      });


      ERROR :

      proxyError.PNG.png

      I also tried changing dataType and response_type to jsonp. but then to I am not able to hit the server successfully.

      Please help me with this.

       

      - Jayati