How can we get and use an existing user's user_id in order to make API calls without having to use 3-legged oauth authentication?

116 views
Skip to first unread message

Shahryar

unread,
Jul 9, 2014, 5:13:21 PM7/9/14
to fatsecret-p...@googlegroups.com
I am working on developing a web application that uses FatSecret data.  But I am stuck and was hoping to get some help. 

This is the question we are asking: "How can we use an existing user's account to get their user_id in order to make API calls without having to use 3-legged oauth authentication?"

Here is the background:

I hired a developer off elance who had worked with APIs to help me get started.  He was able to create a developer FatSecret account and do a data call to Fat Secret to pull in data for food:
http://dev.healthfullu.com/example/fatsecret.php

But we are struggling at the last part of his deliverable which is to extract food diary data for a user, store what's allowable into a database, and then pull that stored data to use as reference to get complete Food Diary information for a user for a specfic time period. 

He wants to use the profile.get_auth method to retrieve the user's  oauth_token  and oauth_secret, but this method takes user_id as parameter.  We don't know how to get my wife's user_id, we just know her accountname, which isn't a valid parameter to send.

He is saying that he cannot work with the full 3-legged OAuth provided by FatSecret.com because it would be too tedious. 

As he understands it, we need to create a user ID for every user who uses our application and FatSecret will take this user ID as input.  But for existing users, the 3-legged OAUTH authentication must be used. 

I'm ok with us creating our own user just for this preliminary work and later working with 3-legged OAUTH to get real existing user data.  But my developer is saying that he doesn't know if we could use our created user to populate food diary data in for.  Also, he worries that we will just know the username, password and display name for the newly created account, not the user_id.  He is also worried that we may actually not even get a username or password for it because this is designed more for user_id creation on the go. 
What's really confusing him is that there is no open source library in PHP which could be used.  So everything has to be done from scratch. 

Also because the APIs of FatSecret are very different from the ones he is familiar with.  For example, with Google, you easily create a GET/POST request with some parameters of your own and some from earlier Google requests.  You can then send the request to Google to get next-level authentication token.  But with FatSecret, even constructing a single
may get you stuck for hours (http://platform.fatsecret.com/api/Default.aspx?screen=rapitlsa#request_token )
Reply all
Reply to author
Forward
0 new messages