Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve data from microsoft health API

I am trying to access my account in microsoft health api. I have followed the steps in order to access access token. What I am wandering is what is the final steps in order to get information of my account? I have several parameters defined, I have a redirect URI an access token, secret code, user id, scope. How can I use them in order to get access to my account data?

How can authenticate my account using the access token I received in previous steps, in order to get access to the API?

In the document there is the following example for a valid GET request:

GET /v1/me/Profile HTTP/1.1 
Authorization: bearer EwCoAvF0BAAUkWhN6f8bO0+=

What request should I have to perform. I am not sure that I understand the example. I am trying to do:

http://myurl.com/v1/me/Profile HTTP/1.1 
Authorization: bearer "access token"

However I am receiving a message

page not found

.

like image 244
Jose Ramon Avatar asked Feb 12 '16 14:02

Jose Ramon


1 Answers

Microsoft Health API

Is accessed via JSON Get requests, depending on the information you would do something like this

var url = "http://baseapiurl/v1/me/Activities";

using (var webClient = new System.Net.WebClient()) {
    var json = webClient.DownloadString(url);

    // This will give a response that can be parsed using a JSON library
}

Microsoft Health API

like image 126
Victor Procure Avatar answered Nov 07 '22 09:11

Victor Procure