Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Adding tokens programmatically

Adding tokens programmatically 5 years 3 months ago #59757

  • jonoF
  • jonoF's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
I'm working on an existing application that manages and tracks support issues for our clients. I'm looking to ask users to complete a survey after their issue is resolved.

The LimeSurvey token option looks like the kind of feature I need - users can only complete the survey once, and only on invitation. However, is it possible to add tokens automatically, i.e. via a call from the existing application? Manually adding user tokens after each issue is not really practical for the volumes we deal with.
The administrator has disabled public write access.

Adding tokens programmatically 5 years 3 months ago #59809

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9290
  • Thank you received: 1325
  • Karma: 384
You can create token on the fly with an external PHP script, this script redirect after to the good survey with the good token (and information from your system).

Some php dev but not so hard.
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
The following user(s) said Thank You: tcb

Adding tokens programmatically 4 years 11 months ago #64741

  • tcb
  • tcb's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
This is useful to know but can you tell us a bit more?

Is there any documentation on this?

Can you give us a snippet of PHP that would programatically add a new user to a minimal token table?

Thanks
The administrator has disabled public write access.

Adding tokens programmatically 4 years 10 months ago #65282

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9290
  • Thank you received: 1325
  • Karma: 384
Hello,

Maybe you can have a look to remote control source code :).
docs.limesurvey.org/RemoteControl

I'm not sure it actually work, but you find some interestiong code.

But :
1st : your tracker create a line in the LS token base ( sql insert).
2nd : you redirect the user to the link with the token.
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.202 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form