mixpanelGetData: General Method For Mixpanel API Requests

Description Usage Arguments Value Author(s) References Examples

View source: R/mixpanelGetData.R

Description

This method handles the authentication and download of data from the Mixpanel API as well as data persistance. The method is used by many of the more specialized methods of this package.

Usage

1
2
mixpanelGetData(account, method="export/", args, validitySeconds=60, verbose=TRUE, 
  fileName="", data=FALSE, retryCount=0, encoding="UTF-8")

Arguments

account

A mixpanel account, as defined in mixpanelCreateAccount.

method

API method (route).

args

Arguments as described in https://mixpanel.com/help/reference/data-export-api.

validitySeconds

Expiration of API request.

verbose

If FALSE, less information is shown on the console.

fileName

File name to persist data (defaults to './temp.txt'). If supplied, account$dataPath is used as path.

data

If FALSE, data is downloaded, but not returned as function argument.

retryCount

How many times a failed request should be retried?

encoding

JSON Encoding. Default is UTF8.

Value

If data==TRUE, the method returns the response of the API request (raw character vector). Otherwise nothing is returned.

Author(s)

Meinhard Ploner

References

https://mixpanel.com/help/reference/data-export-api

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
## Fill in here the API token, key and secret as found on 
## www.mixpanel.com - Account -> Projects. 
account = mixpanelCreateAccount("ProjectName",
                                token="c12g3...",
                                secret="168e7e...", 
                                key="543c55...")
                                
mixpanelGetData(account, method="funnels/list/", args=list(), data=TRUE)

## End(Not run)

RMixpanel documentation built on May 1, 2019, 10:46 p.m.