API access to list of participants attributes

Mehr
2 Wochen 1 Tag her #178813 von corven
corven erstellte das Thema 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!

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 1 Tag her #178814 von corven
corven antwortete auf das Thema: 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"},
Folgende Benutzer bedankten sich: DenisChenu

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 20 Stunden her - 2 Wochen 20 Stunden her #178815 von DenisChenu
DenisChenu antwortete auf das Thema: API access to list of participants attributes

corven schrieb: 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 .
Letzte Änderung: 2 Wochen 20 Stunden her von DenisChenu.
Folgende Benutzer bedankten sich: corven

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 16 Stunden her #178828 von corven
corven antwortete auf das Thema: 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.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 15 Stunden her #178832 von tpartner
tpartner antwortete auf das Thema: 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.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 15 Stunden her #178835 von DenisChenu
DenisChenu antwortete auf das Thema: API access to list of participants attributes

corven schrieb: 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 .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 13 Stunden her #178843 von corven
corven antwortete auf das Thema: 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.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Woche 6 Tage her #178860 von DenisChenu
DenisChenu antwortete auf das Thema: API access to list of participants attributes

corven schrieb: 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 .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha