10-18-2018 01:05 - edited 10-18-2018 01:06
10-18-2018 01:05 - edited 10-18-2018 01:06
Last year I made an app that used fitbit data and the tutorial page was very easy to follow.
Now it has changed and I am unsure how to use the curl data given to me to complete my request.
At the moment I get an unauthorized error in my code, and I think that is because I am not setting the client id and secret id with the request.
Can anyone help me?
string url = secret.ajaxUrl;
WebRequest myReq = WebRequest.Create(url);
string credentials = secret.clientID + ":" + secret.secretID;
CredentialCache mycache = new CredentialCache();
myReq.Headers["Authorization"] = "Basic " + CODE;
myReq.ContentType = "application/x-www-form-urlencoded";
WebResponse wr = myReq.GetResponse();
Stream receiveStream = wr.GetResponseStream();
StreamReader reader = new StreamReader(receiveStream, Encoding.UTF8);
string content = reader.ReadToEnd();
10-24-2018 12:29
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
10-24-2018 12:29
Hi @impo,
I'll be happy to clarify the OAuth process for you. Are there certain pieces of the curl command that you need clarified?
Gordon
Best Answer10-24-2018 18:08
10-24-2018 18:08
Hi @Gordon-C,
Thanks for the reply!
But I managed to get it working. just don't ask how because I don't know what I did
I did a lot of digging through the forums and found a nearly working example I was able to edit enough to get the returns I needed.
Best Answer10-24-2018 20:17
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
10-24-2018 20:17
Congrats! Thanks for the update. Please use the forums again if you have further questions.
Gordon
Best Answer