4

I'm working on an application running on Google App engine (python) with the frontend in AngularJS framework. The backend of this app simply returns the relevant data as JSON upon a GET for example, the URL routes for which are configured in the frontend (as services etc). That is, the standard CRUD operations are performed using the HTTP verbs, which i think is the main idea of a REST backend.

What i'd like to know is how is this backend different from a REST API? What i can make out by myself is that an API returns data similar to a response from a backend but it also sends more information about the various options/available actions the client has at any given moment. Is this the right idea? If so, how would you go about using this information? Wouldn't the application using this API become highly coupled with it?

And if i have to convert the REST backend to use the API, what benefits would i get. Docs about REST API say that it makes it easy for app on different platforms to access the data uniformly (like here). But the same thing can be done by a simple REST backend since the data itself is platform agnostic and as long as we can write a frontend to handle the data properly on each platform.

asked Jan 29, 2015 at 21:29

1 Answer 1

6

If it's a REST service that's only used by a single application I'd typically call that a back-end. If it's shared for multiple applications I'd probably call it an API. Really it's two different names for the same thing.

answered Jan 29, 2015 at 21:40

6 Comments

OK. What i understand here is that the only difference is the manner in which the backend or the API are registered? With a simple REST backend, we use url's with different http methods defined on them. With the API, we register the methods that the API provides. But there is the concept that API's are discoverable. How does that work if we still have to refer to the API docs and register the methods manually?
I don't understand what you're asking. What do you mean by registering the methods?
Sorry about the confusing wording. What i mainly meant was that when a REST backend is used, every http request to a resource returns, say a json object, that contains only the relevant data. So a query to /users would result in a json array having user objects. With an API, a response also contains information about the methods available to the client. (cont.)
(cont.) So the client can parse the response, get the required data and perform further actions based on the api related information sent along with data in the response. So my question was, how does a client know what fields to parse in the response object that would yield the information about other http actions that server allows the client.
An API won't necessarily send back any other information. For example, the basecamp API call to get /messages will just return an array of messages, no other information about other available actions or anything. See github.com/basecamp/bcx-api/blob/master/sections/messages.md
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.