W J
W J

Reputation: 31

Downloading Event Logs using the API

When downloading Event Logs, is it possible to get them using the API instead of downloading them via the Download CSV button on a web browser?

Is there an API for which it is possible among the URLs below? https://developer.yahoo.com/flurry/docs/api/code/analyticsapi/

Also, if you plan to add it in the future, please let me know when it is scheduled for completion.

I appreciate your assistance.

Upvotes: 3

Views: 714

Answers (2)

Anton  Malmygin
Anton Malmygin

Reputation: 3496

As of moment of writing, Flurry now provides Raw Data Download API, so you can retrive your raw event's data on a periodic basis (but within some limitations - time windows must be less than 1 month, data preparation takes some time, etc.)

Simplified workflow is following:

1. Setup

First of all, you must generate a Programmatic Token (discrabed here https://developer.yahoo.com/flurry/docs/api/code/apptoken/, process is straightforward, except that you'll need to create another user with different role in order to use this token)

2. Making the Request

Specify startTime/endTime for desired time window inside request (within other parameters):

curl -X POST   https://rawdata.flurry.com/pulse/v1/rawData
   -H 'accept: application/vnd.api+json'
   -H 'authorization: Bearer ~~YOUR TOKEN~~'
   -H 'cache-control: no-cache'
   -H 'content-type: application/vnd.api+json'
   -d '{"data": {
         "type": "rawData",
         "attributes": {
         "startTime": "1511164800000",
     "endTime": "1511251199000",
     "outputFormat": "JSON",
           "apiKey": "AAAA1111BBBB2222CCCC"
       }
     }
   }'

If your request was successful (requestStatus equals Acknowledged inside response body), save the id value from response.

3. Checking for data preparation status

Depending on complexity of your app and requested time window, data preparation make take about 30 minutes up to a few hours to be prepared.

You can check status by using:

curl -g https://rawdata.flurry.com/pulse/v1/rawData/26?fields[rawData]=requestStatus,s3URI
   -H ‘accept: application/vnd.api+json;’
   -H ‘authorization: Bearer ~~YOUR TOKEN~~’
   -H ‘cache-control: no-cache’
   -H ‘content-type: application/vnd.api+json;’

As soon as your data is ready, response will be following:

{
   "data":{
      "type":"rawData",
      "id":"26",
      "attributes":{
         "requestStatus":"Success",
         "s3URI":"https://flurry-rdd.s3.amazonaws.com/downloads/26.JSON.gz?AWSAccessKeyId=AAAA1111BBBB2222CCCC&Expires=1513101235&Signature=h%2FChXRi5QwmvhUrkpwq2nVKf8sc%3D"
      }
   }
}

Save s3URI for next step.

4. Retrieving Results

Now you can retrieve archived raw data by using s3URI:

curl -O https://flurry-rdd.s3.amazonaws.com/downloads/26.JSON.gz?AWSAccessKeyId=AAAA1111BBBB2222CCCC&Expires=1513039053&Signature=xbKNnTgpv1odAfVgPRLMyck8UnE%3D

Source: https://developer.yahoo.com/flurry/docs/analytics/rdd/

Upvotes: 1

ham22ham
ham22ham

Reputation: 106

There is no API for get Event Logs(raw data) as far as I know.

Workaround:

Downloading Event Logs CSV can be done something like this with some additional touch. That implementation is for previous version.

After Flurry's renovation at 3/27/2017,

  • Log in via GET /auth/v1/session with credentials
  • Get 'flurry-auth-token' from GET /auth/v1/authorize
  • Call GET ../eventLogCsv with 'flurry-auth-token' to download CSV

I'm a user of Flurry. And hope they support this feature via API soon.

Upvotes: 2

Related Questions