4 Replies Latest reply on Apr 1, 2015 3:06 AM by kalaoke

    osapi http get error

    kalaoke Novice

      I try to use the osapi in my jive app to get  responses via  getfeedback api


      Here is  my javascript code



         'href' : 'https://api.getfeedback.com/surveys/' + poll.id  + '/responses',

         'format' : 'json',

         'headers': {

         'Authorization': 'Bearer xxxxxx'

      }).execute(function (response) {




      i have got this response

      1. 0: {id: "http.get",…}
        1. error: {message: "internalError: java.lang.String cannot be cast to org.json.JSONArray", code: 500}

      May i miss something?

        • Re: osapi http get error

          1. Move this discussion to the Jive Developers space, you are unlikely to get answers for a private discussions

          2. Out of professional courtesy to your peers, please post under your full name

          3. Shouldn't the headers attribute be an array, rather than a single value?

            • Re: osapi http get error
              kalaoke Novice

              thanks for your advice

                • Re: osapi http get error
                  shipra Beginner

                  Did you get a solution for this issue. Even I am running into same error

                    • Re: osapi http get error
                      kalaoke Novice

                      I turn out this issue but i don't manage to do a direct call.

                      i handle it like this :

                      First in the js file loaded in my view,  i create a http get to  my nodejs server :


                      var hosturls =my.nodejs.server.url


                         'href': hostUrl+ '/responses/' + poll.id ,

                         'format': 'json',

                         'noCache': true,

                         'authz': 'signed'
                      }).execute(function( response ) {



                      In the nodejs app.js  i create a route url  :


                      app.get('/responses/:pollid', function(req, res) {

                         var pollid = req.params.pollid;

                         request('https://api.getfeedback.com/surveys/' + poll.id  + '/responses', function (error, response, body) {

                              var responses = JSON.parse(body), json =[];

                              for (var i = 0; i < responses.length; i++) {

                              // here you create a good json to return




                      hope this help.

                      1 person found this helpful