API access to list of participants attributes

Plus d'informations
il y a 2 semaines 1 jour #178813 par corven
corven a créé le sujet : API access to list of participants attributes
Hello,

the following api request works fine and gives me the expected results, including the participant_info attributes firstame, lastname and email.

REQUEST:

{
"method": "list_participants",
"params": {
"sSessionKey":"XXXXXXXXXXXXX",
"iSurveyID": 123456,
"iStart": 0,
"iLimit": 500,
},
"id": 1
}

RESULTS

{"tid":"5","token":"7fogajzloiVaddT","participant_info":{"firstname":"","lastname":"","email":""}},{"tid":"6","token":"qqTlbxdZN2cJ57z","participant_info":{"firstname":"","lastname":"","email":""}},{"tid":"7","token":"7pzoeFNSYbfqqLZ","participant_info":{"firstname":"","lastname":"","email":""}},{"tid":"8","token":"ON4tey6z9d4DaIS","participant_info":{"firstname":"","lastname":"","email":""}},{"tid":"9","token":"MMhTnZ5FSo5ovoO","participant_info":{"firstname":"","lastname":"","email":""}},


I'd like to access the rest of attributes, like usesleft or completed. According to the API I should add the parameter aAttributes to my request with an array of the required attributes.

{
"method": "list_participants",
"params": {
"sSessionKey":"XXXXXXXXXXXX",
"iSurveyID": 123456,
"iStart": 0,
"iLimit": 500,
"aAttributes": ["completed", "usesleft"]
},
"id": 1
}

which gives me exactly the same results as the previous request and doesn't include the required attributes.


The user ID is the superadmin so it is not a permissions issue, I've tried changing other parameters in the request and the changes work fine, it is just the aAttributes that is not working.

Any idea of what's wrong with my request?


Using version 3.7.3


Thanks in advance!

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 semaines 1 jour #178814 par corven
corven a répondu au sujet : API access to list of participants attributes
Here is the answer to my problem. the optional parameter bUnused needs to be included for the request to work.

Am I doing something wrong or is this a bug? In case it is not a bug, this definitely needs to be included in the documentation. I've been struggling with this issue for hours.

{
"method": "list_participants",
"params": {
"sSessionKey":"XXXXXXXXXXXX",
"iSurveyID": 123456,
"iStart": 0,
"iLimit": 500,
"bUnused": false,
"aAttributes": ["completed", "usesleft"]
},
"id": 1
}


RESULTS

{"tid":"5","token":"7fogajzloiVaddT","participant_info":{"firstname":"","lastname":"","email":""},"completed":"N","usesleft":"1"},{"tid":"6","token":"qqTlbxdZN2cJ57z","participant_info":{"firstname":"","lastname":"","email":""},"completed":"N","usesleft":"1"},{"tid":"7","token":"7pzoeFNSYbfqqLZ","participant_info":{"firstname":"","lastname":"","email":""},"completed":"N","usesleft":"1"},{"tid":"8","token":"ON4tey6z9d4DaIS","participant_info":{"firstname":"","lastname":"","email":""},"completed":"N","usesleft":"1"},{"tid":"9","token":"MMhTnZ5FSo5ovoO","participant_info":{"firstname":"","lastname":"","email":""},"completed":"N","usesleft":"1"},
Les utilisateur(s) suivant ont remercié: DenisChenu

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 semaines 21 heures - il y a 2 semaines 20 heures #178815 par DenisChenu
DenisChenu a répondu au sujet : API access to list of participants attributes

corven écrit: Am I doing something wrong or is this a bug? In case it is not a bug, this definitely needs to be included in the documentation. I've been struggling with this issue for hours.

Json request are done with ordered parameters, not named parameters : this can be improved , but it's a new feature then … not really a bug. And if a merge request is done : it must be without broking usage of ordered parameters.

Maybe this need to be better documented: i add it quickly here : manual.limesurvey.org/RemoteControl_2_API#Other_functions , if you can improve it :)

api.limesurvey.org/classes/remotecontrol...od_list_participants

It's my point of view :)

PS : updated again manul : usage of JSON RPC version 1 : then always «params - An Array of objects to pass as arguments to the method. »

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Dernière édition: il y a 2 semaines 20 heures par DenisChenu.
Les utilisateur(s) suivant ont remercié: corven

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 semaines 17 heures #178828 par corven
corven a répondu au sujet : API access to list of participants attributes
Thanks for the clarification Denis,

I think the documentation should also mention that all the preceding parameters need to be included even if they are not relevant.

Something like:
https://manual.limesurvey.org/RemoteControl_2_API#Other_functions
Parameter structure use array of values, you must send the values in the API expected order (see jsonrpc specification), and all preceding parameters must be included in the request.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 semaines 16 heures #178832 par tpartner
tpartner a répondu au sujet : API access to list of participants attributes
The documentation is a wiki. Update it as you see fit.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 semaines 16 heures #178835 par DenisChenu
DenisChenu a répondu au sujet : API access to list of participants attributes

corven écrit: Thanks for the clarification Denis,

I think the documentation should also mention that all the preceding parameters need to be included even if they are not relevant.

It's what order mean …

1st param at 1st, 2nd param at 2nd then if you need only 2nd you must set 1st (to null for example)

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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 semaines 14 heures #178843 par corven
corven a répondu au sujet : API access to list of participants attributes
Order doesn't mean you need to include the optional parameters, it just implies the included parameters need to be in the same position in relation to each other.

I won't edit it if you feel it is clear enough as it is.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 semaine 6 jours #178860 par DenisChenu
DenisChenu a répondu au sujet : API access to list of participants attributes

corven écrit: Order doesn't mean you need to include the optional parameters, it just implies the included parameters need to be in the same position in relation to each other.

Yes, but if you need the 5th parameters, and the 4th is optionnal : this mean you must include 4th parameter, no ?


If it's unclear : please : you can some more detailed sentence after the alerts :)

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

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!