View source: R/get_message_data.R
get_message_data | R Documentation |
Fetches message data from the RapidPro API, allowing filtering based on different criteria such as folder, contact, label, or broadcast.
get_message_data(
rapidpro_site = get_rapidpro_site(),
token = get_rapidpro_key(),
call_type = "messages.json",
filter_variable = "folder",
filter_variable_value = "flows",
flatten = FALSE,
date_from = NULL,
date_to = NULL,
format_date = "%Y-%m-%d",
tzone_date = "UTC"
)
rapidpro_site |
A character string specifying the base URL of the RapidPro instance. Defaults to |
token |
A character string specifying the API token for authentication. Defaults to |
call_type |
A character string indicating the type of API call. Default is |
filter_variable |
A character string specifying the filtering criterion. Must be one of |
filter_variable_value |
A character string specifying the value for the filter variable. If |
flatten |
A logical value indicating whether to flatten the retrieved data. Default is |
date_from |
A character string specifying the start date for filtering messages (in the format specified by |
date_to |
A character string specifying the end date for filtering messages (in the format specified by |
format_date |
A character string specifying the date format used for filtering. Default is |
tzone_date |
A character string specifying the time zone for date filtering. Default is |
Only one filter can be applied at a time.
The function removes messages with missing UUIDs to ensure data consistency.
A tibble containing the retrieved message data, filtered according to the provided criteria.
# Retrieve messages from the "flows" folder
#get_message_data(filter_variable = "folder", filter_variable_value = "flows")
# Retrieve messages from a specific contact
#get_message_data(filter_variable = "contact", filter_variable_value = "12345")
# Retrieve messages with a specific label
#get_message_data(filter_variable = "label", filter_variable_value = "survey_responses")
# Retrieve messages from a broadcast
#get_message_data(filter_variable = "broadcast", filter_variable_value = "98765")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.