# Rails API best practices

**URL:** <https://www.ruby-forum.com/t/rails-api-best-practices/150571>\
**Category:** Rails\
**Created:** [October 10, 2008, 1:59am UTC](https://www.ruby-forum.com/t/rails-api-best-practices/150571 "2008-10-10T01:59:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arvias](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@arvias](https://www.ruby-forum.com/u/arvias)\
**Post date:** [October 10, 2008, 1:59am UTC](https://www.ruby-forum.com/t/rails-api-best-practices/150571/1 "2008-10-10T01:59:13Z")

</div>

Hi,

Is there a book or screencast or documentation that provides best  
practices for creating an API for a RoR application?

I have to build an API from scratch and I have no idea where to start.

–  
M.

---

<div class="post-metadata">

**Author:** ![arvias](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@arvias](https://www.ruby-forum.com/u/arvias)\
**Post date:** [October 10, 2008, 7:01am UTC](https://www.ruby-forum.com/t/rails-api-best-practices/150571/2 "2008-10-10T07:01:40Z")

</div>

If you haven’t read the docs for ActiveResource, I’d start there.

---

<div class="post-metadata">

**Author:** ![arvias](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@arvias](https://www.ruby-forum.com/u/arvias)\
**Post date:** [October 10, 2008, 12:23pm UTC](https://www.ruby-forum.com/t/rails-api-best-practices/150571/3 "2008-10-10T12:23:52Z")

</div>

> If you haven’t read the docs for ActiveResource, I’d start there.

One of the tasks of my project is that I have to create a PHP library  
that people can use to connect to this application.

Is there a library that implements a PHP - RoR XML connection?

–  
M.

---

<div class="post-metadata">

**Author:** ![arvias](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@arvias](https://www.ruby-forum.com/u/arvias)\
**Post date:** [October 10, 2008, 10:26pm UTC](https://www.ruby-forum.com/t/rails-api-best-practices/150571/4 "2008-10-10T22:26:11Z")

</div>

Hi Marcelo,

Marcelo B. wrote:

> Is there a book or screencast or documentation that provides  
> best practices for creating an API for a RoR application?
> 
> I have to build an API from scratch and I have no idea where  
> to start.

I highly recommend “RESTful Web Services”. Amazon has it  
[http://www.amazon.com/RESTful-Web-Services-Leonard-Richardson/dp/0596529260/](http://www.amazon.com/RESTful-Web-Services-Leonard-Richardson/dp/0596529260/)  
ref=pd\_bbs\_sr\_1?ie=UTF8&s=books&qid=1223669754&sr=1-1

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![arvias](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@arvias](https://www.ruby-forum.com/u/arvias)\
**Post date:** [October 10, 2008, 8:43pm UTC](https://www.ruby-forum.com/t/rails-api-best-practices/150571/5 "2008-10-10T20:43:36Z")

</div>

I haven’t seen one, but I haven’t looked. ActiveResource is (well,  
kind of) an object mapping framework from RoR to XML. I would start  
with the XML it generates, and build the PHP from there.
