Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Using limesurvey RPC with chrome postman

  • someuser99
  • someuser99's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 6 days ago #182198 by someuser99
Using limesurvey RPC with chrome postman was created 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?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 days ago #182202 by DenisChenu
Replied by DenisChenu on topic Using limesurvey RPC with chrome postman

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 days ago - 5 years 5 days ago #182210 by tpartner
Replied by tpartner on topic Using limesurvey RPC with chrome postman
This works for me after getting a session key:

Code:
{
  "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.
Last edit: 5 years 5 days ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 days ago #182221 by DenisChenu
Replied by DenisChenu on topic Using limesurvey RPC with chrome postman
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 , plugin development .
I don't answer to private message.
The topic has been locked.
  • someuser99
  • someuser99's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 2 days ago #182289 by someuser99
Replied by someuser99 on topic Using limesurvey RPC with chrome postman
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.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 days ago #182290 by tpartner
Replied by tpartner on topic Using limesurvey RPC with chrome postman
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.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 day ago #182353 by DenisChenu
Replied by DenisChenu on topic Using limesurvey RPC with chrome postman

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: tpartner
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose