Getting Started

Docs

Overview

Ambrosia BluCon has provide the OAuth 2.0 Authentication and HIPAA Authorization, where Developers can leverage this platform to create novel applications with BluCon data, including estimated glucose values and notes. The BluCon API is RESTful and utilizes the OAuth 2.0 standard for authentication, allowing individuals to securely authorize their BluCon data for use in third party applications. To Build any application using the Ambrosia's BluCon API, the application must have to register first for getiing it's client_id and client_secret.

Resource

"https://www.ambrosiasys.com/app"

 

Authentication

The BluCon API uses OAuth 2.0 to enable client applications to make requests on behalf of users. Users can authenticate themselves with BluCon and do not enter their login information into the client application directly. Users also authorize a specific scope of data that may be transferred from BluCon to the client application and can revoke the access at any time.

It is standard practice to use a pre-built OAuth 2.0 client library instead of writing one from scratch. Libraries are available for a wide variety of languages; many can be found at https://oauth.net/code/.

 

This walkthrough goes over the basics of the authentication process as it applies to the BluCon API but is not a comprehensive introduction to OAuth 2.0. The following references provide detailed information on the principles and implementation of OAuth 2.0:

Step One: User and Application Authentication

All applications have credentials that enable them to make requests. To obtain these credentials, register as a developer and create an app. New credentials are generated for each app and can be found in the app management section.

Resource

"GET /authentication"

Query Parameters

An application's client_secret should never be shared or distributed. If it is compromised, a new one may be generated in the app management section, which will immediately invalidate the old one.

Parameter

Description

client_id

The unique ID for the client application—similar to a username

client_secret

The secret for the client application—similar to a password

response_type

The OAuth 2.0 response type; currently, code is the only acceptable input

redirect_uri

The redirect URI associated with the application; must match the one specified in the app management section

userName

This is the LinkBluCon patient email_id. This will be entered by user in application.

password

This is the LinkBluCon patient password. This will be entered by user in application.

The Content-Type field in the header should be set to application/x-www-form-urlencoded

Here's an example of obtaining an access_token using the step one, which used for further HIPAA Authentication.

                                                        
                                                        
curl -X GET \
'https://www.ambrosiasys.com/app/authentication?client_id={your_client_id}&client_secret={your_client_secret}&response_type=code&redirect_uri={your_redirect_uri}&email={user_email_id}&password={user_password}' \
-H 'cache-control: no-cache'
                                                        
                                                        
var client = new RestClient("https://www.ambrosiasys.com/app/authentication?client_id={your_client_id}&client_secret={your_client_secret}&response_type=code&redirect_uri={your_redirect_uri}&email={user_email_id}&password={user_password}");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
IRestResponse response = client.Execute(request);
                                                        
                                                        
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://www.ambrosiasys.com/app/authentication?client_id={your_client_id}&client_secret={your_client_secret}&response_type=code&redirect_uri={your_redirect_uri}&email={user_email_id}&password={user_password}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("cache-control", "no-cache")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))                                                       


}
                                                        
                                                        
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
.url("https://www.ambrosiasys.com/app/authentication?client_id={your_client_id}&client_secret={your_client_secret}&response_type=code&redirect_uri={your_redirect_uri}&email={user_email_id}&password={user_password}")
.get()
.addHeader("cache-control", "no-cache")
.build();

