Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: surveyID vs iSurveyID

surveyID vs iSurveyID 1 year 4 months ago #97579

  • nicola_86
  • nicola_86's Avatar
I was wondering why you specify two different names for the same attribute in the API? It seems that I have problems when I have to do that kind of call, because iSurveyID is an int type of variable.
For example the following call doesn't work:
{\"method\": \"get_participant_properties\", \"params\": {\"sSessionKey \": "+sessionKey+", \"iSurveyID \": 811861, \"iTokenID\": 5jmrj7dihsyhgjx  \"aTokenProperties\":[{\"email\":\"zooropa86@gmail.com\",\"lastname\":\"Prova\",\"firstname\":\"URL\",\"attribute_2\":\"http://manual.limesurvey.org/RemoteControl_2_API#Examples\"}]}, \"id\": 1}"
The administrator has disabled public write access.

surveyID vs iSurveyID 1 year 4 months ago #97581

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
I think JSON-RPC 1.0 does not handle named parameters, only positional so there should be no problem with naming when you supply parameters in the correct order. I think it is more of a documentation problem with the api then a functional problem.

I don't see a duplicate parameter in the call, can you explain what the problem is and what kind of output you get/expect?
---
Menno Dekker
The administrator has disabled public write access.

surveyID vs iSurveyID 1 year 4 months ago #97588

  • nicola_86
  • nicola_86's Avatar
uhm the problem is that the entity of the json object is empty. I just got this
HTTP/1.1 200 OK [Date: Mon, 01 Jul 2013 09:48:40 GMT, Server: Apache/2.2.15 (CentOS), X-Powered-By: PHP/5.3.3, Expires: Thu, 19 Nov 1981 08:52:00 GMT, Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, Pragma: no-cache, Content-Length: 0, Keep-Alive: timeout=15, max=99, Connection: Keep-Alive, Content-Type: text/html; charset=UTF-8]

If I want to see the parameters that remotecontrol has from my call(I have access to that file on the server) what php command can I use to print the value of the fields of the method? print_r ?
And where do I aspect to see the the results of these prints?
thanks in advance.
The administrator has disabled public write access.

surveyID vs iSurveyID 1 year 4 months ago #97589

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
pastebin.com/531uHQ2x

This first request lists the valid survey id's, and then when i insert one i get a valid response.
---
Menno Dekker
The administrator has disabled public write access.

surveyID vs iSurveyID 1 year 4 months ago #97591

  • nicola_86
  • nicola_86's Avatar
ok, but that doesn't solve my problem unfortunately. Do you have an example of the sintaxt of a get_participant_properties call?
The administrator has disabled public write access.

surveyID vs iSurveyID 1 year 4 months ago #97593

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
post.setEntity( new StringEntity("{\"method\": \"get_participant_properties\", \"params\": {\"sSessionKey \": "+sessionKey+", \"iSurveyId \": 12345, \"iTokenId\": 1, \"aTokenProperties\":[\"token\",\"lastname\"]}, \"id\": 1}"));
---
Menno Dekker
The administrator has disabled public write access.

surveyID vs iSurveyID 1 year 4 months ago #97594

  • nicola_86
  • nicola_86's Avatar
new StringEntity("{\"method\": \"get_participant_properties\", \"params\": {\"sSessionKey \": "+sessionKey+", \"iSurveyId \": 811861, \"iTokenId\": 5jmrj7dihsyhgjx, \"aTokenProperties\":[\"token\",\"lastname\"]}, \"id\": 1}");

doesn't work too :( empty result..
The administrator has disabled public write access.

surveyID vs iSurveyID 1 year 4 months ago #97596

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
Don't ask me why, but the tokenid should be a number, not the token itself. If you go to the token screen you can see the id. Not really sure if there are other ways to get the id (using remote control instead of admin interface).
---
Menno Dekker
The administrator has disabled public write access.

surveyID vs iSurveyID 1 year 4 months ago #97597

  • nicola_86
  • nicola_86's Avatar
so that, if you leave the creation of tokens to limesurvey, than it won't work that method, because limesurvey doesn't accept alphanumerical token? Am I wrong?
The administrator has disabled public write access.

surveyID vs iSurveyID 1 year 4 months ago #97598

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
I think list_participants can give you that info (tid <-> token mapping)
---
Menno Dekker
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.109 seconds
Donation Image