Check out the LimeSurvey source code on GitHub!

unable to decode malformed json

More
2 years 11 months ago #106442 by dscanlan81
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?

Please Log in to join the conversation.

More
10 months 4 days ago - 10 months 4 days ago #134964 by first
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: 10 months 4 days ago by first.

Please Log in to join the conversation.

More
10 months 4 days ago #134969 by first
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."

Please Log in to join the conversation.

More
10 months 4 days ago #134974 by first
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."

Please Log in to join the conversation.

More
3 months 4 weeks ago #143734 by eduardocosta
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.. :)

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form