Response response = client.newCall(request).execute();
                                                        
                                                        
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.ambrosiasys.com/app/authentication?client_id={your_client_id}&client_secret={your_client_secret}&response_type=code&redirect_uri={your_redirect_uri}&email={user_email_id}&password={user_password}",
"method": "GET",
"headers": {
"cache-control": "no-cache",
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
                                                        
                                                        
var http = require("http");

var options = {
"method": "GET",
"hostname": "https://www.ambrosiasys.com",
"path": "/app/authentication?client_id={your_client_id}&client_secret={your_client_secret}&response_type=code&redirect_uri={your_redirect_uri}&email={user_email_id}&password={user_password}",
"headers": {
"cache-control": "no-cache",
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
                                                        
                                                        
$request = new HttpRequest();
$request->setUrl('https://www.ambrosiasys.com/app/authentication');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
'client_id' => '{your_client_id}',
'client_secret' => '{your_client_secret}',
'response_type' => 'code',
'redirect_uri' => '{your_redirect_uri}',
'email' => '{user_email_id}',
'password' => '{user_password}'
));

$request->setHeaders(array(
'cache-control' => 'no-cache'
));

try {
$response = $request->send();

echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
                                                        
                                                        
import Foundation

let headers = [
"cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://www.ambrosiasys.com/app/authentication?client_id={your_client_id}&client_secret={your_client_secret}&response_type=code&redirect_uri={your_redirect_uri}&email={user_email_id}&password={user_password}")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})

dataTask.resume()
                                                        
                                                        
require 'uri'
require 'net/http'

url = URI("https://www.ambrosiasys.com/app/authentication?client_id={your_client_id}&client_secret={your_client_secret}&response_type=code&redirect_uri={your_redirect_uri}&email={user_email_id}&password={user_password}")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
                                                        
                                                        
import Foundation

let headers = [
"cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://www.ambrosiasys.com/app/authentication?client_id={your_client_id}&client_secret={your_client_secret}&response_type=code&redirect_uri={your_redirect_uri}&email={user_email_id}&password={user_password}")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})

dataTask.resume()

The response will look like:

{
    "response_type": "authorization_code",
    "scope": "offline",
    "access_token": "{your_access_token}"
}
                                            

The application enable the option for Hipaa Authrization.

Step Two: User Hipaa Authorization

On clicking of Hipaa Authorization button will allow you for second stage Authorization.

Resource

"GET /user_authorization"

Query Parameters

The query parameters are described below:

Parameter

Description

grant_type

To obtain an access token using an authorization code, use a grant type of access_token

code

The access_token obtained in Step one

signature

This is the LinkBluCon patient Full Name. This will be entered by user in application.

See the Authorization Request section of the RFC 6749 OAuth 2.0 Authorization Framework standard for more details on these parameters.

Upon successful authentication and authorization by the user, an HTTP 302 (redirect) will be returned, and the authorization_code will be get in your response. Extract the access_token from the response for use in the reading and notes API call. Note that the access_token is single-use and expires after another login. The optional state parameter will only be returned if it was used in further functionality.

If the user denies authotization in Step Two, then the redirect_uri will be redirected on Authentication step and It will not allow you for calling reading and notes API. If user creaditials is not valid than response is appended with ?error=access_denied instead of the authorization code.

The access_token acquired in Step one can now be exchanged for an access_token and a refresh_token. The endpoint used this access_token for the API call.

The Content-Type field in the header should be set to application/x-www-form-urlencoded

Here's an example of obtaining an access_token using the step Two, which used for further calling Reading and Notes API.

                                                        
                                                        
curl -X GET \
'https://www.ambrosiasys.com/app/user_authorization?grant_type=access_token&code={your_access_token}&signature={user_signature}' \
-H 'cache-control: no-cache'
                                                        
                                                        
var client = new RestClient("https://www.ambrosiasys.com/app/user_authorization?grant_type=access_token&code={your_access_token}&signature={user_signature}");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
IRestResponse response = client.Execute(request);
                                                        
                                                        
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://www.ambrosiasys.com/app/user_authorization?grant_type=access_token&code={your_access_token}&signature={user_signature}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("cache-control", "no-cache")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
                                                        
                                                        
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
.url("https://www.ambrosiasys.com/app/user_authorization?grant_type=access_token&code={your_access_token}&signature={user_signature}")
.get()
.addHeader("cache-control", "no-cache")
.build();

