Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: unable to decode malformed json

unable to decode malformed json 2 years 8 months ago #106442

  • dscanlan81
  • dscanlan81's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Hi,

I have been able to get hold of a session key but when I attempt to get a list_group I am constantly getting a "unable to decode malformed json" error.

Here is what I have sent:

{ "method": "list_groups", "params": {"sSessionKey": "xw7airdv4kezf9qg76yy6juedmd8xb9t", "iSurveyID": 193491 }, "id": 1}}

{ "method": "list_groups", "params": {"sSessionKey":526te45pxfy66rjzw72yy3adkw83rt3w, "iSurveyID": 193491 }, "id": 1}}
{ "method": "list_groups", "params": {"sSessionKey":"526te45pxfy66rjzw72yy3adkw83rt3w", "iSurveyID": "193491" }, "id": 1}}

Can anyone tell me where in the sting I am going wrong?
The administrator has disabled public write access.

unable to decode malformed json 7 months 2 weeks ago #134964

  • first
  • first's Avatar
  • Offline
  • Platinum Lime
  • Posts: 329
  • Thank you received: 35
  • Karma: 15
I am getting same error while trying to get session key.
{ id: null,
  result: null,
  error: 'unable to decode malformed json' }

Please help.. I am exploring something

github.com/LimeSurvey/LimeSurvey/blob/ma.../LSjsonRPCServer.php
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
Last Edit: 7 months 2 weeks ago by first.
The administrator has disabled public write access.

unable to decode malformed json 7 months 2 weeks ago #134969

  • first
  • first's Avatar
  • Offline
  • Platinum Lime
  • Posts: 329
  • Thank you received: 35
  • Karma: 15
Something is happening over . here

Please let me know how I can debug:
// reads the input data
		$request = json_decode(file_get_contents('php://input'),true);
        // executes the task on local object
        if (is_null($request)) {
            // Can not decode the json, issue error
            $response = array (
                                'id' => null,
                                'result' => NULL,
                                'error' => sprintf('unable to decode malformed json')
                                );
        }
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
The administrator has disabled public write access.

unable to decode malformed json 7 months 2 weeks ago #134974

  • first
  • first's Avatar
  • Offline
  • Platinum Lime
  • Posts: 329
  • Thank you received: 35
  • Karma: 15
I fixed it...thanks..one thing that I realize every time is that if you keep trying ... you will do it.. :)
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
The administrator has disabled public write access.

unable to decode malformed json 1 month 1 week ago #143734

Could you share the solution ? whats was wrong ?
OMdev wrote:
I fixed it...thanks..one thing that I realize every time is that if you keep trying ... you will do it.. :)
The administrator has disabled public write access.
Time to create page: 0.917 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form