Using limesurvey RPC with chrome postman

More
4 months 1 day ago #182198 by someuser99
I am trying to test lime survey Remote control 2 API using post man. I have enabled RPC for JSON on my live survey instance.

i make a get request on postman(As shown in the image attached) for get_session and export_responses method.

In both the cases, i get status 200 OK along with the following text in the body

Loading...
RemoteControl is available using json for transport and exposes the following functionality:
activate_survey
/**
* Activate an existing survey
*
* Return the result of the activation
* Failure status : Invalid Survey ID, Constistency check error, Activation Error, Invalid session key, No permission
*
* @access public
* @param string $sSessionKey Auth credentials
* @param int $iSurveyID ID of the Survey to be activated
* @return array in case of success result of the activation
*/
activate_tokens
/**
* Initialise the token system of a survey where new participant tokens may be later added.
*
* @access public
* @param string $sSessionKey Auth credentials
* @param integer $iSurveyID ID of the Survey where a survey participants table will be created for
* @param array $aAttributeFields An array of integer describing any additional attribute fields
* @return array Status=>OK when successful, otherwise the error description
*/
add_group
/**
* Add an empty group with minimum details to a chosen survey.
* Used as a placeholder for importing questions.
* Returns the groupid of the created group.
*
* @access public
* @param string $sSessionKey Auth credentials
* @param int $iSurveyID ID of the Survey to add the group
and so on...

why don't i get a string as i should in both the cases?
Attachments:

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
4 months 1 day ago #182202 by DenisChenu

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
4 months 1 day ago - 4 months 1 day ago #182210 by tpartner
This works for me after getting a session key:

{
	"method": "get_survey_properties",
	"params": [
		"cJxNVsllmB4ttejg3VT3FxqeuqrCVqc5",
		"885886"
	],
	"id": 1
}


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Attachments:
Last edit: 4 months 1 day ago by tpartner.
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
4 months 7 hours ago #182221 by DenisChenu
Yep, because you d a josn-rpc call. Not someuser99 who need hekp not totaly related to LS ;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #182289 by someuser99
Thank you. works for me now as well.

1) May i ask why you used 'POST' here? Since we are receiving the data, i thought it should be get.

2) Also, what is the 'id' field in your post? what does it describe.

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #182290 by tpartner
1) LSjsonRPCServer.php seems to require it - github.com/LimeSurvey/LimeSurvey/blob/ma...sonRPCServer.php#L14

2) Again, LSjsonRPCServer.php requires it - github.com/LimeSurvey/LimeSurvey/blob/ma...sonRPCServer.php#L39

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #182353 by DenisChenu

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: tpartner

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!