Representational state transfer, or REST, is an architectural style for networking software to transfer information through the web.

learn more… | top users | synonyms

32
votes
7answers
11k views

How do I convince my boss to use REST over SOAP? [duplicate]

We need to create an API to our system. How do I convince my boss that REST is a better option than SOAP (or XML-RPC)? I say REST is... easier to implement and maintain not much new to learn -- ...
0
votes
1answer
53 views

REST API - Updating a Variable

If you are updating a variable in a RESTful API, for example person's weight, how should this be laid out? What I have thought of: PUT /person/1/weight?weight=150 PUT /person/1/weight {"weight": ...
4
votes
3answers
400 views

Java & REST API: How do I check for duplicate before inserting record?

I am developing an application in Java to parse and upload records from a CSV to an online database, via a REST API. While I know for sure that there are no duplicate records in each CSV file, I ...
31
votes
3answers
22k views

Should cookies be used in a RESTful API?

I'm specifically interested in how users perform authorized / authenticated operations on a web API. Are authentication cookies compatible with the REST philosophy, and why?
2
votes
1answer
83 views

URI construction for REST API and use of verbs as resource?

I have two questions. 1) I have a issue of understanding the correct URL construction for a REST API. For example, ...
11
votes
5answers
3k views

How to simulate a REST API?

I am working on a new project which will query data from a 3rd party REST API. This is for a real time sports data feed, so the feed only works when a game is actually taking place. Although the 3rd ...
1
vote
0answers
189 views

LDAP Authentication with RESTFUL API

I am developping a RestFul API with Symfony2. (v2.6) The front-end application is build with AngularJs. (v1.3.16) I would like to install SingleSignOn Authentication with an Active Directory. Both ...
2
votes
6answers
720 views

What is faster? Using REST API or querying a database directly?

