Adding Participants using API

More
6 months 4 weeks ago #179389 by premosystems
I am trying to add participants using the API but get a response of {"id":1,"result":{"status":"No permission"},"error":null}

I have successfully created a session key and retrieved the list of surveys. I am accessing the call using the owner of the survey who is also an admin with full access.

My JSON call is:

{"method": "add_participants","params": ["SessionKey",123456,[{"firstname": "James","lastname": "Bond","email": "james@bond.com","attribute_1": "Male","attribute_2": "042"}],true ], "id": 1}

I have tried a wide variety of changes with no joy.

What am I doing wrong or is this part of the API broken?

I am having similar issues with some other calls. Some are adding records like this one and some are getting data like token responses.

Any assistance will be greatly appreciated.

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
6 months 2 weeks ago #179751 by iosman
wow great information totally love it buddy.

Please Log in or Create an account to join the conversation.

More
6 months 2 weeks ago - 6 months 2 weeks ago #179801 by iosman1
SPAM
Last edit: 6 months 2 weeks ago by DenisChenu.

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #180059 by premosystems
OK, so I have managed to add participants using the API.

Format is

{
"method": "add_participants",
"params": {
"sSessionKey":"##############################",
"iSurveyID": 123,
"aParticipantData":
[
{
"firstname": "Stephen",
"lastname": "Jones",
"email": "This email address is being protected from spambots. You need JavaScript enabled to view it.",
"emailstatus": "OK",
"language": "en",
"token":"MG0007",
"attribute_1": "XYZ"
}
]
},
"bCreateToken": "false",
"id": 1
}

But how do I do this and SET the token for the user. I want specific tokens that relate to other information.

When I use the following in aParticipantData nothing happens and a Token is set for the user irrespective of the bCreateToken setting:

"token":"MG0007"

If I can't set as part of add_participant, can I change using set_participant_properties ?

I get a "No valid Data" status if I use this JSON:

{
"method": "set_participant_properties",
"params": {
"sSessionKey":"##########################",
"iSurveyID": 123,
"iTokenId" : 8,
"aTokenData":
[
{
"token":"MG0007"
}
]
},
"id": 1
}

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!