Response response = client.newCall(request).execute();
                                                        
                                                        
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.ambrosiasys.com/app/user_authorization?grant_type=access_token&code={your_access_token}&signature={user_signature}",
"method": "GET",
"headers": {
"cache-control": "no-cache"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
                                                        
                                                        
var http = require("http");

var options = {
"method": "GET",
"hostname": "https://www.ambrosiasys.com",
"path": "/app/user_authorization?grant_type=access_token&code={your_access_token}&signature={user_signature}",
"headers": {
"cache-control": "no-cache"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
                                                        
                                                        
$request = new HttpRequest();
$request->setUrl('https://www.ambrosiasys.com/app/user_authorization');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
'grant_type' => 'access_token',
'code' => '{your_access_token}',
'signature' => '{user_signature}'
));

$request->setHeaders(array(
'cache-control' => 'no-cache'
));

try {
$response = $request->send();

echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
                                                        
                                                        
import http.client

conn = http.client.HTTPConnection("https://www.ambrosiasys.com")

headers = {
'cache-control': "no-cache"
}

conn.request("GET", "/app/user_authorization?grant_type=access_token&code={your_access_token}&signature={user_signature}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
                                                        
                                                        
require 'uri'
require 'net/http'

url = URI("https://www.ambrosiasys.com/app/user_authorization?grant_type=access_token&code={your_access_token}&signature={user_signature}")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
                                                        
                                                        
import Foundation

let headers = [
"cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://www.ambrosiasys.com/app/user_authorization?grant_type=access_token&code={your_access_token}&signature={user_signature}")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})

dataTask.resume()

The response will look like:

{
    "access_token": "{your_access_token}",
    "token_type": "Bearer",
    "expires_in": 7200,
    "grant_type": "access_token"
}
                                            

The expires_in value is expressed in seconds.

GET /readings

The /readings endpoint enables retrieval of a user's glucose information, including reading time, reading, and reading unit. The response is an array of all glucose data which user has retrived by selcting the begin time and end time of the specified time window with the access_token of second stage Hippa authorization.

Resource

"GET /readings"

Query Parameters

These query parameters specify the time window for the requested data; both are required. Also required the access_token which is retrived from the second stage Hipaa Authorization.

Name

Type

Description

startDate

DateTime

Beginning of the time window

endDate

DateTime

End of the time window

The Content-Type field in the header should be set to application/x-www-form-urlencoded

Here's an example of obtaining an access_token using the step one, which used for further HIPAA Authentication.

                                                        
                                                        
curl -X GET \
'https://www.ambrosiasys.com/app/readings?begin_date=1536411001423&end_date=1536413701625' \
-H 'authorization: {your_access_token}' \
-H 'cache-control: no-cache'
                                                        
                                                        
var client = new RestClient("https://www.ambrosiasys.com/app/readings?begin_date=1536411001423&end_date=1536413701625");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "{your_access_token}");
IRestResponse response = client.Execute(request);
                                                        
                                                        
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://www.ambrosiasys.com/app/readings?begin_date=1536411001423&end_date=1536413701625"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("authorization", "{your_access_token}")
req.Header.Add("cache-control", "no-cache")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
                                                        
                                                        
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
.url("https://www.ambrosiasys.com/app/readings?begin_date=1536411001423&end_date=1536413701625")
.get()
.addHeader("authorization", "{your_access_token}")
.addHeader("cache-control", "no-cache")
.build();

