Open alvared opened 3 years ago
The mixpanelJQLQuery
function invokes an operating system call to curl
, which you can see here in the package source code. I suspect that this error might occur if the bundled certificates located by curl
are not maintained within the operating system, such as if they are outdated.
Removing this dependency in RMixpanel might be a way to avoid such issues from preventing the proper functioning of this package. Here is an example I have written of how the Mixpanel API could be queried within R without invoking the operating system's shell. This example uses the httr
package to handle the request instead:
library(httr)
library(readr)
mp_jql_as_json <- function(jql_filename, api_secret) {
response <- POST(
url = "https://mixpanel.com/api/2.0/jql",
authenticate(api_secret, ""),
encode = "form",
body = list(
script = read_file(jql_filename)
)
)
content(response)
}
results_json <- mp_jql_as_json(jql_filename = "test.jql", api_secret = "################################")
print(results_json)
The above could be used as a skeleton to rework the mixpanelJQLQuery
function (as well as other functions within the RMixpanel package) to remove the need to invoke curl
via the operating system's shell.
Hi,
I am having an issue when I call mixpanelJQLQuery() - I get an error as follows
this is the code snippet:
The credentials for "account" are set up correctly as I am able to run mixpanelGetEvents() with no issue. I can also run the JQL code in Mixpanel and it returns results. Please let me know if there is something I am missing with this function call - I am running R version 4.1.1
Thanks very much!