surveyID vs iSurveyID

  • nicola_86
  • nicola_86s Avatar Autor
  • Besucher
  • Besucher
3 Jahre 8 Monate her #97579 von nicola_86
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}"

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 8 Monate her #97581 von mdekker
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

Bitte Anmelden um der Konversation beizutretten.

  • nicola_86
  • nicola_86s Avatar Autor
  • Besucher
  • Besucher
3 Jahre 8 Monate her #97588 von nicola_86
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.

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 8 Monate her #97589 von mdekker
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

Bitte Anmelden um der Konversation beizutretten.

  • nicola_86
  • nicola_86s Avatar Autor
  • Besucher
  • Besucher
3 Jahre 8 Monate her #97591 von nicola_86
ok, but that doesn't solve my problem unfortunately. Do you have an example of the sintaxt of a get_participant_properties call?

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 8 Monate her #97593 von mdekker
post.setEntity( new StringEntity("{\"method\": \"get_participant_properties\", \"params\": {\"sSessionKey \": "+sessionKey+", \"iSurveyId \": 12345, \"iTokenId\": 1, \"aTokenProperties\":[\"token\",\"lastname\"]}, \"id\": 1}"));

---
Menno Dekker

Bitte Anmelden um der Konversation beizutretten.

  • nicola_86
  • nicola_86s Avatar Autor
  • Besucher
  • Besucher
3 Jahre 8 Monate her #97594 von nicola_86
new StringEntity("{\"method\": \"get_participant_properties\", \"params\": {\"sSessionKey \": "+sessionKey+", \"iSurveyId \": 811861, \"iTokenId\": 5jmrj7dihsyhgjx, \"aTokenProperties\":[\"token\",\"lastname\"]}, \"id\": 1}");

doesn't work too :( empty result..

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 8 Monate her #97596 von mdekker
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

Bitte Anmelden um der Konversation beizutretten.

  • nicola_86
  • nicola_86s Avatar Autor
  • Besucher
  • Besucher
3 Jahre 8 Monate her #97597 von nicola_86
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?

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 8 Monate her #97598 von mdekker
I think list_participants can give you that info (tid <-> token mapping)

---
Menno Dekker

Bitte Anmelden um der Konversation beizutretten.

  • nicola_86
  • nicola_86s Avatar Autor
  • Besucher
  • Besucher
3 Jahre 8 Monate her #97599 von nicola_86
I didn't try it, but It's not so good as the the other one. I mean you have to search the information among the list of partecipants, and I guess that it's not so easy to make the list smaller(using start & limit attribute).
Anyway thanks for the suggestion.

Bitte Anmelden um der Konversation beizutretten.

  • nicola_86
  • nicola_86s Avatar Autor
  • Besucher
  • Besucher
3 Jahre 8 Monate her #97634 von nicola_86
I'm still try to understand how it works.
I've tried this call:
"{\"method\": \"get_participant_properties\", \"params\": {\"sSessionKey \": "+sessionKey+", \"iSurveyId \": 811861, \"iTokenId\": \"q4cxxfda68t8y2k\", \"aTokenProperties\":[\"token\",\"lastname\"]}, \"id\": 1}"

but the answer is this one:
hvdr8ur79b6kxstrtwysqt8afw6wbv9tsurvey: 811861token: q4cxxfda68t8y2kproperties: Array{"id":1,"result":{"status":"Error: Invalid tokenid"},"error":null}

The problem is that the token even in the token screen is alphanumerical.. and even if I use an integer as a token I got the same error.
Any suggestion?

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 8 Monate her #97637 von mdekker
The token might be, but the ID is numerical. It is the first column in the token screen.

---
Menno Dekker
Folgende Benutzer bedankten sich: nicola_86

Bitte Anmelden um der Konversation beizutretten.