Package 'rtypeform'

Title: Interface to 'typeform' Results
Description: An R interface to the 'typeform' <https://typeform.com> application program interface. Also provides functions for downloading your results.
Authors: Colin Gillespie [aut, cre], Jamie Owen [aut]
Maintainer: Colin Gillespie <[email protected]>
License: GPL-2 | GPL-3
Version: 2.1.0
Built: 2024-09-11 02:50:54 UTC
Source: https://github.com/csgillespie/rtypeform

Help Index


Check api response

Description

A function that checks the api response

Usage

check_api_response(resp, content)

Arguments

resp

A response

content

The content


Theme functions Theme API functions

Description

Theme functions

Theme API functions

Usage

create_theme(
  name,
  api = NULL,
  background_href = NULL,
  background_layout = "fullscreen",
  background_brightness = 0,
  colors_answer = "#4FB0AE",
  colors_background = "#FFFFFF",
  colors_button = "#4FB0AE",
  colors_question = "#3D3D3D",
  font = "Source Sans Pro",
  has_transparent_button = TRUE
)

get_theme(theme_id, api = NULL)

get_themes(api = NULL, page = 1, page_size = 10)

update_theme(
  theme_id,
  name,
  api = NULL,
  background_href = NULL,
  background_layout = "fullscreen",
  background_brightness = 0,
  colors_answer = "#4FB0AE",
  colors_background = "#FFFFFF",
  colors_button = "#4FB0AE",
  colors_question = "#3D3D3D",
  font = "Source Sans Pro",
  has_transparent_button = TRUE
)

delete_theme(theme_id, api = NULL)

Arguments

name

See https://developer.typeform.com/create/reference/create-theme/

api

Default NULL. Your private api key. If api is NULL, the environment variable Sys.getenv("typeform_api2") is used.

background_href

See https://developer.typeform.com/create/reference/create-theme/

background_layout

See https://developer.typeform.com/create/reference/create-theme/

background_brightness

See https://developer.typeform.com/create/reference/create-theme/

colors_answer

See https://developer.typeform.com/create/reference/create-theme/

colors_background

See https://developer.typeform.com/create/reference/create-theme/

colors_button

See https://developer.typeform.com/create/reference/create-theme/

colors_question

See https://developer.typeform.com/create/reference/create-theme/

font

See https://developer.typeform.com/create/reference/create-theme/

has_transparent_button

See https://developer.typeform.com/create/reference/create-theme/

theme_id

The theme id

page

The page of results to retrieve. Default 1 is the first page of results.

page_size

Number of results to retrieve per page. Default is 10. Maximum is 200.


Deletes a typeform

Description

Delete the specified typeform.

Usage

delete_form(form_id, api = NULL)

Arguments

form_id

The form id of the typeform you want the results for.

api

Default NULL. Your private api key. If api is NULL, the environment variable Sys.getenv("typeform_api2") is used.


Delete Responses

Description

Delete entries in a type form- use with care!

Usage

delete_responses(form_id, api = NULL, included_tokens = NULL)

Arguments

form_id

The form id of the typeform you want the results for.

api

Default NULL. Your private api key. If api is NULL, the environment variable Sys.getenv("typeform_api2") is used.

included_tokens

A vector of tokens to delete. Maximum 1000. Token ids can be extracted from the meta data frame via get_form.

Value

If successful, the function will return (invisibily) TRUE


Retrieve API key from Renviron

Description

If the entry typeform_api2 exists in your .Renviron return that value. Otherwise, raise an error.

Usage

get_api(api = NULL)

Arguments

api

Default NULL. Your private api key. If api is NULL, the environment variable Sys.getenv("typeform_api2") is used.

Details

In version 1 of the typeform API, rtypeform looked for the key typeform_api,


Get Authorziation

Description

A function to get authorization

Usage

get_authorization(api)

Arguments

api

An authentication key


Retrieve your own account information.

Description

Returns alias, email and language.

Usage

get_me(api = NULL)

Arguments

api

Default NULL. Your private api key. If api is NULL, the environment variable Sys.getenv("typeform_api2") is used.


Fetch all available typeforms

Description

This function returns a two column data frame containing the typeform names and their associated ids.

Usage

get_number_of_forms(api = NULL, search = "", workspace_id = NULL)

