remotecontrol_handle

package

Default

Methods

Constructor, stores the action instance into this handle class

__construct(\AdminController $controller)
access

public

Arguments

$controller

\AdminController

Check the email, if it's in a valid format

_checkEmailFormat( $sEmail): boolean

Arguments

$sEmail

Response

boolean

Check if the session key is valid. If yes returns true, otherwise false and sends an error message with error code 1

_checkSessionKey(string $sSessionKey): boolean
access

protected

Arguments

$sSessionKey

string

Auth credentials

Response

boolean

Login with username and password

_doLogin(string $sUsername,string $sPassword,string $sPlugin): boolean|string
access

protected

Arguments

$sUsername

string

username

$sPassword

string

password

$sPlugin

string

plugin to be used

Response

boolean|string

Fills the session with necessary user info on the fly

_jumpStartSession(string $username): boolean
access

protected

Arguments

$username

string

The username

Response

boolean

Activate survey (RPC function)

activate_survey(string $sSessionKey,integer $iSurveyID): array

Return the result of the activation Failure status : Invalid Survey ID, Survey already active, Consistency check error, Activation Error, Invalid session key, No permission

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey to be activated

Response

array

in case of success result of the activation

Activate survey participants (RPC function)

activate_tokens(string $sSessionKey,integer $iSurveyID,array $aAttributeFields = array()): array

Initialise the survey participant table of a survey where new participant tokens may be later added.

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey where a survey participants table will be created for

$aAttributeFields

array

An array of integer describing any additional attribute fields

Response

array

Status=>OK when successful, otherwise the error description

Add empty group with minimum details (RPC function)

add_group(string $sSessionKey,integer $iSurveyID,string $sGroupTitle,string $sGroupDescription = ''): array|integer

Used as a placeholder for importing questions. Returns the groupid of the created group.

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey to add the group

$sGroupTitle

string

Name of the group

$sGroupDescription

string

Optional description of the group

Response

array|integer

The id of the new group - Or status

Add a survey language (RPC function)

add_language(string $sSessionKey,integer $iSurveyID,string $sLanguage): array
access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey for which a survey participants table will be created

$sLanguage

string

A valid language shortcut to add to the current Survey. If the language already exists no error will be given.

Response

array

Status=>OK when successful, otherwise the error description

Add participants to the survey.

add_participants(string $sSessionKey,integer $iSurveyID,array $aParticipantData,boolean $bCreateToken = true): array

The parameters $aParticipantData is a 2 dimensionnal array containing needed participant data.

see \Token

for all available attribute,

example

[ {"email":"me@example.com","lastname":"Bond","firstname":"James"},{"email":"me2@example.com","attribute_1":"example"} ]

Returns the inserted data including additional new information like the Token entry ID and the token string. In case of errors in some data, return it in errors.

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey

$aParticipantData

array

Data of the participants to be added

$bCreateToken

boolean

Optional - Defaults to true and determins if the access token automatically created

Response

array

The values added

Add a response to the survey responses collection.

add_response(string $sSessionKey,integer $iSurveyID,array $aResponseData): integer|array

Returns the id of the inserted survey response

access

public

todo

Need to clean up return array, especially the case when response was added but file not uploaded.

See discussion: https://bugs.limesurvey.org/view.php?id=13794

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey to insert responses

$aResponseData

array

The actual response

Response

integer|array

The response ID or an array with status message (can include result_id)

Add an empty survey with minimum details

add_survey(string $sSessionKey,integer $iSurveyID,string $sSurveyTitle,string $sSurveyLanguage,string $sformat = 'G'): integer|array

This just tries to create an empty survey with the minimal settings.

Failure status: Invalid session key, No permission, Faulty parameters, Creation Failed result

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

The desired ID of the Survey to add

$sSurveyTitle

string

Title of the new Survey

$sSurveyLanguage

string

Default language of the Survey

$sformat

string

(optional) Question appearance format (A, G or S) for "All on one page", "Group by Group", "Single questions", default to group by group (G)

Response

integer|array

The survey id in case of success

Copy survey (RPC function)

copy_survey(string $sSessionKey,integer $iSurveyID_org,string $sNewname): array
access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID_org

integer

Id of the source survey

$sNewname

string

