RESTful API, Javascript, and FatSecret API

Permalink
Hello C5 community!

Once again I seek help with an issue I am facing that I don't know where to start to attempt to resolve it.

I am working on building a site for a client using Concrete5 and we found a web API called FatSecret (located athttp://platform.fatsecret.com/api/)... which is a platform used to track fitness and eating goals.

What I am able to accomplish:
Following the instructions provided in the Javascript documentation for the API, I am able to get as far as getting the application to load on the page using a Javascript script tag provided by the platform here.http://platform.fatsecret.com/api/Default.aspx?screen=jsapiqs...

What I am unable to accomplish:
Once I placed the script in an HTML block, it popped up right away. The problem that I am currently having is what I need to do after that. I am attempting to set this API up where users can navigate to the page and when it prompts to login, have them be able to have a local account on our site but have it connected to this API.

Any help or direction would be most welcome. I am still new to Concrete5 so obviously I'm still learning but I don't know what I could be doing wrong.

To show what I have so far, my C5 test environment can be found at:
http://c5test.chaseyourgoals.org/...

and the page is under the Navigation as "Fat Secret"

Thank you all in advance for any advice, insight, etc. that you can provide.

 
thephilm replied on at Permalink Reply
thephilm
Probably want to take a look at using REST -
Here's a quick tutorial I foundhttp://www.altinkonline.nl/tutorials/concrete5/make-a-rest-interfac...

Also - the documentation should give you some insights into what data is available. For example - if I want to show the client's current weight, I could use the profile.get (http://platform.fatsecret.com/api/Default.aspx?screen=rapiref&method=profile.get) and it will return things like last recorded weight, goal weight etc.
You can also push updates using weight.update (http://platform.fatsecret.com/api/Default.aspx?screen=rapiref&method=weight.update)

If you continue down this route, you are basically replicating the interface they've setup on their site.
If you are just trying to replicate their platform, using their API, then I'd go with the "manually loaded (user-specified initialization) Seen herehttp://platform.fatsecret.com/api/Default.aspx?screen=jsapisc...
<script src="http://platform.fatsecret.com/js?key=a8abdcd07de245fbb88c930cb2019b79"></script>
      <script>
         function doLoad(){
            fatsecret.setContainer("my_container");
            fatsecret.setCanvas("home");
         }
      </script>


Results here:http://platform.fatsecret.com/api/static/sample/simple/simple2.html...
leejamison replied on at Permalink Reply
Thank you for the clarification! The information you have provided has certainly cleared most of my confusion up. However, I do have two questions that I hope you would be able to assist in answering or at least shed some light on if you wouldn't mind.

1.) Would I have to specify specific override code for EVERY instance as you have displayed in your reply?

2.) My primary concern with this project I'm having issues with is user authentication. If possible, the ideal setup would be some sort of transparent single sign-on for users (i.e. they navigate to our page, login to our site and then if they click on the FatSecret page their FatSecret account would already be logged in). Is something like this even reasonable possible?

Words cannot express how thankful I am for any assistance.