Response response = client.newCall(request).execute();
                                                        
                                                        
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.ambrosiasys.com/app/readings?begin_date=1536411001423&end_date=1536413701625",
"method": "GET",
"headers": {
"authorization": "{your_access_token}",
"cache-control": "no-cache"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
                                                        
                                                        
var http = require("http");

var options = {
"method": "GET",
"hostname": "https://www.ambrosiasys.com",
"path": "/app/readings?begin_date=1536411001423&end_date=1536413701625",
"headers": {
"authorization": "{your_access_token}",
"cache-control": "no-cache"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
                                                        
                                                        
$request = new HttpRequest();
$request->setUrl('https://www.ambrosiasys.com/app/readings');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
'begin_date' => '1536411001423',
'end_date' => '1536413701625'
));

$request->setHeaders(array(
'cache-control' => 'no-cache',
'authorization' => '{your_access_token}'
));

try {
$response = $request->send();

echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
                                                        
                                                        
import http.client

conn = http.client.HTTPConnection("https://www.ambrosiasys.com")

headers = {
'authorization': "{your_access_token}",
'cache-control': "no-cache"
}

conn.request("GET", "/app/readings?begin_date=1536411001423&end_date=1536413701625", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
                                                        
                                                        
require 'uri'
require 'net/http'

url = URI("https://www.ambrosiasys.com/app/readings?begin_date=1536411001423&end_date=1536413701625")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = '{your_access_token}'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
                                                        
                                                        
import Foundation

let headers = [
"authorization": "{your_access_token}",
"cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://www.ambrosiasys.com/app/readings?begin_date=1536411001423&end_date=1536413701625")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})

dataTask.resume()

The response will look like:

{
    "readings": [
        {
        "reading": "73",
        "reading_time": "1536411301423"
        },
        {
        "reading": "73",
        "reading_time": "1536411601422"
        },
        {
        "reading": "73",
        "reading_time": "1536411901622"
        },
        {
        "reading": "73",
        "reading_time": "1536412201627"
        },
        {
        "reading": "73",
        "reading_time": "1536412501824"
        },
        {
        "reading": "73",
        "reading_time": "1536412801421"
        },
        {
        "reading": "73",
        "reading_time": "1536413101623"
        },
        {
        "reading": "73",
        "reading_time": "1536413401622"
        }
    ],
    "count": 8,
    "unit": "mmol/L"
}
                                            

Response Fields

The Response array fields are as follows
 

Name

Type

Description

reading

String

Glucose value of the patient.

reading_time

Long()

Reading time of particular glucose. It will be in milliseconds

unit

String

Reading unit such as mgdl or mmol. It should be based on patient settings.

GET /notes

The /notes endpoint enables retrieval of a user's Notes information, such as food, blood glucose, medicine, RAI, LAI and excercise type of data which user has stored as notes. The response is an array of all the notes data which user has retrived by selcting the begin time and end time of the specified time window with the access_token of second stage Hippa authorization.

Resource

"GET /notes"

Query Parameters

These query parameters specify the time window for the requested data; both are required. Also required the access_token which is retrived from the second stage Hipaa Authorization.

Name

Type

Description

startDate

DateTime

Beginning of the time window

endDate

DateTime

End of the time window

The Content-Type field in the header should be set to application/x-www-form-urlencoded

Here's an example of obtaining an access_token using the step one, which used for further HIPAA Authentication.

                                                        
                                                        
curl -X GET \
'https://www.ambrosiasys.com/app/notes?begin_date=1530616257239&end_date=1530616257239' \
-H 'authorization: {your_access_token}' \
-H 'cache-control: no-cache'
                                                        
                                                        
var client = new RestClient("https://www.ambrosiasys.com/app/notes?begin_date=1530616257239&end_date=1530616257239");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "{your_access_token}");
IRestResponse response = client.Execute(request);
                                                        
                                                        
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://www.ambrosiasys.com/app/notes?begin_date=1530616257239&end_date=1530616257239"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("authorization", "{your_access_token}")
req.Header.Add("cache-control", "no-cache")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
                                                        
                                                        
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
.url("https://www.ambrosiasys.com/app/notes?begin_date=1530616257239&end_date=1530616257239")
.get()
.addHeader("authorization", "{your_access_token}")
.addHeader("cache-control", "no-cache")
.build();

