Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1
  • 2

THEMA: surveyID vs iSurveyID

surveyID vs iSurveyID 9 Monate 3 Wochen her #97579

  • nicola_86
  • nicola_86s 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}"
Der Administrator hat öffentliche Schreibrechte deaktiviert.

surveyID vs iSurveyID 9 Monate 3 Wochen her #97581

  • mdekker
  • mdekkers Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 340
  • Dank erhalten: 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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

surveyID vs iSurveyID 9 Monate 3 Wochen her #97588

  • nicola_86
  • nicola_86s 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

surveyID vs iSurveyID 9 Monate 3 Wochen her #97589

  • mdekker
  • mdekkers Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 340
  • Dank erhalten: 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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

surveyID vs iSurveyID 9 Monate 3 Wochen her #97591

  • nicola_86
  • nicola_86s Avatar
ok, but that doesn't solve my problem unfortunately. Do you have an example of the sintaxt of a get_participant_properties call?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

surveyID vs iSurveyID 9 Monate 3 Wochen her #97593

  • mdekker
  • mdekkers Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 340
  • Dank erhalten: 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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

surveyID vs iSurveyID 9 Monate 3 Wochen her #97594

  • nicola_86
  • nicola_86s 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..
Der Administrator hat öffentliche Schreibrechte deaktiviert.

surveyID vs iSurveyID 9 Monate 3 Wochen her #97596

  • mdekker
  • mdekkers Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 340
  • Dank erhalten: 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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

surveyID vs iSurveyID 9 Monate 3 Wochen her #97597

  • nicola_86
  • nicola_86s 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?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

surveyID vs iSurveyID 9 Monate 3 Wochen her #97598

  • mdekker
  • mdekkers Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 340
  • Dank erhalten: 68
  • Karma: 38
I think list_participants can give you that info (tid <-> token mapping)
---
Menno Dekker
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Moderatoren: ITEd
Ladezeit der Seite: 0.129 Sekunden
Donation Image