Hi all,
So, after reading the post by "lost" and the replies and Donna's
effort to help (appreciated) Im kind of in the same boat here and
perhaps i can explain why and maybe even have someone explain why not.
Kind of feels to me after reading a ton of oauth stuff on the web...
that there are very few people who actually understand what the hell
they are doing, and a whole lot that are just parroting the same thing
someone else printed.
Personally, im a vbscript guy and am writing a site in classic ASP
that will simply use a couple of php modules to send/retrieve data
from fat secret API..
Myself, knowing very little php ive run into pretty much a brick wall
using the fatsecret sample code.
However, using this handy test client
http://term.ie/oauth/example/client.php
I am able to return full xml on simple request IE food id and recipe
id using basic querystring and info from my config.
IE Endpoint:
http://platform.fatsecret.com/rest/server.api?method=recipes.search&recipe.id=91&page_number=5
with my consumer key and my consumer secret returns a nice happy xml
feed of the data i asked for.
Viewing a dump of that request shows me:
request url:
http://platform.fatsecret.com/rest/server.api?method=recipes.search&oauth_consumer_key=xxx&oauth_nonce=3b7d40b26393ac668296e9d3b4add48f&oauth_signature=x9OnSZCcQqN0WB2%2FIT6sreDZ97g%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1257736081&oauth_version=1.0&page_number=5&recipe_id=91
OAuthRequest Object
(
[parameters:OAuthRequest:private] => Array
(
[oauth_version] => 1.0
[oauth_nonce] => 3b7d40b26393ac668296e9d3b4add48f
[oauth_timestamp] => 1257736081
[oauth_consumer_key] => xxxx
[method] => recipes.search
[recipe_id] => 91
[page_number] => 5
[oauth_signature_method] => HMAC-SHA1
[oauth_signature] => x9OnSZCcQqN0WB2/IT6sreDZ97g=
)
[http_method:OAuthRequest:private] => GET
[http_url:OAuthRequest:private] =>
http://platform.fatsecret.com/rest/server.api?method=recipes.search&recipe.id=91&page_number=5
[base_string] => GET&http%3A%2F%
2Fplatform.fatsecret.com%2Frest
%2Fserver.api&method%3Drecipes.search%26oauth_consumer_key%xxxx
%26oauth_nonce%3D3b7d40b26393ac668296e9d3b4add48f
%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp
%3D1257736081%26oauth_version%3D1.0%26page_number%3D5%26recipe_id%3D91
)
so it appears that googles oauth test code is talking fine with
fatsecret API
Here is where i go south.
I need to access and use a few of the REST api methods that require an
oauth token: IE:
http://platform.fatsecret.com/api/Default.aspx?screen=rapiref&method=profile.get
so i try to send
http://platform.fatsecret.com/rest/server.api?method=profile.get&id=11
(where 11 is one of my users)
all i get is an error for a missing token...which makes sense since
there is freaking way to create a token ;)
I assume i need another function to run that runs the signature
generating string again after recieving the signature and this creates
a token i send back again?
So... all that mumbo jumbo aside...
Let me ask this in plain english,
Does ANYONE have a page of sample code that shows both a function to
access a fatscret oauth (token required) method and a function for
running / retrieving / accessing / tokenizing in order to return token
protected info?
lol...yah..that was plain english... :)
Is there a rule against people posting working code examples of using
Oauth with fs?
if no one can help or doesnt want to help here...
Can you point me to someone i might HIRE to write up the queries and
configs i will need?
im kind of up against it, searched hi and low for a dietary database
to use for a client and fatsecret is a godsend as far as how close it
is to what i need... but since i can t use the javascript api by
itself i MUST find a way to pull some user activity out of profiles to
print back to my site.
Thanks in advance to anyone who can help.