Title: | Comprehensive Interface to the Survey Solutions 'GraphQL' API |
---|---|
Description: | Provides a complete suite of tools for interacting with the Survey Solutions 'GraphQL' API <https://demo.mysurvey.solutions/graphql/>. This package encompasses all currently available queries and mutations, including the latest features for map uploads. It is built on the modern 'httr2' package, offering a streamlined and efficient interface without relying on external 'GraphQL' client packages. In addition to core API functionalities, the package includes a range of helper functions designed to facilitate the use of available query filters. |
Authors: | Michael Wild [cre, aut, cph] |
Maintainer: | Michael Wild <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.6.9000 |
Built: | 2025-02-11 04:12:37 UTC |
Source: | https://github.com/michael-cw/susographql |
Add a calendar event to an assignment
suso_gql_addassignmentcalendarevent( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, assignmentId = NULL, comment = NULL, newStart = NULL, startTimezone = "UTC" )
suso_gql_addassignmentcalendarevent( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, assignmentId = NULL, comment = NULL, newStart = NULL, startTimezone = "UTC" )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
your API user password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
assignmentId |
assignment id |
comment |
a comment string |
newStart |
new start date, format must be: |
startTimezone |
time zone of the tablet device, use |
if successfull, returns a list with the executed mutation
## Requires Survey Solutions Server and API credentials # Create a calendar event for assignment 208 on 2024-01-16 01:41:14, # in timezone Chile/Continental suso_gql_addassignmentcalendarevent(endpoint = ep, user = usr, password = pass, workspace = ws, assignmentId = 208, newStart = "2024-01-16 01:41:14", startTimezone = "Chile/Continental", comment = "Lets Go!")
## Requires Survey Solutions Server and API credentials # Create a calendar event for assignment 208 on 2024-01-16 01:41:14, # in timezone Chile/Continental suso_gql_addassignmentcalendarevent(endpoint = ep, user = usr, password = pass, workspace = ws, assignmentId = 208, newStart = "2024-01-16 01:41:14", startTimezone = "Chile/Continental", comment = "Lets Go!")
Add a calendar event to an Interview
suso_gql_addinterviewcalendarevent( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, interviewId = NULL, comment = NULL, newStart = NULL, startTimezone = "UTC" )
suso_gql_addinterviewcalendarevent( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, interviewId = NULL, comment = NULL, newStart = NULL, startTimezone = "UTC" )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
your API user password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
interviewId |
the interviewId |
comment |
a comment string |
newStart |
new start date, format must be: |
startTimezone |
time zone of the tablet device, use |
if successfull, returns a list with the executed mutation
## Requires Survey Solutions Server and API credentials # Create a calendar event for a selected interview on 2024-01-16 01:41:14, # in timezone UTC suso_gql_addinterviewcalendarevent(endpoint = ep, user = usr, password = pass, workspace = ws, interviewId = "bac4d15253b541dd86a003dc7f854e35", newStart = "2024-01-16 01:41:14", startTimezone = "UTC", comment = "Lets Go!")
## Requires Survey Solutions Server and API credentials # Create a calendar event for a selected interview on 2024-01-16 01:41:14, # in timezone UTC suso_gql_addinterviewcalendarevent(endpoint = ep, user = usr, password = pass, workspace = ws, interviewId = "bac4d15253b541dd86a003dc7f854e35", newStart = "2024-01-16 01:41:14", startTimezone = "UTC", comment = "Lets Go!")
Allows the user to assign a map to an interviewer to be used in CAPI data collection.
suso_gql_addusertomap( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, fileName = NULL, userName = NULL )
suso_gql_addusertomap( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, fileName = NULL, userName = NULL )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
your API user password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
fileName |
the name of the map file on the server |
userName |
the name of the interviewer to whom the map will be assigned to |
if successfull, returns a list with the executed mutation
## Requires Survey Solutions Server and API credentials # Assign map seg_168_ALL.tif to user int0073 suso_gql_addusertomap(endpoint = ep, user = usr, password = pass, workspace = ws, fileName = "seg_168_ALL.tif", userName = "int0073")
## Requires Survey Solutions Server and API credentials # Assign map seg_168_ALL.tif to user int0073 suso_gql_addusertomap(endpoint = ep, user = usr, password = pass, workspace = ws, fileName = "seg_168_ALL.tif", userName = "int0073")
Allows the user to retrieve filtered or unfiltered assignment data.
suso_gql_assignments( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, archived = FALSE, id = NULL, questionnaireId = NULL, version = NULL, responsibleId = NULL, webMode = FALSE, take = NULL, skip = NULL )
suso_gql_assignments( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, archived = FALSE, id = NULL, questionnaireId = NULL, version = NULL, responsibleId = NULL, webMode = FALSE, take = NULL, skip = NULL )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
API password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
archived |
Boolean if the assignment is archived or not |
id |
Assignment ID |
questionnaireId |
Questionnaire ID |
version |
Questionnaire version |
responsibleId |
ID of the person currently responsible for the assignment |
webMode |
Boolean for webmode |
take |
take the specified integer numeber of assignments |
skip |
skip the first integer number of assignments |
if successfull, returns a list with the (filtered) responses
## Requires Survey Solutions Server and API credentials # Get all assignments without filter suso_gql_assignments(endpoint = ep, user = usr, password = pass, workspace = ws) # Select assignment with id 25 suso_gql_assignments(endpoint = ep, user = usr, password = pass, workspace = ws, id = 25) # Select assignment excluding id 25, by using susoop_numeric suso_gql_assignments(endpoint = ep, user = usr, password = pass, workspace = ws, id = susoop_num$neq(25))
## Requires Survey Solutions Server and API credentials # Get all assignments without filter suso_gql_assignments(endpoint = ep, user = usr, password = pass, workspace = ws) # Select assignment with id 25 suso_gql_assignments(endpoint = ep, user = usr, password = pass, workspace = ws, id = 25) # Select assignment excluding id 25, by using susoop_numeric suso_gql_assignments(endpoint = ep, user = usr, password = pass, workspace = ws, id = susoop_num$neq(25))
Delete a calendar event
suso_gql_deletecalendarevent( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, publicKey = NULL )
suso_gql_deletecalendarevent( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, publicKey = NULL )
endpoint |
GraphQL endpoint of your server. |
workspace |
Server Workspace, if NULL uses default. |
user |
your API username. |
password |
your API user password. |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored. |
publicKey |
the publicKey of the calendar event to be deleted. |
if successfull, returns a list with the executed mutation
## Requires Survey Solutions Server and API credentials # Delete a calendar event for a specific event # in timezone Chile/Continental suso_gql_deletecalendarevent(endpoint = ep, user = usr, password = pass, workspace = ws, publicKey = "ea8b49c0-0d16-4fec-9029-72278e94a233")
## Requires Survey Solutions Server and API credentials # Delete a calendar event for a specific event # in timezone Chile/Continental suso_gql_deletecalendarevent(endpoint = ep, user = usr, password = pass, workspace = ws, publicKey = "ea8b49c0-0d16-4fec-9029-72278e94a233")
Allows the user to delete a map.
suso_gql_deletemap( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, fileName = NULL )
suso_gql_deletemap( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, fileName = NULL )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
your API user password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
fileName |
the name of the map file on the server |
if successfull, returns a list with the executed mutation
## Requires Survey Solutions Server and API credentials # Delete map seg_168_ALL.tif suso_gql_deletemap(endpoint = ep, user = usr, password = pass, workspace = ws, fileName = "seg_168_ALL.tif")
## Requires Survey Solutions Server and API credentials # Delete map seg_168_ALL.tif suso_gql_deletemap(endpoint = ep, user = usr, password = pass, workspace = ws, fileName = "seg_168_ALL.tif")
Allows the user to delete an interviewer from a map to be used in CAPI data collection.
suso_gql_deleteuserfrommap( endpoint = NULL, workspace = NULL, user = NULL, token = NULL, password = NULL, fileName = NULL, userName = NULL )
suso_gql_deleteuserfrommap( endpoint = NULL, workspace = NULL, user = NULL, token = NULL, password = NULL, fileName = NULL, userName = NULL )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
password |
your API user password |
fileName |
the name of the map file on the server |
userName |
the name of the interviewer to whom the map will be assigned to |
if successfull, returns a list with the executed mutation
## Requires Survey Solutions Server and API credentials # Delete map seg_168_ALL.tif from user int0073 suso_gql_deleteuserfrommap(endpoint = ep, user = usr, password = pass, workspace = ws, fileName = "seg_168_ALL.tif", userName = "int0073")
## Requires Survey Solutions Server and API credentials # Delete map seg_168_ALL.tif from user int0073 suso_gql_deleteuserfrommap(endpoint = ep, user = usr, password = pass, workspace = ws, fileName = "seg_168_ALL.tif", userName = "int0073")
Allows the user to retrieve filtered or unfiltered interview data.
suso_gql_interviews( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, assignmentId = NULL, clientKey = NULL, createdDate = NULL, errorsCount = NULL, identifyingData = NULL, interviewMode = NULL, notAnsweredCount = NULL, questionnaireId = NULL, questionnaireVersion = NULL, questionnaireVariable = NULL, responsibleName = NULL, responsibleRole = NULL, status = NULL, supervisorName = NULL, sortby_updateDateUtc = NULL, sortby_notAnsweredCount = NULL, sortby_createdDate = NULL, sortby_errorsCount = NULL, sortby_assignmentId = NULL, sortby_status = NULL, sortby_receivedByInterviewerAtUtc = NULL, sortby_responsibleName = NULL, take = NULL, skip = NULL )
suso_gql_interviews( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, assignmentId = NULL, clientKey = NULL, createdDate = NULL, errorsCount = NULL, identifyingData = NULL, interviewMode = NULL, notAnsweredCount = NULL, questionnaireId = NULL, questionnaireVersion = NULL, questionnaireVariable = NULL, responsibleName = NULL, responsibleRole = NULL, status = NULL, supervisorName = NULL, sortby_updateDateUtc = NULL, sortby_notAnsweredCount = NULL, sortby_createdDate = NULL, sortby_errorsCount = NULL, sortby_assignmentId = NULL, sortby_status = NULL, sortby_receivedByInterviewerAtUtc = NULL, sortby_responsibleName = NULL, take = NULL, skip = NULL )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
API password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
assignmentId |
Assignment ID |
clientKey |
Interview key |
createdDate |
Creation data of the interview |
errorsCount |
number of errors |
identifyingData |
Pre-loaded identifying data |
interviewMode |
Interview mode (CAWI or CAPI) |
notAnsweredCount |
number of unanswered questions |
questionnaireId |
the questionnnaire id |
questionnaireVersion |
the questionnaire version |
questionnaireVariable |
the variable for the questionnaire |
responsibleName |
Name of the person responsible |
responsibleRole |
Role of the person responsible |
status |
of the interview |
supervisorName |
Name of the supervisor of the responsible user |
sortby_updateDateUtc |
sort by updated at UTC time, either ASC for ascending or DESC for descending |
sortby_notAnsweredCount |
sort by errors count, either ASC for ascending or DESC for descending |
sortby_createdDate |
sort by creation date, either ASC for ascending or DESC for descending |
sortby_errorsCount |
sort by number of errors, either ASC for ascending or DESC for descending |
sortby_assignmentId |
sort by assignmentId, either ASC for ascending or DESC for descending |
sortby_status |
sort by interview status, either ASC for ascending or DESC for descending |
sortby_receivedByInterviewerAtUtc |
sort by date the table received the interview, either ASC for ascending or DESC for descending |
sortby_responsibleName |
sort by the current responsible user, either ASC for ascending or DESC for descending |
take |
take the specified integer numeber of interviews |
skip |
skip the first integer number of interviews |
if successfull, returns a list with the (filtered) responses
## Requires Survey Solutions Server and API credentials # Get all interviews without filter suso_gql_interviews(endpoint = ep, user = usr, password = pass, workspace = "primary") # Select interviews which are not completed yet suso_gql_interviews(endpoint = ep, user = usr, password = pass, workspace = "primary", status = susoop_str$neq("COMPLETED")) # Select interviews which have 3 or more errors suso_gql_assignments(endpoint = ep, user = usr, password = pass, workspace = "primary", errorsCount = susoop_num$gte(3)) # Select interviews which have less than 3 errors suso_gql_assignments(endpoint = ep, user = usr, password = pass, workspace = "primary", errorsCount = susoop_num$ngt(3))
## Requires Survey Solutions Server and API credentials # Get all interviews without filter suso_gql_interviews(endpoint = ep, user = usr, password = pass, workspace = "primary") # Select interviews which are not completed yet suso_gql_interviews(endpoint = ep, user = usr, password = pass, workspace = "primary", status = susoop_str$neq("COMPLETED")) # Select interviews which have 3 or more errors suso_gql_assignments(endpoint = ep, user = usr, password = pass, workspace = "primary", errorsCount = susoop_num$gte(3)) # Select interviews which have less than 3 errors suso_gql_assignments(endpoint = ep, user = usr, password = pass, workspace = "primary", errorsCount = susoop_num$ngt(3))
Allows the user to retrieve filtered or unfiltered map report data.
suso_gql_mapreport( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, questionnaireId = NULL, questionnaireVersion = NULL, variable = NULL, zoom = 1, clientMapWidth = 0, west = -180, east = 180, north = 90, south = -90, assignmentId = NULL, clientKey = NULL, createdDate = NULL, errorsCount = NULL, identifyingData = NULL, interviewMode = NULL, notAnsweredCount = NULL, questionnaireVariable = NULL, responsibleName = NULL, responsibleRole = NULL, status = NULL, supervisorName = NULL )
suso_gql_mapreport( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, questionnaireId = NULL, questionnaireVersion = NULL, variable = NULL, zoom = 1, clientMapWidth = 0, west = -180, east = 180, north = 90, south = -90, assignmentId = NULL, clientKey = NULL, createdDate = NULL, errorsCount = NULL, identifyingData = NULL, interviewMode = NULL, notAnsweredCount = NULL, questionnaireVariable = NULL, responsibleName = NULL, responsibleRole = NULL, status = NULL, supervisorName = NULL )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
API password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
questionnaireId |
the questionnnaire id |
questionnaireVersion |
the questionnaire version |
variable |
Variable(s) of interest |
zoom |
Zoom of the map report |
clientMapWidth |
width of the client map |
west |
coordinates for bounding box |
east |
coordinates for bounding box |
north |
coordinates for bounding box |
south |
coordinates for bounding box |
assignmentId |
Assignment ID |
clientKey |
Interview key |
createdDate |
Creation data of the interview |
errorsCount |
number of errors |
identifyingData |
Pre-loaded identifying data |
interviewMode |
Interview mode (CAWI or CAPI) |
notAnsweredCount |
number of unanswered questions |
questionnaireVariable |
the variable for the questionnaire |
responsibleName |
Name of the person responsible |
responsibleRole |
Role of the person responsible |
status |
of the interview |
supervisorName |
Name of the supervisor of the responsible user |
if successfull, returns a list with the (filtered) responses
## Requires Survey Solutions Server and API credentials questlist<-suso_gql_questionnaires( endpoint = ep, user = usr, password = pass, workspace = "primary") id<-questlist$questionnaires$nodes$questionnaireId[1] v<-questlist$questionnaires$nodes$version[1] # Get map report for GPS question start_location suso_gql_mapreport(endpoint = ep, user = usr, password = pass, workspace = ws, questionnaireId = id, questionnaireVersion = v, variable = "start_location")
## Requires Survey Solutions Server and API credentials questlist<-suso_gql_questionnaires( endpoint = ep, user = usr, password = pass, workspace = "primary") id<-questlist$questionnaires$nodes$questionnaireId[1] v<-questlist$questionnaires$nodes$version[1] # Get map report for GPS question start_location suso_gql_mapreport(endpoint = ep, user = usr, password = pass, workspace = ws, questionnaireId = id, questionnaireVersion = v, variable = "start_location")
Allows the user to retrieve filtered or unfiltered map data.
suso_gql_maps( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, fileName = NULL, importDateUtc = NULL, size = NULL, userName = NULL, sortby_filename = NULL, sortby_importeddateutc = NULL, sortby_size = NULL, take = NULL, skip = NULL )
suso_gql_maps( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, fileName = NULL, importDateUtc = NULL, size = NULL, userName = NULL, sortby_filename = NULL, sortby_importeddateutc = NULL, sortby_size = NULL, take = NULL, skip = NULL )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
API password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
fileName |
name of the map on the server |
importDateUtc |
Import date of map |
size |
Size of the map |
userName |
User name to whom the map(s) are assigned to. |
sortby_filename |
sort maps by file name, either ASC for ascending or DESC for descending |
sortby_importeddateutc |
sort maps by import date in utc, either ASC for ascending or DESC for descending |
sortby_size |
sort by map size, either ASC for ascending or DESC for descending |
take |
take the specified integer numeber of maps |
skip |
skip the first integer number of maps |
if successfull, returns a list with the (filtered) responses
## Requires Survey Solutions Server and API credentials # Get all maps without filter suso_gql_maps(endpoint = ep, user = usr, password = pass, workspace = ws) # Get only boundary files (.shp) suso_gql_maps(endpoint = ep, user = usr, password = pass, workspace = ws, fileName = susoop_str$endsWith(".shp"))
## Requires Survey Solutions Server and API credentials # Get all maps without filter suso_gql_maps(endpoint = ep, user = usr, password = pass, workspace = ws) # Get only boundary files (.shp) suso_gql_maps(endpoint = ep, user = usr, password = pass, workspace = ws, fileName = susoop_str$endsWith(".shp"))
This function returns a 200 status code if credentials are correct and a 400 code otherwise.
suso_gql_pwcheck( endpoint = NULL, user = NULL, password = NULL, workspace = NULL, token = NULL )
suso_gql_pwcheck( endpoint = NULL, user = NULL, password = NULL, workspace = NULL, token = NULL )
endpoint |
Survey Solutions GraphQl |
user |
API user |
password |
API password |
workspace |
endpoint workspace Name, if nothing provided, defaults to primary |
token |
If Survey Solutions endpoint token is provided user and password will be ignored |
200 code if correct, 400 if incorrect.
# With default credentials returns 400 suso_gql_pwcheck()
# With default credentials returns 400 suso_gql_pwcheck()
Allows the user to retrieve all questions in a questionniare.
suso_gql_questionnaireitems( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, id = NULL, version = NULL, variable = NULL, scope = NULL, identifying = NULL, title = NULL, includedInReportingAtUtc = NULL )
suso_gql_questionnaireitems( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, id = NULL, version = NULL, variable = NULL, scope = NULL, identifying = NULL, title = NULL, includedInReportingAtUtc = NULL )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
API password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
id |
Questionnaire ID |
version |
Questionnaire version |
variable |
Get questions for a specific variable |
scope |
Get questions for a specific scope |
identifying |
If TRUE only identifying questions are exported |
title |
the text of the questions |
includedInReportingAtUtc |
time of the last reporting |
if successfull, returns a list with the (filtered) responses
## Requires Survey Solutions Server and API credentials questlist<-suso_gql_questionnaires( endpoint = ep, user = usr, password = pass, workspace = "primary") id<-questlist$questionnaires$nodes$questionnaireId[1] v<-questlist$questionnaires$nodes$version[1] # Get all questions from a questionnaire/version without filter suso_gql_questionnaireitems(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v) # Select only identifying questions suso_gql_questionnaireitems(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v, identifying = TRUE) # Select only questions which have not interviewer scope suso_gql_questionnaireitems(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v, scope = susoop_str$neq("INTERVIEWER"))
## Requires Survey Solutions Server and API credentials questlist<-suso_gql_questionnaires( endpoint = ep, user = usr, password = pass, workspace = "primary") id<-questlist$questionnaires$nodes$questionnaireId[1] v<-questlist$questionnaires$nodes$version[1] # Get all questions from a questionnaire/version without filter suso_gql_questionnaireitems(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v) # Select only identifying questions suso_gql_questionnaireitems(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v, identifying = TRUE) # Select only questions which have not interviewer scope suso_gql_questionnaireitems(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v, scope = susoop_str$neq("INTERVIEWER"))
Get all Questionnaires in the workspace or only a selected one/versions.
suso_gql_questionnaires( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, id = NULL, version = NULL, take = NULL, skip = NULL )
suso_gql_questionnaires( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, id = NULL, version = NULL, take = NULL, skip = NULL )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
API password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
id |
Questionnaire ID |
version |
Questionnaire version |
take |
take the specified integer numeber of questionnaires |
skip |
skip the first integer number of questionnaires |
if successfull, returns a list with the responses
## Requires Survey Solutions Server and API credentials # Get all questionnaires in workspace ws suso_gql_questionnaires(endpoint = ep, user = usr, password = pass, workspace = ws)
## Requires Survey Solutions Server and API credentials # Get all questionnaires in workspace ws suso_gql_questionnaires(endpoint = ep, user = usr, password = pass, workspace = ws)
Allows the user to retrieve all questions in a questionniare.
suso_gql_questions( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, id = NULL, version = NULL, variable = NULL, scope = NULL, identifying = NULL )
suso_gql_questions( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, id = NULL, version = NULL, variable = NULL, scope = NULL, identifying = NULL )
endpoint |
GraphQL endpoint of your server |
workspace |
Server Workspace, if NULL uses default |
user |
your API username |
password |
API password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
id |
Questionnaire ID |
version |
Questionnaire version |
variable |
Get questions for a specific variable |
scope |
Get questions for a specific scope |
identifying |
If TRUE only identifying questions are exported |
if successfull, returns a list with the (filtered) responses
## Requires Survey Solutions Server and API credentials questlist<-suso_gql_questionnaires( endpoint = ep, user = usr, password = pass, workspace = "primary") id<-questlist$questionnaires$nodes$questionnaireId[1] v<-questlist$questionnaires$nodes$version[1] # Get all questions from a questionnaire/version without filter suso_gql_questions(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v) # Select only identifying questions suso_gql_questions(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v, identifying = TRUE) # Select only questions which have not interviewer scope suso_gql_questions(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v, scope = susoop_str$neq("INTERVIEWER"))
## Requires Survey Solutions Server and API credentials questlist<-suso_gql_questionnaires( endpoint = ep, user = usr, password = pass, workspace = "primary") id<-questlist$questionnaires$nodes$questionnaireId[1] v<-questlist$questionnaires$nodes$version[1] # Get all questions from a questionnaire/version without filter suso_gql_questions(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v) # Select only identifying questions suso_gql_questions(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v, identifying = TRUE) # Select only questions which have not interviewer scope suso_gql_questions(endpoint = ep, user = usr, password = pass, workspace = ws, id = id, version = v, scope = susoop_str$neq("INTERVIEWER"))
Update a calendar event
suso_gql_updatecalendarevent( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, publicKey = NULL, comment = NULL, newStart = NULL, startTimezone = "UTC" )
suso_gql_updatecalendarevent( endpoint = NULL, workspace = NULL, user = NULL, password = NULL, token = NULL, publicKey = NULL, comment = NULL, newStart = NULL, startTimezone = "UTC" )
endpoint |
GraphQL endpoint of your server. |
workspace |
Server Workspace, if NULL uses default. |
user |
your API username. |
password |
your API user password. |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored. |
publicKey |
the publicKey of the calendar event to be updated. |
comment |
a comment string. |
newStart |
new start date, format must be: |
startTimezone |
time zone of the tablet device, use |
if successfull, returns a list with the executed mutation
## Requires Survey Solutions Server and API credentials # Update a calendar event for a specific event to 2024-01-18 01:41:14, # in timezone Chile/Continental suso_gql_updatecalendarevent(endpoint = ep, user = usr, password = pass, workspace = ws, publicKey = "ea8b49c0-0d16-4fec-9029-72278e94a233", newStart = "2024-01-16 01:41:14", startTimezone = "Chile/Continental", comment = "Lets Go Again!")
## Requires Survey Solutions Server and API credentials # Update a calendar event for a specific event to 2024-01-18 01:41:14, # in timezone Chile/Continental suso_gql_updatecalendarevent(endpoint = ep, user = usr, password = pass, workspace = ws, publicKey = "ea8b49c0-0d16-4fec-9029-72278e94a233", newStart = "2024-01-16 01:41:14", startTimezone = "Chile/Continental", comment = "Lets Go Again!")
Allows the user to upload 1 or several zip files with base maps and shapefiles to the server.
suso_gql_uploadmap( endpoint = NULL, workspace = NULL, user = NULL, token = NULL, password = NULL, path_to_zip = NULL, usePar = FALSE, n_par = 10 )
suso_gql_uploadmap( endpoint = NULL, workspace = NULL, user = NULL, token = NULL, password = NULL, path_to_zip = NULL, usePar = FALSE, n_par = 10 )
endpoint |
GraphQL endpoint of your server. |
workspace |
Server Workspace, if NULL uses default. |
user |
your API username. |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored. |
password |
API password. |
path_to_zip |
path to a single zip file or path to a directory of zip files if |
usePar |
if TRUE the requests will be performed in parallel EXPERIMENTAL! |
n_par |
number of parallel requests, required if |
If usePar = TRUE
a path to a directory needs to be provided containing the zipped
map files. This feature may be useful when uploading a large number of maps, however be careful,
with the number of parallel requests and the size of each zip file, as this may overload the server.
Initial testing and gradually increasing the n_par
parameter is therefore strongly recommended.
a list with details on successfully processed maps, if usePar = TRUE
, the node
element of that list will be a data.table with all the successfully processed uploads.
## Requires Survey Solutions Server and API credentials # Upload a single zip file containing maps suso_gql_uploadmap(endpoint = ep, user = usr, password = pass, workspace = ws, path_to_zip = "./dev/shapes_for_test.zip", usePar = FALSE) # Upload a directory with zip files containing maps suso_gql_uploadmap(endpoint = ep, user = usr, password = pass, workspace = ws, path_to_zip = "./dev/allzipforupload/", usePar = TRUE)
## Requires Survey Solutions Server and API credentials # Upload a single zip file containing maps suso_gql_uploadmap(endpoint = ep, user = usr, password = pass, workspace = ws, path_to_zip = "./dev/shapes_for_test.zip", usePar = FALSE) # Upload a directory with zip files containing maps suso_gql_uploadmap(endpoint = ep, user = usr, password = pass, workspace = ws, path_to_zip = "./dev/allzipforupload/", usePar = TRUE)
Allows the user to retrieve filtered or unfiltered user data.
suso_gql_users( endpoint = NULL, user = NULL, password = NULL, token = NULL, userName = NULL, fullName = NULL, isArchived = NULL, isLocked = NULL, creationDate = NULL, email = NULL, phoneNumber = NULL, id = NULL, role = NULL, sortby_userName = NULL, sortby_role = NULL, sortby_creationDate = NULL, take = NULL, skip = NULL )
suso_gql_users( endpoint = NULL, user = NULL, password = NULL, token = NULL, userName = NULL, fullName = NULL, isArchived = NULL, isLocked = NULL, creationDate = NULL, email = NULL, phoneNumber = NULL, id = NULL, role = NULL, sortby_userName = NULL, sortby_role = NULL, sortby_creationDate = NULL, take = NULL, skip = NULL )
endpoint |
GraphQL endpoint of your server |
user |
your API username |
password |
API password |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
userName |
specific user name |
fullName |
fullName |
isArchived |
isArchived |
isLocked |
isLocked |
creationDate |
user creation date |
email |
user email |
phoneNumber |
user phoneNumber |
id |
user id |
role |
user role |
sortby_userName |
sort users by user name, either ASC for ascending or DESC for descending |
sortby_role |
sort users by role, either ASC for ascending or DESC for descending |
sortby_creationDate |
sort users by utc creation date, either ASC for ascending or DESC for descending |
take |
take the specified integer numeber of maps |
skip |
skip the first integer number of maps |
ATTENTION: This requires admin credentials, regular API credentials won't work
if successfull, returns a list with the (filtered) responses
## Requires Survey Solutions Server and ADMIN credentials!! # Get all users without filter suso_gql_users(endpoint = ep, user = adminuser, password = adminpass, sortby_userName = "ASC") # Get only supervisors suso_gql_users(endpoint = ep, user = adminuser, password = adminuser, , sortby_userName = "ASC", role = "SUPERVISOR")
## Requires Survey Solutions Server and ADMIN credentials!! # Get all users without filter suso_gql_users(endpoint = ep, user = adminuser, password = adminpass, sortby_userName = "ASC") # Get only supervisors suso_gql_users(endpoint = ep, user = adminuser, password = adminuser, , sortby_userName = "ASC", role = "SUPERVISOR")
A list of the available transformers
susoop_num
susoop_num
An object of class list
of length 12.
Allows the user to select the operator for the required filter.
A named list with the operator and the value to be passed on as input to the filter.
# equal to 3 susoop_num$eq(3) # not equal to 3 susoop_num$neq(3)
# equal to 3 susoop_num$eq(3) # not equal to 3 susoop_num$neq(3)
A list of the available transformers
susoop_str
susoop_str
An object of class list
of length 10.
Allows the user to select the operator for the required filter.
A named list with the operator and the value to be passed on as input to the filter.
# equal to 3 susoop_str$contains("area10") # not equal to 3 susoop_str$startsWith("area")
# equal to 3 susoop_str$contains("area10") # not equal to 3 susoop_str$startsWith("area")
Can be used in filters ("where") for operator selection. If none is selected, operator always defaults to 'eq()'. The functions bellow are valid for the corresponding inputs ComparableInt64OperationFilterInput and ComparableNullableOfInt32OperationFilterInput.
eq(value_set) neq(value_set) inbetw(value_set) ninbetw(value_set) gt(value_set) ngt(value_set) gte(value_set) ngte(value_set) lt(value_set) nlt(value_set) lte(value_set) nlte(value_set)
eq(value_set) neq(value_set) inbetw(value_set) ninbetw(value_set) gt(value_set) ngt(value_set) gte(value_set) ngte(value_set) lt(value_set) nlt(value_set) lte(value_set) nlte(value_set)
value_set |
the parameter set for the operator |
Also see the susoop_num selector list, which allows you, to just select the function from a named list.
a list with a single named element (operator name) to be handed over to the filter.
eq()
: equal
neq()
: not equal
inbetw()
: inbetween (requires numeric vector with upper and lower bound, i.e. c(1, 5))
ninbetw()
: not inbetween (requires numeric vector with upper and lower bound, i.e. c(1,5))
gt()
: greater than
ngt()
: not greater than
gte()
: greater than or equal
ngte()
: not greater than or equal
lt()
: lower than
nlt()
: not lower than
lte()
: lower than or equal
nlte()
: not lower than or equal
# set filter equal to 0 eq(0) # set filter to a value from 0 to 5 inbetw(c(0, 5))
# set filter equal to 0 eq(0) # set filter to a value from 0 to 5 inbetw(c(0, 5))
Can be used in filters ("where") for operator selection. If none is selected, operator always defaults to 'eq()'. The functions bellow are valid for the corresponding inputs ComparableInt64OperationFilterInput and ComparableNullableOfInt32OperationFilterInput.
contains(value_set) endsWith(value_set) ncontains(value_set) nendsWith(value_set) nstartsWith(value_set) startsWith(value_set) inclu(value_set) ninclu(value_set)
contains(value_set) endsWith(value_set) ncontains(value_set) nendsWith(value_set) nstartsWith(value_set) startsWith(value_set) inclu(value_set) ninclu(value_set)
value_set |
the parameter set for the operator |
Also see the susoop_str selector list, which allows you, to just select the function from a named list.
a list with a single named element (operator name) to be handed over to the filter.
contains()
: contains
endsWith()
: ends with
ncontains()
: not contains
nendsWith()
: not ends with
nstartsWith()
: not starts with
startsWith()
: starts with
inclu()
: in
ninclu()
: not in
# set filter so that the string contains "area" contains("area") # set filter to string ending with .shp endsWith(".shp")
# set filter so that the string contains "area" contains("area") # set filter to string ending with .shp endsWith(".shp")