name of the new survey

Response

array

On success: new $iSurveyID in array['newsid']. On failure array with error information

Import a participant into the LimeSurvey CPDB

cpd_importParticipants(integer $sSessionKey, $participants,boolean $update = false): array

It stores attributes as well, if they are registered before within ui

Call the function with $response = $myJSONRPCClient->cpd_importParticipants( $sessionKey, $aParticipants);

Arguments

$sSessionKey

integer

$participants

$update

boolean

Response

array

with status

Delete a group from a chosen survey (RPC function)

delete_group(string $sSessionKey,integer $iSurveyID,integer $iGroupID): array|integer

Returns the id of the deleted group.

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey that the group belongs

$iGroupID

integer

ID of the group to delete

Response

array|integer

The ID of the deleted group or status

Delete a language from a survey (RPC function)

delete_language(string $sSessionKey,integer $iSurveyID,string $sLanguage): array
access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey for which a survey participants table will be created

$sLanguage

string

A valid language shortcut to delete from the current Survey. If the language does not exist in that Survey no error will be given.

Response

array

Status=>OK when successful, otherwise the error description

Delete multiple participants from the survey participants table (RPC function)

delete_participants(string $sSessionKey,integer $iSurveyID,array $aTokenIDs): array

Returns the id of the deleted token

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey that the participants belong to

$aTokenIDs

array

ID of the tokens/participants to delete

Response

array

Result of deletion

Delete question from a survey (RPC function)

delete_question(string $sSessionKey,integer $iQuestionID): array|integer

Returns the id of the deleted question.

access

public

Arguments

$sSessionKey

string

Auth credentials

$iQuestionID

integer

ID of the Question to delete

Response

array|integer

ID of the deleted Question or status

Delete a survey.

delete_survey(string $sSessionKey,integer $iSurveyID): array

Failure status: Invalid session key, No permission

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

The ID of the Survey to be deleted

Response

array

Returns status : status are OK in case of success

Export responses in base64 encoded string

export_responses(string $sSessionKey,integer $iSurveyID,string $sDocumentType,string $sLanguageCode = null,string $sCompletionStatus = 'all',string $sHeadingType = 'code',string $sResponseType = 'short',integer $iFromResponseID = null,integer $iToResponseID = null,array $aFields = null): array|string
access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey

$sDocumentType

string

any format available by plugins (for example : pdf, csv, xls, doc, json)

$sLanguageCode

string

(optional) The language to be used

$sCompletionStatus

string

(optional) 'complete','incomplete' or 'all' - defaults to 'all'

$sHeadingType

string

(optional) 'code','full' or 'abbreviated' Optional defaults to 'code'

$sResponseType

string

(optional)'short' or 'long' Optional defaults to 'short'

$iFromResponseID

integer

(optional)

$iToResponseID

integer

(optional)

$aFields

array

(optional) Selected fields

Response

array|string

On success: Requested file as base 64-encoded string. On failure array with error information

Export token response in a survey.

export_responses_by_token(string $sSessionKey,integer $iSurveyID,string $sDocumentType,string $sToken,string $sLanguageCode = null,string $sCompletionStatus = 'all',string $sHeadingType = 'code',string $sResponseType = 'short',array $aFields = null): array|string

Returns the requested file as base64 encoded string

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey

$sDocumentType

string

pdf, csv, xls, doc, json

$sToken

string

The token for which responses needed

$sLanguageCode

string

The language to be used

$sCompletionStatus

string

Optional 'complete','incomplete' or 'all' - defaults to 'all'

$sHeadingType

string

'code','full' or 'abbreviated' Optional defaults to 'code'

$sResponseType

string

'short' or 'long' Optional defaults to 'short'

$aFields

array

Optional Selected fields

Response

array|string

On success: Requested file as base 64-encoded string. On failure array with error information

Export survey statistics (RPC function)

export_statistics(string $sSessionKey,integer $iSurveyID,string $docType = 'pdf',string $sLanguage = null,string $graph = '0',integer|array $groupIDs = null): string|array

Allow to export statistics available Returns string - base64 encoding of the statistics.

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey

$docType

string

(optional) Type of documents the exported statistics should be (pdf|xls|html)

$sLanguage

string

(optional) language of the survey to use (default from Survey)

