Welcome to the LimeSurvey Community Forum

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

limit survey access based on URL parameter

  • adieball
  • adieball's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 9 months ago #169518 by adieball
Hi

we send out emails with a link to the survey from a ticket system and add the ticket id into the URL.

Can I:
  • prevent accessing a survey when there already is a submitted survey with that given ticketID
  • prevent access to the survey when the ticketID in the URL is empty

thanks
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #169519 by holch
Replied by holch on topic limit survey access based on URL parameter
You can use the token system of Limesurvey. You either create tokens and use them as ticketID or you use the ticketID as token. In any way, you need to create tokens before you can send the survey.

So if tokens are used for the survey, LS checks if the token exists (if there is no token you won't be able to participate in the survey) and if the token exists, it checks how many "uses" are left. Default is 1 use per token, but you could increase this. In your case 1 use would be the correct number and once someone accessed the survey with a specific token and completed it the uses left go down to 0, which means you can't use this token link anymore.

Now you just need to find a way to create the tokens correctly (probably the easiest way is to create the tokens based on the ticket). You might be able to do this via the LS API. But I am no expert on this.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #169533 by tpartner
Replied by tpartner on topic limit survey access based on URL parameter
You can create the tokens via the API. Here is a PHP example - www.limesurvey.org/forum/can-i-do-this-w...-fly?start=15#158184

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • adieball
  • adieball's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 9 months ago #169574 by adieball
Replied by adieball on topic limit survey access based on URL parameter
great, thank you. will check if we can get that to work.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose