Hi …i have zero to little coding experience but im not exceedingly stupid -
I want to build a new HR module in SuiteCRM that stores my users health data(the user is an employee) and a procedure to sync data with the users Google Fit Data Store. Google Fit offers a guide on how to GET the data from the Google Fit Store and the steps for the authentication process.Could you please give me the main steps to follow which i can then research the detail of.I will list what i perceive the steps to be and which of them i have an understanding of - please rectify where i have it wrong and if possible point me to good sources to learn ( for a beginner).
1.Building a SuiteCRM module (Fields,Labels,Relationships,Layouts and Subpanels) i understand almost perfectly.So we can work on the assumption that i have a SUITECRM module(call it the EmployeeFIT module) with the MYSQL backend that stores data like sleep patterns,activities,heartrate and nutritional intake…
2.Using the Google FIT API on the OAuth 2.0 Playground i have a fair idea how to produce the required output.Underneath this summary ive pasted the Google FIT API Output.My question then is what do i do to produce this in a format(like CSV) that can be readily imported into the MySQL database(automatically and scheduled)
3.Finally,if the above format is produced,how do i automatically(and scheduled again) import that into my SuiteCRM MySQL backend.
HTTP/1.1 200 OK
Content-length: 14078
X-xss-protection: 1; mode=block
Content-location: https://www.googleapis.com/fitness/v1/users/me/dataSources
X-content-type-options: nosniff
Transfer-encoding: chunked
Expires: Fri, 05 Oct 2018 09:52:51 GMT
Vary: Origin, X-Origin
Server: GSE
Etag: "977qOFam2oE2uMtwc7J4i3egnsw/2WlhzJAMLfIG5awQLsnBZtGmmNI"
Cache-control: private, max-age=0, must-revalidate, no-transform
Date: Fri, 05 Oct 2018 09:52:51 GMT
X-frame-options: SAMEORIGIN
Alt-svc: quic=":443"; ma=2592000; v="44,43,39,35"
Content-type: application/json; charset=UTF-8
-content-encoding: gzip
{
"dataSource": [
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "duration",
"format": "integer"
}
],
"name": "com.google.active_minutes"
},
"dataStreamName": "from_activity<-merge_activity_segments",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.active_minutes:com.google.android.gms:from_activity<-merge_activity_segments",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "duration",
"format": "integer"
}
],
"name": "com.google.active_minutes"
},
"dataStreamName": "from_steps<-merge_step_deltas",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.active_minutes:com.google.android.gms:from_steps<-merge_step_deltas",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "duration",
"format": "integer"
}
],
"name": "com.google.active_minutes"
},
"dataStreamName": "merge_active_minutes",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.active_minutes:com.google.android.gms:merge_active_minutes",
"type": "derived"
},
{
"dataStreamName": "detailed",
"dataType": {
"field": [
{
"name": "activity_confidence",
"format": "map"
}
],
"name": "com.google.activity.samples"
},
"dataQualityStandard": [],
"application": {
"packageName": "com.google.android.gms"
},
"device": {
"model": "PRA-LX2",
"version": "",
"type": "phone",
"uid": "a0fb6093",
"manufacturer": "HUAWEI"
},
"dataStreamId": "derived:com.google.activity.samples:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:detailed",
"type": "derived"
},
{
"dataStreamName": "phone_default_dnn_v14",
"dataType": {
"field": [
{
"name": "activity_confidence",
"format": "map"
}
],
"name": "com.google.activity.samples"
},
"dataQualityStandard": [],
"application": {
"packageName": "com.google.android.gms"
},
"device": {
"model": "PRA-LX2",
"version": "",
"type": "phone",
"uid": "a0fb6093",
"manufacturer": "HUAWEI"
},
"dataStreamId": "derived:com.google.activity.samples:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:phone_default_dnn_v14",
"type": "derived"
},
{
"dataStreamName": "phone_relabel_bicycle_to_unknown_with_wifi",
"dataType": {
"field": [
{
"name": "activity_confidence",
"format": "map"
}
],
"name": "com.google.activity.samples"
},
"dataQualityStandard": [],
"application": {
"packageName": "com.google.android.gms"
},
"device": {
"model": "PRA-LX2",
"version": "",
"type": "phone",
"uid": "a0fb6093",
"manufacturer": "HUAWEI"
},
"dataStreamId": "derived:com.google.activity.samples:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:phone_relabel_bicycle_to_unknown_with_wifi",
"type": "derived"
},
{
"dataStreamName": "smd_gouda",
"dataType": {
"field": [
{
"name": "activity_confidence",
"format": "map"
}
],
"name": "com.google.activity.samples"
},
"dataQualityStandard": [],
"application": {
"packageName": "com.google.android.gms"
},
"device": {
"model": "PRA-LX2",
"version": "",
"type": "phone",
"uid": "a0fb6093",
"manufacturer": "HUAWEI"
},
"dataStreamId": "derived:com.google.activity.samples:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:smd_gouda",
"type": "derived"
},
{
"dataStreamName": "software_tilt_froyo",
"dataType": {
"field": [
{
"name": "activity_confidence",
"format": "map"
}
],
"name": "com.google.activity.samples"
},
"dataQualityStandard": [],
"application": {
"packageName": "com.google.android.gms"
},
"device": {
"model": "PRA-LX2",
"version": "",
"type": "phone",
"uid": "a0fb6093",
"manufacturer": "HUAWEI"
},
"dataStreamId": "derived:com.google.activity.samples:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:software_tilt_froyo",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "activity",
"format": "integer"
}
],
"name": "com.google.activity.segment"
},
"dataStreamName": "session_activity_segment",
"application": {
"packageName": "com.google.android.apps.fitness"
},
"dataStreamId": "derived:com.google.activity.segment:com.google.android.apps.fitness:session_activity_segment",
"type": "derived"
},
{
"dataStreamName": "activity_from_steps",
"dataType": {
"field": [
{
"name": "activity",
"format": "integer"
}
],
"name": "com.google.activity.segment"
},
"dataQualityStandard": [],
"application": {
"packageName": "com.google.android.gms"
},
"device": {
"model": "PRA-LX2",
"version": "",
"type": "phone",
"uid": "a0fb6093",
"manufacturer": "HUAWEI"
},
"dataStreamId": "derived:com.google.activity.segment:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:activity_from_steps",
"type": "derived"
},
{
"dataStreamName": "from_activity_samples<-derived:com.google.activity.samples:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:detailed",
"dataType": {
"field": [
{
"name": "activity",
"format": "integer"
}
],
"name": "com.google.activity.segment"
},
"dataQualityStandard": [],
"application": {
"packageName": "com.google.android.gms"
},
"device": {
"model": "PRA-LX2",
"version": "",
"type": "phone",
"uid": "a0fb6093",
"manufacturer": "HUAWEI"
},
"dataStreamId": "derived:com.google.activity.segment:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:from_activity_samples<-derived:com.google.activity.samples:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:detailed",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "activity",
"format": "integer"
}
],
"name": "com.google.activity.segment"
},
"dataStreamName": "merge_activity_segments",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.activity.segment:com.google.android.gms:merge_activity_segments",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "activity",
"format": "integer"
}
],
"name": "com.google.activity.segment"
},
"dataStreamName": "platform_activity_segments",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.activity.segment:com.google.android.gms:platform_activity_segments",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "activity",
"format": "integer"
}
],
"name": "com.google.activity.segment"
},
"dataStreamName": "session_activity_segment",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.activity.segment:com.google.android.gms:session_activity_segment",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "calories",
"format": "floatPoint"
}
],
"name": "com.google.calories.consumed"
},
"dataStreamName": "merge_calories_consumed",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.calories.consumed:com.google.android.gms:merge_calories_consumed",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "calories",
"format": "floatPoint"
}
],
"name": "com.google.calories.expended"
},
"dataStreamName": "from_activities",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.calories.expended:com.google.android.gms:from_activities",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "calories",
"format": "floatPoint"
}
],
"name": "com.google.calories.expended"
},
"dataStreamName": "from_bmr",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.calories.expended:com.google.android.gms:from_bmr",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "calories",
"format": "floatPoint"
}
],
"name": "com.google.calories.expended"
},
"dataStreamName": "merge_calories_expended",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.calories.expended:com.google.android.gms:merge_calories_expended",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "calories",
"format": "floatPoint"
}
],
"name": "com.google.calories.expended"
},
"dataStreamName": "platform_calories_expended",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.calories.expended:com.google.android.gms:platform_calories_expended",
"type": "derived"
},
{
"dataStreamName": "derive_step_deltas<-raw:com.google.step_count.cumulative:HUAWEI:PRA-LX2:a0fb6093:step counter",
"dataType": {
"field": [
{
"name": "steps",
"format": "integer"
}
],
"name": "com.google.step_count.delta"
},
"dataQualityStandard": [],
"application": {
"packageName": "com.google.android.gms"
},
"device": {
"model": "PRA-LX2",
"version": "",
"type": "phone",
"uid": "a0fb6093",
"manufacturer": "HUAWEI"
},
"dataStreamId": "derived:com.google.step_count.delta:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:derive_step_deltas<-raw:com.google.step_count.cumulative:HUAWEI:PRA-LX2:a0fb6093:step counter",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "steps",
"format": "integer"
}
],
"name": "com.google.step_count.delta"
},
"dataStreamName": "estimated_steps",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.step_count.delta:com.google.android.gms:estimated_steps",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "steps",
"format": "integer"
}
],
"name": "com.google.step_count.delta"
},
"dataStreamName": "merge_step_deltas",
"application": {
"packageName": "com.google.android.gms"
},
"dataStreamId": "derived:com.google.step_count.delta:com.google.android.gms:merge_step_deltas",
"type": "derived"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"optional": true,
"name": "duration",
"format": "integer"
}
],
"name": "com.google.active_minutes"
},
"dataStreamName": "user_input",
"application": {
"packageName": "com.google.android.apps.fitness"
},
"dataStreamId": "raw:com.google.active_minutes:com.google.android.apps.fitness:user_input",
"type": "raw"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "activity",
"format": "integer"
}
],
"name": "com.google.activity.segment"
},
"dataStreamName": "user_input",
"application": {
"packageName": "com.google.android.apps.fitness"
},
"dataStreamId": "raw:com.google.activity.segment:com.google.android.apps.fitness:user_input",
"type": "raw"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "calories",
"format": "floatPoint"
}
],
"name": "com.google.calories.consumed"
},
"dataStreamName": "",
"application": {
"packageName": "com.fatsecret.android"
},
"dataStreamId": "raw:com.google.calories.consumed:com.fatsecret.android:",
"type": "raw"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "calories",
"format": "floatPoint"
}
],
"name": "com.google.calories.expended"
},
"dataStreamName": "",
"application": {
"packageName": "com.fatsecret.android"
},
"dataStreamId": "raw:com.google.calories.expended:com.fatsecret.android:",
"type": "raw"
},
{
"dataStreamName": "raw_sensor",
"dataType": {
"field": [
{
"name": "sensor_type",
"format": "integer"
},
{
"name": "timestamps",
"format": "integerList"
},
{
"name": "sensor_values",
"format": "floatList"
}
],
"name": "com.google.sensor.events"
},
"dataQualityStandard": [],
"application": {
"packageName": "com.google.android.gms"
},
"device": {
"model": "PRA-LX2",
"version": "",
"type": "phone",
"uid": "a0fb6093",
"manufacturer": "HUAWEI"
},
"dataStreamId": "raw:com.google.sensor.events:com.google.android.gms:HUAWEI:PRA-LX2:a0fb6093:raw_sensor",
"type": "raw"
},
{
"dataQualityStandard": [],
"dataType": {
"field": [
{
"name": "steps",
"format": "integer"
}
],
"name": "com.google.step_count.cumulative"
},
"dataStreamName": "step counter",
"device": {
"model": "PRA-LX2",
"version": "",
"type": "phone",
"uid": "a0fb6093",
"manufacturer": "HUAWEI"
},
"dataStreamId": "raw:com.google.step_count.cumulative:HUAWEI:PRA-LX2:a0fb6093:step counter",
"type": "raw"
}
]
}