Hi there,
I'm also working on a Java application to use the Json-RPC...
To
jj8931 : You cannot send you invitation NOT because your participant is not in your central participant list BUT BECAUSE you're lacking the "emailstatus":"OK" in your add_participant participantData...
Also if you want a per participant personalized Survey access token think:
- in your "params" to set "createTokenKey":"0" (false or "false" instead of "0" is not recognized
!) to avoid creation of an automatic token and
- in your "participantData" to add the personalized "token":"YOURPERSONALTOKEN"
Here one of my demands that works:
EntityCorps : {"method":"add_participants","params":{"sessionkey":"YOURSESSIONKEY","surveyID":"YOURSURVEYID","participantData":[{"lastname":"testNomClient","email":"testmail@gmail.com",
"emailstatus":"OK",
"token":"YOURPERSONALTOKEN"}],
"createTokenKey":"0"},"id":1}
Answer : {"id":1,"result":[{"sent":"N","remindersent":"N","remindercount":0,"completed":"N","usesleft":1,"lastname":"testNomClient","email":"testmail@gmail.com","emailstatus":"OK","token":"testNomClient1testId","tid":"26","participant_id":null,"firstname":null,"language":null,"blacklisted":null,"validfrom":null,"validuntil":null,"mpid":null,"attribute_1":null}],"error":null}
So I got a "ready to send email" participant but with no "language" in the participant list
.
I tried to add the absent "language":"Français" ... which ends because of the "ç" with an {"id":null,"result":null,"error":"unable to decode malformed json"}. Probably I must set somewhere an UTF-8 encoding but where ?
Also, I never succeeded in adding anything in the language field of the participant list even trying "language":"Francais", "language":"Anglais", "language":"English" or "language":"english"
If anybody got an idea, I take...
The demand : {"method":"invite_participants","params":{"sSessionKey":"YOURSESSIONKEY","iSurveyID":"YOURSURVEYID"},"id":1}
results in answer : {"id":1,"result":{"26":{"name":" testNomClient","email":"testmail@gmail.com","status":"OK"},"status":"0 left to send"},"error":null}
and email sending succeeds even with the empty language field...
Hope this helps.