Episode 548: Analytics API Request In Monday Morning (3)

Sunday, August 13, 2017

Analytics tells 'particular building company is in trouble'?

In the last article and the one before the last, I introduced you (nearly unmanned) Workflows that informs "trends of web access of the last week" to in-house.

Once this business process is in operation, employees will be able to check the latest information obtained through the "Google Analytics Reporting API" every Monday morning by e-mail. As the result, daily work for "Customer support" or "Sales" will be more efficient.

However, it might be better if "Information that is not in Analytics" is written as well. That is, it may be possible to gain deeper understanding and insight on trend information such as "links that a lot of inflows" and "Pages that referred by specific customers", if it also has included information which is not in Analytics such as;
  • 'delivered a press release on last Tuesday'
  • 'held a user seminar on last Thursday (in which the particular building company participated!)'.

API acquisition of calendar information as well

The following Business Process Definition is a mechanism in which information of the events of last week, that have been written in the in-house calendar for "Public relations schedule and exhibition schedule" (Google Calendar), is added to the email notification.

When operating this Workflow, employees who would receive notification emails will be able to see "related information that may have affected Web access" at the same time.

[Website Operation Report 3]

Information gathering via API

The Step of "Request to Calendar" is an automatic Step to get a list of "events" registered on a certain Google Calendar. (Google Calendar API v3)

<Config items of Auto-step>
  • Configuration name of Communication permission
  • Calendar ID to be subject of information acquisition
  • Period for information acquisition (Name of Date type data item in which Start date is stored)
  • Period for information acquisition (Name of Date type data item in which End date is stored)
  • Time Zone
  • Name of String type data item in which output data to be stored
<Example of Data output>
  • 2017-05-03 (--:--): Constitution Memorial Day
  • 2017-05-04 (--:--): Greenery Day
  • 2017-05-05 (--:--): Children's Day
  • 2017-07-21 (16:00): Board meeting
  • 2017-07-28 (09:30): Weekly meeting

That is, when an Issue reaches this Step, the Workflow system (Questetra, etc.) will throw a secure request (OAuth 2 communication) to "Events resource" of Calendar API v3. Then, information of "Start.DateTime information" ("Start.Date" in case of all day event) and "summary" (event title) in the response information (JSON data) will be extracted and stored into String type data item (multiple-lines).

* Even though it is often believed that for using API is "requiring programming knowledge", it is possible for anyone to build an automatic system simply by placing "Automatic Steps" on the Business Flow Diagram and setting only a few items.

"Utilizing API" will be at the same level as "utilizing email"?

All API use of this Business Process is simply acquiring "data owned by own company" (free of course).

However, it can be said that automatic aggregation of own company data will be the first step of future expansion such as;
  • acquiring "data owned by other company"
  • acquiring "own company data processed by another company"

In recent years the term "API economy" has come to be heard, various procedures are being automated by the API, such as
  • Taxi reservation
  • Hotel booking
  • Money remittance
  • Information sharing within the community
  • Numericalization of Speaker Emotions in Conversational Sentences
  • Drafting answer sentences replying to question sentences

In the future era, API may become "a tool that can be naturally utilized." (Improve internal work with API, increase customer satisfaction with API, etc.)

* Questetra is a platform that is capable of controlling various APIs. It contributes to API users.

Incidentally, if you are thinking about business development as [API provider] such as "providing information sources" or "providing information processing services", it can be said that you have to use more time for trend catching at a deeper level. In other words, you should check the deep level of widely used API in the world, in order to consider about an easy-to-use API. It may be like a "cable standard" in the manufacturing industry. (For example, the parameter name of "Request Query Parameters" or "Request Body Parameters")

* Reference for "Events: list"

<Communication part in "definition file" (Addon-XML) of automatic Step>
// Set API Request 
var apiRequest = httpClient.begin(); 
apiRequest.queryParam( "calendarId", calendarId ); 
apiRequest.queryParam( "orderBy", "startTime" ); 
apiRequest.queryParam( "singleEvents", "true" ); 
apiRequest.queryParam( "timeMax", endDate + "T23:59:59" + timezone ); // for request 
apiRequest.queryParam( "timeMin", startDate + "T00:00:00" + timezone ); 
apiRequest.queryParam( "timeZone", timezone ); // Time zone for response 

// Set OAuth2 Access Token 
var token = httpClient.getOAuth2Token( oauth2 ); 
apiRequest.bearer( token ); 

// API Access 
var accessLog = ""; 
var uri = "https://www.googleapis.com/calendar/v3/calendars/calendarId/events"; 
var response = apiRequest.get( uri ); 
var statusCode = response.getStatusCode() + ""; 
accessLog += "---GET request--- " + statusCode + "\n"; 
accessLog += response.getResponseAsString() + "\n"; 

[Website Operation Report 3:"1. Report preparation" screen]

[Data Items list]


[Free Download]
<Similar Models>
<<Related Articles>>

[Japanese Entry (ε’Œζ–‡θ¨˜δΊ‹)]