unable to decode malformed json

More
3 years 5 months ago #106442 by dscanlan81
dscanlan81 created the topic: unable to decode malformed json
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
1 year 4 months ago - 1 year 4 months ago #134964 by first
first replied the topic: unable to decode malformed json
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
Last Edit: 1 year 4 months ago by first.

Please Log in to join the conversation.

More
1 year 4 months ago #134969 by first
first replied the topic: unable to decode malformed json
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

Please Log in to join the conversation.

More
1 year 4 months ago #134974 by first
first replied the topic: unable to decode malformed json
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

Please Log in to join the conversation.

More
9 months 4 weeks ago #143734 by eduardocosta
eduardocosta replied the topic: unable to decode malformed json
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.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now