$graph

string

(optional) Create graph option (default : no)

$groupIDs

integer|array

(optional) array or integer containing the groups we choose to generate statistics from

Response

string|array

in case of success : Base64 encoded string with the statistics file

Export submission timeline (RPC function)

export_timeline(string $sSessionKey,integer $iSurveyID,string $sType,string $dStart,string $dEnd): array

Returns an array of values (count and period)

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey

$sType

string

(day|hour)

$dStart

string

$dEnd

string

Response

array

On success: The timeline. On failure array with error information

Get the properties of a group of a survey .

get_group_properties(string $sSessionKey,integer $iGroupID,array $aGroupSettings = null,string $sLanguage = null): array

Returns array of properties needed or all properties

see \QuestionGroup

for available properties

access

public

Arguments

$sSessionKey

string

Auth credentials

$iGroupID

integer

Id of the group to get properties of

$aGroupSettings

array

The properties to get

$sLanguage

string

Optional parameter language for multilingual groups

Response

array

in case of success the requested values in array

Get survey language properties (RPC function)

get_language_properties(string $sSessionKey,integer $iSurveyID,array|null $aSurveyLocaleSettings = null,string|null $sLang = null): array
see \SurveyLanguageSetting

for available properties

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey

$aSurveyLocaleSettings

array|null

(optional) Properties to get, default to all attributes

$sLang

string|null

(optional) Language to use, default to Survey->language

Response

array

in case of success The requested values

Get settings of a survey participant (RPC function)

get_participant_properties(string $sSessionKey,integer $iSurveyID,array|integer $aTokenQueryProperties,array $aTokenProperties = null): array

Allow to request for a specific participant. If more than one participant is returned with specified attribute(s) an error is returned.

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey to get token properties

$aTokenQueryProperties

array|integer

of participant properties used to query the participant, or the token id as an integer

$aTokenProperties

array

The properties to get

Response

array

The requested values

Get properties of a question in a survey.

get_question_properties(string $sSessionKey,integer $iQuestionID,array $aQuestionSettings = null,string $sLanguage = null): array
see \Question

for available properties. Some more properties are available_answers, subquestions, attributes, attributes_lang, answeroptions, answeroptions_multiscale, defaultvalue

access

public

Arguments

$sSessionKey

string

Auth credentials

$iQuestionID

integer

ID of the question to get properties

$aQuestionSettings

array

(optional) properties to get, default to all

$sLanguage

string

(optional) parameter language for multilingual questions, default are \Survey->language

Response

array

The requested values

Find response IDs given a survey ID and a token (RPC function)

get_response_ids(string $sSessionKey,integer $iSurveyID,string $sToken): array

Arguments

$sSessionKey

string

$iSurveyID

integer

$sToken

string

Response

array

Create and return a session key.

get_session_key(string $username,string $password,string $plugin = 'Authdb'): string|array

Using this function you can create a new XML-RPC/JSON-RPC session key. This is mandatory for all following LSRC2 function calls.

  • In case of success : Return the session key in string
  • In case of error:
    • for protocol-level errors (invalid format etc), an error message.
    • For invalid username and password, returns a null error and the result body contains a 'status' name-value pair with the error message.
access

public

Arguments

$username

string

$password

string

$plugin

string

to be used

Response

string|array

Get a global setting

get_site_settings(string $sSessionKey,string $sSetttingName): string|array

Function to query site settings. Can only be used by super administrators.

access

public

Arguments

$sSessionKey

string

Auth Credentials

$sSetttingName

string

Name of the setting to get

Response

string|array

The requested value or an array with the error in case of error

Get survey summary, regarding token usage and survey participation (RPC function)

get_summary(string $sSessionKey,integer $iSurveyID,string $sStatName = 'all'): string|array

Returns the requested value as string, or all status in an array

Available status are

  • For Survey stats
    • completed_responses
    • incomplete_responses
    • full_responses
  • For token part
    • token_count
    • token_invalid
    • token_sent
    • token_opted_out
    • token_completed
    • token_screenout All available status can be sent using all

Failure status : No available data, No such property, Invalid session key, No permission

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey to get summary

$sStatName

string

(optional) Name of the summary option, or all to send all in an array (all by default)

Response