get_forms(
  api = NULL,
  page = 1,
  page_size = 10,
  search = "",
  workspace_id = NULL
)

Arguments

api

Default NULL. Your private api key. If api is NULL, the environment variable Sys.getenv("typeform_api") is used.

search

Returns items that contain the specified string.

workspace_id

Retrieve typeforms for the specified workspace.

page

The page of results to retrieve. Default 1 is the first page of results.

page_size

Number of results to retrieve per page. Default is 10. Maximum is 200.

Value

A list containing content and the response.


Get team members

Description

Return a tibble containing the current team members. The total number of seats is attached via an attribute.

Usage

get_number_of_seats(api = NULL)

get_teams(api = NULL)

Arguments

api

Default NULL. Your private api key. If api is NULL, the environment variable Sys.getenv("typeform_api2") is used.


Available workspaces

Description

A tibble containing details on workspaces

Usage

get_number_of_workspace(api = NULL, search = NULL)

get_workspaces(api = NULL, search = NULL, page = 1, page_size = 10)

create_workspace(workspace_name, api = NULL)

get_workspace(workspace_id, api = NULL)

update_workspace(
  workspace_id,
  api = NULL,
  workspace_name = NULL,
  add_members = NULL,
  remove_members = NULL
)

delete_workspace(workspace_id, api = NULL)

Arguments

api

Default NULL. Your private api key. If api is NULL, the environment variable Sys.getenv("typeform_api2") is used.

search

Returns items that contain the specified string.

page

The page of results to retrieve. Default 1 is the first page of results.

page_size

Number of results to retrieve per page. Default is 10. Maximum is 200.

workspace_name

The name workspace name

workspace_id

Retrieve typeforms for the specified workspace.

add_members

Email address

remove_members

Email address


Get response

Description

A function that allows you to get a response from the server.

Usage

get_response(api, url)

Arguments

api

An authentication key

url

The URL of the site


Download questionnaire results

Description

Download results for a particular typeform questionnaire.

Usage

get_responses(
  form_id,
  api = NULL,
  page_size = 25,
  since = NULL,
  until = NULL,
  after = NULL,
  before = NULL,
  completed = NULL,
  query = NULL,
  fields = NULL
)

Arguments

form_id

The form id of the typeform you want the results for.

api

Default NULL. Your private api key. If api is NULL, the environment variable Sys.getenv("typeform_api2") is used.

page_size

Maximum number of responses. Default value is 25. Maximum value is 1000.

since

default NULL. Fetch only the results after a specific date and time. If NULL return all results. This should be a date time object. The timezone of the object will be converted to UTC.

until

default NULL. Similar to since.

after

default NULL. Fetch only the results after a specific date and time. If NULL return all results. If you use the after parameter, the responses will be sorted in the order that our system processed them (instead of the default order, submitted_at). This ensures that you can traverse the complete set of responses without repeating entries.

before

default NULL. Similar to after

completed

default NULL, return all results. Fetch only completed results (TRUE), or only not-completed results (=FALSE). If NULL return all results. Warning. It's not possible to determine completed/non-completed results.

query

Limit request to only responses that that include the specified term.

fields

Not implemented. Pull requests welcome

Value

A list. The first value is meta information. Subsequent elements are questions..

See Also

https://developer.typeform.com/responses/reference/retrieve-responses/


Create an OAuth token

Description

Create a token object using the client id and secret options set, together with the defined scopes.

Usage

make_new_token()

Post response

Description

A function that allows you to post an update to the server

Usage

post_response(api, url, body = NULL, ...)

Arguments

api

An authentication key

url

The URL of the site

body

The infrormation sent out to the server. e.g. the title

...

Other arguments


Set access scopes for OAuth access

Description

Define access scopes for an application. See https://developer.typeform.com/get-started/scopes/ for more information on what scopes are allowed and their permissions.

Set option for rtypeform client id, secret

Usage

rtypeform_set_scope(scopes = NULL)

rtypeform_set_client_id(id = NULL)

rtypeform_set_client_secret(secret = NULL)

rtypeform_set_token(token)

Arguments

scopes

A character vector of scopes

id

A client id from a typeform registered application

secret

A client secret from a typeform registered application

token

Either a string of a personal access token, or an OAuth token returned by make_new_token.

Examples

rtypeform_set_scope(scopes = c("forms:read"))