Activate Tokens Remote Control - Additional Attributes

More
3 weeks 4 days ago #178714 by bmdavis
bmdavis created the topic: Activate Tokens Remote Control - Additional Attributes
Hello,

I'm looking for a little more specificity or an example for the RPC activate_tokens command, specifically regarding additional attributes.

The reference mentions:
array $aAttributeFields  An array of integer describing any additional attribute fields

Can someone please provide an example using the attributefields array?

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

More
1 week 5 days ago #178900 by bmdavis
bmdavis replied the topic: Activate Tokens Remote Control - Additional Attributes
Anyone have an example for the format of RPC activate_tokens command - attributefields array?

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

More
1 week 4 days ago - 1 week 4 days ago #178902 by tpartner
tpartner replied the topic: Activate Tokens Remote Control - Additional Attributes
Here is a simple PHP example:

<?php
 
	define( 'LS_BASEURL', 'http://path/to/limesurvey/');
	define( 'LS_USER', 'admin' );
	define( 'LS_PASSWORD', 'password' );
 
	require_once '../../../../../application/libraries/jsonRPCClient.php';
 
	$iSurveyID = 123456;
 
 
	// Instantiate a new RPC client
	$myJSONRPCClient = new jsonRPCClient( LS_BASEURL.'/index.php/admin/remotecontrol' );
 
	// Get a session key
	$sSessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );
 
	// Define attributes
	$aAttributeFields = array(1, 2, 3);
 
	// Activate the tokens
	$tokenActivation = $myJSONRPCClient->activate_tokens($sSessionKey, $iSurveyID, $aAttributeFields);
 
	// The returned result
	if($tokenActivation['status'] == 'OK') {
		echo 'Tokens created for survey '.$iSurveyID.'.';
	}
	else {
		echo 'Tokens NOT created for survey '.$iSurveyID.': '.$tokenActivation['status'];
	}
 
	// Release the session key
	$myJSONRPCClient->release_session_key( $sSessionKey );
?>


Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 1 week 4 days ago by tpartner.
The following user(s) said Thank You: DenisChenu, bmdavis

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

More
1 week 2 days ago #178970 by bmdavis
bmdavis replied the topic: Activate Tokens Remote Control - Additional Attributes
Thanks Tony! That definitely worked. Any chance we can also pass in a "Field Description" through the API?

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

More
1 week 20 hours ago #179028 by tpartner
tpartner replied the topic: Activate Tokens Remote Control - Additional Attributes
As far as I know, that is not currently possible.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu

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

More
6 days 23 hours ago #179084 by bmdavis
bmdavis replied the topic: Activate Tokens Remote Control - Additional Attributes
Thanks again tpartner.

How can I make a feature request to notify the developers that this would be desirable feature to add?

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

More
6 days 23 hours ago #179085 by bmdavis
bmdavis replied the topic: Activate Tokens Remote Control - Additional Attributes
Nevermind... it's right here:

www.limesurvey.org/community/feature-requests

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

More
6 days 16 hours ago #179106 by DenisChenu
DenisChenu replied the topic: Activate Tokens Remote Control - Additional Attributes
You can create your oanw function in remote control,

See : gitlab.com/SondagesPro/RemoteControl/extendRemoteControl for a Demo.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

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!