Welcome to the LimeSurvey Community Forum

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

Alta de contacto en tabla token de encuesta activa

More
7 months 4 weeks ago #246269 by KaryG
Ayúdenos a ayudarle y rellene los siguientes campos:.
Su versión de LimeSurvey:Versión 5.6.33
Servidor propio o LimeSurvey Cloud: LimeSurvey Cloud
Plantilla de diseño utilizada: Fruity
==================
Hola gente!
Tenemos un panel de contactos que administramos con un CRM propio, queremos poder tener encuestas cerradas en Limesurvey Cloud y que el CRM pueda agregar los contactos de manera automatizada, en la tabla token de la encuesta activa, a medida que los contactos vayan ingresando, sin tener que cargarlos previamente, ya que son un gran número de contactos y generalmente sólo una fracción de ellos ingresa a responder la encuesta.
Desde ya muchas gracias!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 months 3 weeks ago - 7 months 3 weeks ago #246298 by Joffm
Hola,
puedes utilizar la API de LimeSurvey.
[url] manual.limesurvey.org/RemoteControl_2_API [/url]
y
[url] api.limesurvey.org/classes/remotecontrol_handle.html [/url]
Aquí hay un pequeño ejemplo en php para agregar participantes y generar un token.
Code:
<?php
 
require_once 'jsonrpcphp/JsonRPCClient.php';
 
define( 'LS_BASEURL', 'https://www.myServer.de/limesurvey');  // adjust this one to your actual LimeSurvey URL
define( 'LS_USER', 'username' );
define( 'LS_PASSWORD', 'password' );
 
$myJSONRPCClient = new \org\jsonrpcphp\JsonRPCClient( LS_BASEURL.'/index.php/admin/remotecontrol' );
 
// receive session key
$sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );
 
if(is_array($sessionKey))
{
    header("Content-type: application/json");
    echo json_encode($sessionKey);
    die();
}
 
// Here I use GET parameters
$survey_id = $_GET['SID'];
$firstName = $_GET['NOMBRE'];
$lastName  = $_GET['APELLIDO'];
$email     = $_GET['EMAIL'];
 
$atokenParams = array("email"=>$email,"lastname"=>$lastName,"firstname"=>$firstName,"token"=>$token,"emailstatus"=>"OK");
$aParticipantData=array($atokenParams);
$bCreateToken = true;
 
// Create the token in survey
$newToken = $myJSONRPCClient->add_participants( $sessionKey, $survey_id, $aParticipantData, $bCreateToken);
 
// If token successfully created, redirect to survey
if(isset($newToken[0]['tid']) AND isset($newToken[0]['token'])) {
    $link='www.myServer.de/limesurvey/index.php/'.$survey_id.'?token='.$newtoken[0]['token'];
    // Here you may send the link to the participant
}
 
// Otherwise, display errors
else if (isset($newToken['status'])) {
    echo $newToken['status'];
}
else {
    echo '<br />';
    echo 'Error: '.$newToken[0]['errors']['token'][0];
}
 
// release the session key
$myJSONRPCClient->release_session_key( $sessionKey );
?>


El CRM debe iniciar este script con cada nuevo contacto.
Debe transferir los datos necesarios (nombre, apellido, correo electrónico).

El script agrega el participante, genera el token y luego también puede invitar el participante. (por ejemplo, con phpMailer)

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 7 months 3 weeks ago by Joffm.
The following user(s) said Thank You: KaryG

Please Log in to join the conversation.

More
7 months 3 weeks ago #246313 by FabrizioVazquez
Replied by FabrizioVazquez on topic Alta de contacto en tabla token de encuesta activa
Muchas gracias por esta respuesta.
Y una consulta, una vez que ya se agregó al panelista con su mail qué le debe agregar el CRM al link de la encuesta(si es que se hace de esta manera) para que cuando vuelva a ingresar el panelista a la encuesta la retome desde la última pregunta respondida la vez anterior que accedió ?

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 months 3 weeks ago #246314 by Joffm

qué le debe agregar el CRM al link de la encuesta

Nada; esto está configurado en LimeSurvey.
"Persistencia de las repuestas"

Lee el manual:
[url] manual.limesurvey.org/Participant_settin...response_persistence [/url]

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose