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.

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.

6
  • 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?
    – abhink
    Commented Jan 30, 2015 at 22:21
  • I don't understand what you're asking. What do you mean by registering the methods? Commented Jan 31, 2015 at 3:28
  • 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.)
    – abhink
    Commented Jan 31, 2015 at 11:57
  • (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.
    – abhink
    Commented Jan 31, 2015 at 11:58
  • 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 Commented Feb 1, 2015 at 2:40

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.