1 Reply Latest reply on Oct 30, 2019 7:19 PM by john_reynolds

    osapi.http.post(payload).execute(function(response) function in Custom add-on is throwing 406 error

    keerthanasundaram

      We have a custom add-on in our application which was created using JIVE sdk to connect with a third party website.

      We are facing issue while performing a POST call using the osapi.http.post.

       

      Getting the error message: Error 406  : Response not valid json

       

      Code where we are using the osapi function

      var appKey = 'jive-core';

                  var payload = { 

                          'href' : 'https://url/latest/user',                

                          'format' : 'json', 

                          'authz' : 'basic',                                     

                          'headers' : { 'Content-Type' : ['application/json'] , 'Accept' : ['application/xml'], 'Authorization' : ['Basic ']},                

                          'body' : '{ "group" : "group name" }'

                  };

              console.log(payload);

              osapi.http.post(payload).execute(function(response)

             

      After the execute function we get this error

       

      response:

      error:

      code: 406

      message: "Response not valid JSON"

      __proto__: Object

      id: "http.post"

      __proto__:

       

      Can you please let us know what else is required to proceed further and please let us know if any more information is required.

       

      Thanks,

      Keerthana.S

      Hi team,

      We have a custom add-on in our application which was created using JIVE sdk to connect with a third party website.
      We are facing issue while performing a POST call using the osapi.http.post.

      Getting the error message: Error 406  : Response not valid json

      Code where we are using the osapi function
      var appKey = 'jive-core';
                  var payload = { 
                          'href' : 'https://url/latest/user',                
                          'format' : 'json', 
                          'authz' : 'basic',                                     
                          'headers' : { 'Content-Type' : ['application/json'] , 'Accept' : ['application/xml'], 'Authorization' : ['Basic ']},                
                          'body' : '{ "group" : "group name" }'
                  };
              console.log(payload);
              osapi.http.post(payload).execute(function(response)
             
      After the execute function we get this error

      response:
      error:
      code: 406
      message: "Response not valid JSON"
      __proto__: Object
      id: "http.post"
      __proto__:

      Can you please help us here as it has become a blocker to proceed further and please let us know if any more information is required.

      Thanks,
      Keerthana.S