Response response = client.newCall(request).execute();
                                                        
                                                        
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.ambrosiasys.com/app/notes?begin_date=1530616257239&end_date=1530616257239",
"method": "GET",
"headers": {
"authorization": "{your_access_token}",
"cache-control": "no-cache"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
                                                        
                                                        
var http = require("http");

var options = {
"method": "GET",
"hostname": "https://www.ambrosiasys.com",
"path": "/app/notes?begin_date=1530616257239&end_date=1530616257239",
"headers": {
"authorization": "{your_access_token}",
"cache-control": "no-cache",
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
                                                        
                                                        
$request = new HttpRequest();
$request->setUrl('https://www.ambrosiasys.com/app/notes');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
'begin_date' => '1530616257239',
'end_date' => '1530616257239'
));

$request->setHeaders(array(
'cache-control' => 'no-cache',
'authorization' => '{your_access_token}'
));

try {
$response = $request->send();

echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
                                                        
                                                        
import http.client

conn = http.client.HTTPConnection("https://www.ambrosiasys.com")

headers = {
'authorization': "{your_access_token}",
'cache-control': "no-cache"
}

conn.request("GET", "/app/notes?begin_date=1530616257239&end_date=1530616257239", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
                                                        
                                                        
require 'uri'
require 'net/http'

url = URI("https://www.ambrosiasys.com/app/notes?begin_date=1530616257239&end_date=1530616257239")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = '{your_access_token}'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
                                                        
                                                        
import Foundation

let headers = [
"authorization": "{your_access_token}",
"cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://www.ambrosiasys.com/app/notes?begin_date=1530616257239&end_date=1530616257239")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})

dataTask.resume()

The response will look like:

{
    "notes": [
        {
            "note": "4",
            "blood_glucose": "0",
            "unit": "mg/dL",
            "food": "0",
            "carbs_servings": "0",
            "RAI": "0",
            "LAI": "0",
            "excercise": "0",
            "exc_time": null,
            "comments": "test",
            "date_time": "1526016967065",
            "medicine": null
        },
        {
            "note": "3",
            "blood_glucose": "0",
            "unit": "mg/dL",
            "food": "0",
            "carbs_servings": "0",
            "RAI": "0",
            "LAI": "0",
            "excercise": "0",
            "exc_time": "8:0",
            "comments": null,
            "date_time": "1526017219236",
            "medicine": null
        },
        {
            "note": "5",
            "blood_glucose": "60",
            "unit": "mg/dL",
            "food": "0",
            "carbs_servings": "0",
            "RAI": "0",
            "LAI": "0",
            "excercise": "0",
            "exc_time": null,
            "comments": null,
            "date_time": "1526017235614",
            "medicine": null
        },
        {
            "note": "1",
            "blood_glucose": "0",
            "unit": "mg/dL",
            "food": "0",
            "carbs_servings": "0",
            "RAI": "96",
            "LAI": "0",
            "excercise": "0",
            "exc_time": null,
            "comments": null,
            "date_time": "1526017243886",
            "medicine": null
        },
        {
            "note": "2",
            "blood_glucose": "0", 
            "unit": "mg/dL",
            "food": "0",
            "carbs_servings": "0",
            "RAI": "0",
            "LAI": "6",
            "excercise": "0",
            "exc_time": null,
            "comments": null,
            "date_time": "1526017256421",
            "medicine": null
        },
        {
            "note": "0",
            "blood_glucose": "0",
            "unit": "",
            "food": "1",
            "carbs_servings": "23",
            "RAI": "0",
            "LAI": "0",
            "excercise": "0",
            "exc_time": null,
            "comments": null,
            "date_time": "1528278241640",
            "medicine": null
        },
        ....
    ],
    "count": 8
}
                                            

Response Fields

The Response array fields are as follows
 

Name

Type

Description

note

String

It is type of note. If it value is 0 then it is the food type of note, 1 for RAI, 2 for LAI, 3 for for excercise, 4 for comments, 5 for blood glucose and 6 for medicine.

blood_glucose

String

It is the value of blood glucose.

unit

String

It is the value of Glucose Unit(mgdl or mmol).

food

String

It is the type of food. It it is breakfast then 0, 1 for lunch, 2 for snacks, 3 for dinner.

carbs_servings

String

It is the serving per plate or gram per plate. Define how much food you have take in terms of gram and servings.

RAI

String

It defines Insulin dose.

LAI

String

It defines Insulin dose.

excercise

String

It defines your exercise efficiency as high, low, or medium.

exc_time

String

Defines the how much time have you done the exercise.

comments

String

It defines the user added some extra or bookmark type of information.

date_time

Long

It defined the time of crated note(in milliseconds).

medicine

String

It defines the user added some medicine information, if he/she takes other than diabitic medicine.