What is faster performance wise? Creating a REST API and having your web app use the REST API to do all interactions with your database OR querying your database directly (i.e. using whatever typical ...
4
votes
5answers
631 views

why do people do REST API's instead of DBAL's?

At the past two companies I've been at REST API's exist for querying data via a web app. ie. instead of having the web app do SQL directly it calls a REST API and that does the SQL and returns the ...
0
votes
0answers
37 views

API Architecture

I have a Laravel web application. Imagine if our company has many customers. Each customer has one or more addresses. Each Address can have multiple fences and each fence has points which define ...
0
votes
2answers
65 views

How to acquire data and render page in context of REST/API application?

In typical REST/API application, build on MVC architectural pattern, what is the best available technique for acquiring data for rendering views? Should it be: as in any non-API application: data ...
3
votes
2answers
131 views

Best practice to handle POST with array of objects if at least one object rise an Exception

I want to POST an array of objects and make an insertion in database concerning each of them. What is the best practice if one object is not conform and rise an Exception ? (cancel all transactions or ...
2
votes
3answers
97 views

Appropriate use case for “accepted”?

We have a task enqueued by a REST endpoint that will create a resource and then enqueue a task either immediately or delayed based on some business logic. I was thinking of using HTTP/1.1 200 OK for ...
2
votes
2answers
317 views

What's the best way to return an array as a response in a RESTful API?

Assume we have resources like this, book: type: object properties: author: {type: string} isbn: {type: string} title: {type: string} books: type: array items: ...
6
votes
6answers
2k views

Which HTTP verb should I use to trigger an action in a REST web service?

I am implementing a RESTful web service and one of the available actions will be reload. It will be used to reload configurations, cache, etc. We started with a simple GET to an URI like this: ...
1
vote
2answers
64 views

ID's in resource URLs: database id or per-user id?

For REST interfaces or webapps with nice-looking URLs, I constantly ask myself on what numbers to use if we want to refer to specific resources/pages. A typical approach seems to be to use the unique ...
-3
votes
1answer
33 views

Validating Server Response [closed]

I have written a REST API and a c# program. how do i validate that the response is real, and from my server. SCENARIO: i distribute a freeware to a certain community, which will then require them to ...
0
votes
0answers
39 views

Adding a chat api to infrastructure

I currently have a REST Api and will be adding a new real time chat feature. I want the applications to have a separation of concerns. I initially was planning on adding a new realtime messaging ...
1
vote
1answer
110 views

REST - Recommendation route: POST or GET?

I'm building an api route which will pull data from our server. This data is sorted in an arbitrary (changing and unknown to the client manner), and will never return the same data more than once. ...
7
votes
4answers
1k views

Best Practice: Should error messages be handled by the API or by the App?

I am designing an application that interacts with a RESTful API. When returning error messages like Unable to sign up user Should the error message be generated by the app? or by the API? I am ...
3
votes
1answer
351 views

null vs missing key in REST API Response [closed]

Say in my application, some users give us their last name, and others do not. In a REST API response, which body is preferred: With a "null" value: {"firstName": "Bob", "lastName": null} Or just ...
1
vote
1answer
61 views

Is hiding complexity from API clients by merging resources a correct practice?

So let's say we have three simple resources: Groups, Users, and GroupUsers. Groups - Represent interest groups which can be subscribed by users. { name: 'Colorado Mountain Biking Group' ...
0
votes
2answers
92 views

How should an API or server respond when a device connects with a different account than it is bound to?

In my system we have users accounts and user devices. Rules: A user can have only one user account. Each user can have many devices. A device can be bound to only one user account. Upon initial ...
0
votes
1answer
43 views

API authentication with a single ID

A typical API authentication usually rely on a pair of API ID + SECRET, my question is: if the API ID is unique and randomly generated and is considered strong enough (e.g. SHA512), why a SECRET is ...
6
votes
3answers
185 views

REST API design: POST (implicit userId) vs PUT (explicit userId)

For some routes on an API, like GET /news, one would asume the user only wants news that pertains to them, so the userId is implicitly taken from authentication info. However, some of the routes on ...
14
votes
2answers
475 views

Conceptual mismatch between DDD Application Services and REST API

I'm trying to design an application that has a complex business domain and a requirement to support a REST API (not strictly REST, but resource-oriented). I have some trouble coming up with a way to ...
1
vote
0answers
105 views

Will using a pure MQTT approach be the right decision?

I plan to provide additional functions for a closed-source 3rd party point of sales application. That application is used in restaurants, is run on Windows and uses dbase style databases. I know the ...
2
votes
3answers
225 views

Large file / data transfer in a Microservice Architecture

My company is currently working on adopting a microservice architecture but we are encountering some growing pains (shock!) along the way. One of the key contention points we are facing is how to ...
1
vote
0answers
184 views

Web Api design - Using Nouns vs verbs

I have this design situation at work. We have a internal Web-Api application and a Asp.Net Web forms application(UI). The web-application is calling Web-Api to update a Contractor. public Class ...
4
votes
4answers
198 views

REST-full design: recommended approach for fetching related entities

Suppose I have two entities author and post, were every post has an author. Implemented are these REST calls Get a paginated list of posts: GET /posts?page={page} Get a list of authors: GET ...
4
votes
1answer
164 views

How to avoid multiple calls to a REST API? [closed]

Suppose I have a REST API and I can fetch the list of my friends and the favorite songs of each friend in my list. Now I want to fetch all favorite songs of all my friends. The problem with REST API ...
2
votes
1answer
120 views

How should pagination allowing links to arbitrary pages be handled in a RESTful API?

How should a RESTful API handle pagination in the situation where a client may want the ability to jump to arbitrary pages? Let's assume we are using the Link header in the way the GitHub API does: ...
1
vote
3answers
76 views

Design of actions handlers requiring some order

I have a REST application where 'actions' can be executed to perform anything in the system. For example: user.save, user.get, etc... I also have pre and post execution 'handlers'. For example a ...
37
votes
2answers
3k views

What is the proper way to do REST?

Everybody nowadays does SOA, even if some don't actually understand what is all about. So they do it wrong. Using that as an analogy I know what REST is (or at least I think I do) and want to do some ...
24
votes
3answers
8k views

When are RPC-ish approaches more appropriate than REST?

After watching this talk on REST, Reuse and Serendipity by Steve Vinoski, I wonder if there are business cases in greenfield projects for (XML-)RPC-ish setups, that REST could not solve in a better ...
5
votes
2answers
114 views

Partitioning REST API resources into areas based on business domains

In a major application REST API that covers several related domains, does it make more sense to split resources into 'areas' based on the business domain they belong to or is it better to to maintain ...
8
votes
2answers
390 views

Role-based REST API?

I'm building a REST API for which several users with different roles will have access to the resources it contains. To keep the scope simple let's take the "student/teacher/class" domain: GET ...
8
votes
4answers
2k views

What is the need for 'discoverability' in a REST API when the clients are not advanced enough to make use of it anyway?

The various talks I have watched and tutorials I scanned on REST seem to stress something called 'discoverability'. To my limited understanding, the term seems to mean that a client should be able to ...
3
votes
2answers
182 views

Is embedding URLs as query parameters in URLs an acceptable REST API design pattern? [closed]

We are designing some resource oriented web services. Service B needs to be able to make calls to Service A passing in a reference to a resource in service B that service A will use when formulating ...
0
votes
1answer
124 views

Calling RESTful service from browser and handling 4xx class responses

I have a resource called Logins, and I invoke a GET via AJAX from the browser. The current behavior is to return a 404 when the specific login cannot be found. I'm using this to check whether a ...
5
votes
1answer
976 views

How should I handle a redirect to an identity provider during a web api data request

Scenario I have a single-page web app consisting purely of html, css, and javascript. After initial load and during use, it updates various views with data from one or more RESTful apis via ajax ...
0
votes
2answers
90 views

Secure Rest api from authenticated user

Let's say that my Rest api is secured using OAuth 2. Let's say my client is a mobile App. Let's say that i have an Api call: @Post /increasePoints host:https://www.example.com/increasePoints ...
8
votes
6answers
1k views

Many small requests vs. few large requests (API Design)

I'm currently working on a project with an organization as follows: Client - Gets data from the main server via REST api. Server - Requests data from various other servers via third-party APIs ...
1
vote
1answer
99 views

REST API, nested routes without providing identifiers at every nested level

Obviously a RESTful API could contain base routes such as: api/competitions api/competitions/{id} api/teams api/teams/{id} api/players api/players/{id} And nested routes such as: ...
6
votes
1answer
152 views

RESTfully Returning Diagnostics Data With Response

In a REST API I am working with, under certain circumstances (ex/ request originated in network) diagnostics data is returned with the response. Right now, a property is appended to the root object of ...
8
votes
3answers
6k views

Is it OK to return HTML from a JSON API?

On my current project I am responsible for the implementation of a service which involves the consumption of newly created RESTful APIs, documented as solely supporting JSON. The client consistently ...
0
votes
0answers
99 views

REST Services with ASP MVC WebApi architecture feedback

I'm working on a new project and I had to design some REST Services with ASP MVC WebApi. I would like to show you my app architecture and learn from more experienced architects what I have ...
3
votes
1answer
260 views

How do I write a REStful API's functional specifications?

I've been looking for answers about writing functional specifications for a software for a while now but I can't seem to find an answer to my specific case. I think I understand the difference ...
0
votes
0answers
69 views

what is the relationship between CORBA, JMS and MDB?

In the context of my previous fuzzy question on microservices, please help me break down the terminology involved in these technologies: CORBA JMS MDB Utilizing JNDI, I believe it's possible to do ...
14
votes
6answers
1k views

What to call an HTTP API that is not RESTful? [closed]

What would you call an API that is HTTP-based, uses URI to name resources and HTTP verbs (PUT, POST, DELETE, GET...) to manipulate those resources? According to Roy Fielding's complaints it is not ...