string|array

in case of success the requested value or an array of all values

Get survey properties (RPC function)

get_survey_properties(string $sSessionKey,integer $iSurveyID,array|null $aSurveySettings = null): array

Get properties of a survey All internal properties of a survey are available.

see \Survey

for the list of available properties

Failure status : Invalid survey ID, Invalid session key, No permission, No valid Data

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

The id of the Survey to be checked

$aSurveySettings

array|null

(optional) The properties to get

Response

array

Obtain all uploaded files for all responses

get_uploaded_files(string $sSessionKey,integer $iSurveyID,string $sToken): array
access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey

$sToken

string

Response token

Response

array

On success: array containing all uploads of the specified response On failure: array with error information

Import a group and add to a survey (RPC function)

import_group(string $sSessionKey,integer $iSurveyID,string $sImportData,string $sImportDataType,string $sNewGroupName = null,string $sNewGroupDescription = null): array|integer
access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

The ID of the Survey that the group will belong

$sImportData

string

String containing the BASE 64 encoded data of a lsg,csv

$sImportDataType

string

lsg,csv

$sNewGroupName

string

Optional new name for the group

$sNewGroupDescription

string

Optional new description for the group

Response

array|integer

iGroupID - ID of the new group or status

Import question (RPC function)

import_question(string $sSessionKey,integer $iSurveyID,integer $iGroupID,string $sImportData,string $sImportDataType,string $sMandatory = 'N',string $sNewQuestionTitle = null,string $sNewqQuestion = null,string $sNewQuestionHelp = null): array|integer

Import a question from lsq file

access

public

Arguments

$sSessionKey

string

$iSurveyID

integer

The ID of the Survey that the question will belong to

$iGroupID

integer

The ID of the Group that the question will belong to

$sImportData

string

String containing the BASE 64 encoded data of a lsq

$sImportDataType

string

lsq

$sMandatory

string

(optional) Mandatory question option (default to No)

$sNewQuestionTitle

string

(optional) new title for the question

$sNewqQuestion

string

(optional) new question text

$sNewQuestionHelp

string

(optional) new question help text

Response

array|integer

The id of the new question in case of success. Array if errors

Import survey in a known format (RPC function)

import_survey(string $sSessionKey,string $sImportData,string $sImportDataType,string $sNewSurveyName = null,integer $DestSurveyID = null): integer|array

Allow importing lss, csv, xls or survey zip archive in BASE 64 encoded.

Failure status: Invalid session key, No permission, The import error

access

public

Arguments

$sSessionKey

string

Auth Credentials

$sImportData

string

String containing the BASE 64 encoded data of a lss, csv, txt or survey lsa archive

$sImportDataType

string

lss, csv, txt or lsa

$sNewSurveyName

string

(optional) The optional new name of the survey

$DestSurveyID

integer

(optional) This is the new ID of the survey - if already used a random one will be taken instead

Response

integer|array

The ID of the new survey in case of success

Invite participants in a survey (RPC function)

invite_participants(string $sSessionKey,integer $iSurveyID,array $aTokenIds = null,boolean $bEmail = true): array

Returns array of results of sending

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the survey that participants belong

$aTokenIds

array

Ids of the participant to invite

$bEmail

boolean

Send only pending invites (TRUE) or resend invites only (FALSE)

Response

array

Result of the action

Get survey groups (RPC function)

list_groups(string $sSessionKey,integer $iSurveyID,string $sLanguage = null): array

Returns the ids and all attributes of all survey groups

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey containing the groups

$sLanguage

string

Optional parameter language for multilingual groups

Response

array

in case of success the list of groups

Return the IDs and properties of survey participants (RPC function)

list_participants(string $sSessionKey,integer $iSurveyID,integer $iStart,integer $iLimit = 10,boolean $bUnused = false,boolean|array $aAttributes = false,array $aConditions = array()): array

If $bUnused is true, user will get the list of uncompleted tokens (token_return functionality). Parameters iStart and iLimit are used to limit the number of results of this call. Starting with version 4.3.0 it is not possible anymore to query for several IDs just using an array of values - instead you have use the 'IN' operator. Examples of conditions: array ('tid => 'IN','1','3','26') array('email' => 'info@example.com') array('validuntil' => array('>', '2019-01-01 00:00:00'))

By default return each participant with basic information

  • tid : the token id
  • token : the token for this participant
  • participant_info : an array with firstname, lastname and email Parameter $aAttributes can be used to add more attribute in participant_info array
access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey to list participants

$iStart

integer

Start id of the token list

$iLimit

integer

Number of participants to return

$bUnused

boolean

If you want unused tokens, set true

$aAttributes

boolean|array

The extented attributes that we want

$aConditions

array

Optional conditions to limit the list, either as a key=>value array for simple comparisons or as key=>array(operator,value[,value[...]]) using an operator. Valid operators are ['<', '>', '>=', '<=', '=', '<>', 'LIKE', 'IN'] Only the IN operator allows for several values. The same key can be used several times. All conditions are connected by AND.

Response

array

The list of tokens

Return the ids and info of (sub-)questions of a survey/group (RPC function)

list_questions(string $sSessionKey,integer $iSurveyID,integer $iGroupID = null,string $sLanguage = null): array

Returns array of ids and info.

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey to list questions

$iGroupID

integer

Optional id of the group to list questions

$sLanguage

string

Optional parameter language for multilingual questions

Response

array

The list of questions

List the survey groups belonging to a user

list_survey_groups(string $sSessionKey,string|null $sUsername = null): array

If user is admin he can get survey groups of every user (parameter sUser) or all survey groups (sUser=null) Else only the survey groups belonging to the user requesting will be shown.

Returns array with survey group attributes

access

public

Arguments

$sSessionKey

string

Auth credentials

$sUsername

string|null

(optional) username to get list of survey groups

Response

array

In case of success the list of survey groups

List the survey belonging to a user (RPC function)

list_surveys(string $sSessionKey,string|null $sUsername = null): array

If user is admin he can get surveys of every user (parameter sUser) or all surveys (sUser=null) Else only the surveys belonging to the user requesting will be shown.

Returns array with

  • sid the ids of survey
  • surveyls_title the title of the survey
  • startdate start date
  • expires expiration date
  • active if survey is active (Y) or not (!Y)
access

public

Arguments

$sSessionKey

string

Auth credentials

$sUsername

string|null

(optional) username to get list of surveys

Response

array

In case of success the list of surveys

Get list the ids and info of administration user(s) (RPC function)

list_users(string $sSessionKey = null,integer $uid = null,string $username = null): array

Returns array of ids and info.

Failure status : Invalid user id, Invalid username, No users found, Invalid session key, Permission denied (super admin is required)

Arguments

$sSessionKey

string

Auth credentials

$uid

integer

Optional; ID of the user

$username

string

Optional; name of the user

Response

array

The list of users in case of success

Send e-mails to registered participants in a survey (RPC function)

mail_registered_participants(string $sSessionKey,integer $iSurveyID,array $overrideAllConditions = array()): array

Returns array of results of sending

Default behaviour is to send register emails to not invited, not reminded, not completed and in valid frame date participant.

$overrideAllConditions replaces this default conditions for selecting the participants. A typical use case is to select only one participant

$overrideAllConditions = Array();
$overrideAllConditions[] = 'tid = 2';
$response = $myJSONRPCClient->mail_registered_participants( $sessionKey, $survey_id, $overrideAllConditions );
access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey that participants belong

$overrideAllConditions

array

replace the default conditions

Response

array

Result of the action

Close the RPC session

release_session_key(string $sSessionKey): string

Using this function you can close a previously opened XML-RPC/JSON-RPC session.

access

public

Arguments

$sSessionKey

string

the session key

Response

string

OK

Send a reminder to participants in a survey (RPC function)

remind_participants(string $sSessionKey,integer $iSurveyID,integer $iMinDaysBetween = null,integer $iMaxReminders = null,array $aTokenIds = false): array

Returns array of results of sending

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey that participants belong

$iMinDaysBetween

integer

(optional) parameter days from last reminder

$iMaxReminders

integer

(optional) parameter Maximum reminders count

$aTokenIds

array

Ids of the participant to remind (optional filter)

Response

array

in case of success array of result of each email send action and count of invitations left to send in status key

Set group properties (RPC function)

set_group_properties(string $sSessionKey,integer $iGroupID,array $aGroupData): array
see \QuestionGroup

for available properties and restriction

Some attribute can not be set

  • sid
  • gid
access

public

Arguments

$sSessionKey

string

Auth credentials

$iGroupID

integer

  • ID of the Group

$aGroupData

array

  • An array with the particular fieldnames as keys and their values to set on that particular survey

Response

array

Of succeeded and failed modifications according to internal validation.

Set survey language properties (RPC function)

set_language_properties(string $sSessionKey,integer $iSurveyID,array $aSurveyLocaleData,string $sLanguage = null): array
see \SurveyLanguageSetting

for available properties.

Some properties can not be set

  • surveyls_language
  • surveyls_survey_id
access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

  • ID of the Survey

$aSurveyLocaleData

array

  • An array with the particular fieldnames as keys and their values to set on that particular survey

$sLanguage

string

  • Optional - Language to update - if not given the base language of the particular survey is used

Response

array

in case of success 'status'=>'OK', when save successful otherwise error text.

Set properties of a survey participant (RPC function)

set_participant_properties(string $sSessionKey,integer $iSurveyID,array|integer $aTokenQueryProperties,array $aTokenData): array

Allow to set properties about a specific participant, only one particpant can be updated.

see \Token

for available properties

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

Id of the Survey that participants belong

$aTokenQueryProperties

array|integer

of participant properties used to query the participant, or the token id as an integer

$aTokenData

array

Data to change

Response

array

Result of the change action

Set question properties.

set_question_properties(string $sSessionKey,integer $iQuestionID,array $aQuestionData,string $sLanguage = null): array
see \Question

for available properties.

Restricted properties:

  • qid
  • gid
  • sid
  • parent_qid
  • language
  • type
  • question_order in some condition (with dependecies)
access

public

Arguments

$sSessionKey

string

Auth credentials

$iQuestionID

integer

  • ID of the question

$aQuestionData

array

  • An array with the particular fieldnames as keys and their values to set on that particular question

$sLanguage

string

Optional parameter language for multilingual questions

Response

array

Of succeeded and failed modifications according to internal validation.

Set quota attributes (RPC function)

set_quota_properties(string $sSessionKey,integer $iQuotaId,array $aQuotaData): array

Retuns an array containing the boolean 'success' and 'message' with either errors or Quota attributes (on success)

access

public

Arguments

$sSessionKey

string

Auth credentials

$iQuotaId

integer

Quota ID

$aQuotaData

array

Quota attributes as array eg ['active'=>1,'limit'=>100]

Response

array

['success'=>bool, 'message'=>string]

Set survey properties (RPC function)

set_survey_properties(string $sSessionKey,integer $iSurveyID,array $aSurveyData): array
see \Survey

for the list of available properties Properties available are restricted

  • Always
    • sid
    • active
    • language
    • additional_languages
  • If survey is active
    • anonymized
    • datestamp
    • savetimings
    • ipaddr
    • refurl

In case of partial success : return an array with key as properties and value as boolean , true if saved with success.

Failure status : Invalid survey ID, Invalid session key, No permission, No valid Data

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

  • ID of the Survey

$aSurveyData

array

  • An array with the particular fieldnames as keys and their values to set on that particular Survey

Response

array

Of succeeded and failed nodifications according to internal validation

Update a response in a given survey.

update_response(string $sSessionKey,integer $iSurveyID,array $aResponseData): string|boolean

Routine supports only single response updates. Response to update will be identified either by the response id, or the token if response id is missing. Routine is only applicable for active surveys with alloweditaftercompletion = Y.

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

Id of the Survey to update response

$aResponseData

array

The actual response

Response

string|boolean

TRUE(bool) on success. errormessage on error

Uploads one file to be used later.

upload_file(string $sSessionKey,integer $iSurveyID,string $sFieldName,string $sFileName,string $sFileContent): array

Returns the metadata on success.

access

public

Arguments

$sSessionKey

string

Auth credentials

$iSurveyID

integer

ID of the Survey to insert file

$sFieldName

string

the Field to upload file

$sFileName

string

the uploaded file name

$sFileContent

string

the uploaded file content encoded as BASE64

Response

array

The file metadata with final upload path or error description

Properties

controller

controller :\AdminController
var

Type(s)

\AdminController