suso_get_assignments: Survey Solutions API call for assignment list

View source: R/suso_api_assignment.R

suso_get_assignmentsR Documentation

Survey Solutions API call for assignment list

Description

suso_get_assignments calls the Survey Solutions assingment API

Usage

suso_get_assignments(
  questID = NULL,
  server = suso_get_api_key("susoServer"),
  apiUser = suso_get_api_key("susoUser"),
  apiPass = suso_get_api_key("susoPass"),
  token = NULL,
  workspace = NULL,
  AssId = NULL,
  version = NULL,
  responsibleID = NULL,
  order.by = "",
  operations.type = c("assignmentQuantitySettings", "history", "recordAudio")
)

Arguments

questID

only assignments for QuestionnaireId are returned, requires version being not NULL

server

Survey Solutions server address

apiUser

Survey Solutions API user

apiPass

Survey Solutions API password

token

If Survey Solutions server token is provided apiUser and apiPass will be ignored

workspace

If workspace name is provide requests are made regarding this specific workspace

AssId

if NULL a list of all assignments on the server, if not NULL the assignment details for a specific assignment ID

version

version of the questionnaire, only required with questID

responsibleID

the ID of the responsible user (Supervisor or Interviewer). Retrieves all assignments for this user.

order.by

determines the column by which the assignment list should be ordered

operations.type

specifies the desired operation, one of assignmentQuantitySettings, history, or recordAudio, if specified, requires also AssId to be specified.

Value

Returns an S3 object of assignmentClass. If you select any of the operations types, then no data.frame is returned, the data.table will be NULL, however any information returned from the API can be retrieved by using the getinfo() function with the corresponding arguments.

Examples

## Not run: 

# get all assignment for specific workspace
asslist<-suso_get_assignments(
                   workspace = "myworkspace"
                   )
# get all assignment for specific responsible
asslist<-suso_get_assignments(
                   workspace = "myworkspace",
                   responsibleID = "a67d2b82-bf28-40cf-bd1a-7901225c0885"
                   )
# get the overall count
getinfo(asslist, "totalcount")

#get all single assignment details
asslist<-suso_get_assignments(
                   workspace = "myworkspace",
                   AssId = 1
                   )
# retrieve the uid of the person responsible
getinfo(asslist, "responsibleid")

# get the status of the quantitysettings
asslist<-suso_get_assignments(
                   workspace = "myworkspace",
                   AssId = 1,
                   operations.type = "assignmentQuantitySettings")
asslist
Null data.table (0 rows and 0 cols)

getinfo(asslist, "canchangequantity")
[1] TRUE

## End(Not run)


michael-cw/SurveySolutionsAPI documentation built on Jan. 14, 2024, 2:58 a.m.