How to make an API?

I am looking for tutorial/book which tells a noob that how to make an
API (with unique private keys and stuff) of a rails app.

Can you rephrase the question? I'm guessing one of the reasons you've received no replies is that it's not at all clear what you're really looking for.
If you're simply looking to get started with Rails, there are many good replies in the archives of this list.

But an API of a Rails app, with or without unique private keys and stuff, doesn't really make sense to me.

George Bailey wrote: