Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Need help writing the params array for the "add_participants" method

  • DidierH
  • DidierH's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #207399 by DidierH
Hi!

I need some help. I want to call the method "add_participants" using an http post request.

curl --location --request POST ' limesurvey.mydomain.com/index.php/admin/remotecontrol ' --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Content-Type: text/plain' --header 'Cookie: PHPSESSID=hg4kkgne7m15du97envg834l8u'
--data-raw '{
"method": "add_participants",
"params": [
"session_key",
survey_id,
[{"email":"participant1@gmail.com","lastname":"Name1","firstname":"FirstName1"}]
],
"id": 1
}'

As the "params" element should be an array, and "$aParticipantData" should be an array too, that means I should have an array, with an array as element. How can I do that ?
I'm a bit lost...

Thanks for your help.
The topic has been locked.
  • DidierH
  • DidierH's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #207512 by DidierH
Help ! Does anyone have a solution?

DidierH wrote: Hi!

I need some help. I want to call the method "add_participants" using an http post request.

curl --location --request POST ' limesurvey.mydomain.com/index.php/admin/remotecontrol ' --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Content-Type: text/plain' --header 'Cookie: PHPSESSID=hg4kkgne7m15du97envg834l8u'
--data-raw '{
"method": "add_participants",
"params": [
"session_key",
survey_id,
[{"email":"participant1@gmail.com","lastname":"Name1","firstname":"FirstName1"}]
],
"id": 1
}'

As the "params" element should be an array, and "$aParticipantData" should be an array too, that means I should have an array, with an array as element. How can I do that ?
I'm a bit lost...

Thanks for your help.

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose