Hi all, I'm currently close to releasing my first rails app. Many thanks to the countless people that have helped me with my questions on this forum. Couldn't have done it without you. So being close to release I started thinking of neat things I could do, like making an iphone app. I haven't tried making my own iphone app yet and don't look too forward to it honestly. So I was thinking of making an API for my rails app and let others with more experience than me give it a shot. In theory an API shouldn't be too hard but I wanted to get the opinion of others. I've tried googling for this but there seems to be no good posts that I can find. Many thanks for any advice/suggestions. -Tony
on 2009-02-03 02:07
on 2009-02-03 06:57
What does your Rails application do that other developers will be interested in? If you have some neat functionality that you want others to use as a library, then release it as a gem. If your entire application does something wonderful, put in a SOAP or REST interface to it so it can be hosted as a web service. I fail to see the connection between an iPhone application and the Rails application. An iPhone application does give you a wider audience thanks to the app store. So it is worth a shot if you a have a good idea for an application.
on 2009-02-03 07:39
Really? Maybe updates? Maybe it's a game that has a 3d client for it? ;) lots Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/
on 2009-02-03 12:42
> So being close to release I started thinking of neat things I could do, > like making an iphone app. I haven't tried making my own iphone app yet > and don't look too forward to it honestly. So I was thinking of making > an API for my rails app and let others with more experience than me give > it a shot. So you have rails app that does CRUD operations and you would like to do those as well from a native mobile application instead than the browser. Did I get it? If so what I did is to implement my app restfully and use XML to execute the CRUD operations from the terminal. I didn't do the terminal implementation though... Is this close to what you were asking? Regards
on 2009-02-03 15:47
on 2009-02-03 16:53
I've done some quick searches on REST API as SOAP isn't recommended by the rails community. Came up with this site: http://hinchcliffe.org/archive/2008/01/10/16613.aspx I'll take a more in depth look later on. If anyone else has something to contribute, feel free! -Tony
on 2009-02-03 21:05
on 2009-02-03 21:21
Billee D. wrote: > Hopefully I am not misunderstanding your intent here, so please excuse > me if I am missing something. > Hi Billee and thank you for the help! So far I have all of that pretty much learned. My question (and maybe I'm misunderstanding this greatly) is how to make an API for native mobile apps to access. XML might be part of the answer but I'm not so sure about that. Most applications with an API require a key (usually a unique and random 16-26 character alphanumerical code) to confirm you are authorized to access the account. I'm sure this key could be substituted by a username and password (like twitterific for example). Once this native mobile app is authorized to access the account it can do pretty much anything someone on the website is allowed to do. Create, Remove, Update, and Destroy (CRUD) operations and access some custom actions as well such as adding friends. Thanks. -Tony
on 2009-02-04 10:38
> Most applications with an API require a key (usually a unique and random > 16-26 character alphanumerical code) to confirm you are authorized to > access the account. I'm sure this key could be substituted by a username > and password (like twitterific for example). Once this native mobile app > is authorized to access the account it can do pretty much anything > someone on the website is allowed to do. Create, Remove, Update, and > Destroy (CRUD) operations and access some custom actions as well such as > adding friends. Hi, yeah keys are one option. I'm using restful_authentication and I modified the plugin by adding some methods to handle the XML calls from the mobile. Regarding the keys I actually reused the cookie functionality of the same plugin, so for the mobile I set a long expiration for the cookie and the client can use the API for as long that is valid (logged in). I don't have the code here but I could post my changes here, I would maybe get some feedback about my approach as well :-) As Billee D. mentioned adding the XML response featyre to the rails app is very simple and JSON is also a possibility. I think it also depends on what is easier to parse and consume for you on the terminal side. Cheers.