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

learn more… | top users | synonyms

1
vote
2answers
52 views

Creating entities with validated Addresses via REST API

I am building a REST service. This services enables the user to create an entity that has an Address. For simplification, let say this other entity is 'House', so 'A House has an Address'. The system ...
-3
votes
0answers
36 views

How to protect a private REST API in an javascript web application

I'm building a web application. It's basically a blog. There is a javascript client web application and there is a server that implements REST API. When user visits my blog, I use javascript ...
22
votes
3answers
892 views

RESTful API: HTTP verbs with shared or specific URLs?

While creating a RESTful API, should I use HTTP Verbs on the same URL (when it's possible) or should I create an specific URL per action? For example: GET /items # Read all items GET ...
0
votes
0answers
22 views

vert.x message bus architecture

A large part of the vert.x architecture is around the message bus, and message passing between verticals. The main idea I guess being that I can create multiple modules (possibly in multiple ...
-1
votes
0answers
22 views

Using a push notification to trigger a fetch/pull for realtime updates?

I have a mobile app idea that I am still developing (the idea and how I would implement it, not the app). The current plan is to have data on a service like Parse, and the app would load data from ...
2
votes
4answers
97 views

REST-full design: recommended approach for fetching related entities

Suppose I have two entities author and post, were every post has an author. There exists a REST call to get a paginated list of posts: GET /posts?page={page} a REST call to get a list of authors: ...
2
votes
1answer
612 views

How to translate SQL query into REST API requests?

Let's say I have a machine-readable description (such as in WADL, Swagger or RAML) of a REST API that provides interface to a database. My users submit queries about underlying database in form of ...
6
votes
3answers
1k views

Is it OK to partially change a collection with PUT or DELETE?

I have a collection of products in a product group e.g.: product-groups/123/products If I need to add to the collection, is it OK that I pass only some products with PUT? If I need to delete some ...
1
vote
1answer
231 views

Designing the bridge between REST layer to service layer

I am working on a project and would like to expose some REST services. The technologies used are RestEasy, EJB and JPA/Hibernate. I have structured my app so that there is a clear delimitation ...
1
vote
1answer
60 views

What exactly are Link Relation Values?

From REST in Practice: Hypermedia and Systems Architecture: For computer-to-computer interactions, we advertise protocol information by embedding links in representations, much as we do with ...
0
votes
1answer
44 views

In a REST based system should a request for a sub-resource include the parent

I'm unsure of REST best practise in the following scenario: GET /Customer/23 = returns Customer = OK GET /Customer/23/Orders In the second request should a Customer AND the Orders be returned, or ...
0
votes
0answers
13 views

Producing JSON objects from JPA entities in REST API

I have a REST service producing JSON and consuming JSON. A lot of this are simple CRUD operations. My initial idea was to simply use the DAOs directly in the controller: @ResponseBody() ...
0
votes
1answer
53 views

Do I need to follow hypermedia format or a schema?

I'm quite new to the field. So I need to clarify what would be the best method to follow in the following situation. I'm developing a restful API using php and use json to represent resources. While ...
5
votes
2answers
2k views

HTTP Response Header for a unique Request ID for REST service

For our REST service I want to send back a unique request ID with every response; useful for debugging internal projects but also for offering support to any third parties who might use the service in ...
1
vote
4answers
73 views

A separate endpoint specifically for sync in a REST api

I am working on a multi client/single server app. Communication between the two happens via RESTful API. There are several resources that need to stay in sync across all clients, including images ...
0
votes
2answers
74 views

REST backend restricted access only for humans

I will design a REST backend that will work with my database. I want users to access this data by viewing my webpage (I will work with an MVC JS framework) without logging in. At the same time, I ...
3
votes
1answer
65 views

Introduce Data Transfer Objects or expose complex data model in REST

We are working on an MVVM application. Jersey (backend) exposing a REST interface and AngularJS (frontend) being the only consumer of this interface. The application uses a complex database model ...
4
votes
4answers
4k views

Languages and frameworks to build REST services [closed]

I'm currently in the process of developing a REST service that will be consumed by an iPhone app. Basically, the service wraps existing business logic. This business logic is written in c# and I'm ...
4
votes
1answer
100 views

Should I add a key to the items of my REST API response?

I have an REST API endpoint which the JSON response looks like: { "products": [ {"id": 1040, "price": 2.95, ...} {"id": 4545, "price": 3.95, ...} ] } One of my colleagues ...
1
vote
2answers
42 views

To include a resource ID in the payload or to derive from URI

Designing an API, we've come up against the question of whether a PUT payload should contain the ID of the resource being updated. This is what we currently have: PUT /users/123 Payload: {name: ...
20
votes
4answers
8k views

REST - Tradeoffs between content negotiation via Accept header versus extensions

I'm working through designing a RESTful API. We know we want to return JSON and XML for any given resource. I had been thinking we would do something like this: GET /api/something?param1=value1 ...
2
votes
2answers
73 views

RESTful key-value collection

I am creating a HTTP REST API. I have a large collection of key-value pairs, at /base-url. I need to provide the ability to get and set values for a key. My first attempt: GET /base-url/{key} PUT ...
3
votes
1answer
78 views

Should I hide fields in REST resource representations based on the user's security role?

What is the best practice for exposing different fields for a resource based on user's role/ACL privileges in the system? Let's say I have an endpoint, groups/{:group_id}. My business rules state ...
3
votes
1answer
89 views

the better url for a API: /api or api [closed]

when you make a API, what is a better practice ? http://webapp/api or http://api.webapp/ why ? I started with the API in http://webapp/api and the description of the service in http://webapp. ...
2
votes
3answers
104 views

how should I change the representation (not mimetype) of a resource?

I'm looking at how I can change the representation of a payload at runtime for varied potential advantages, but I'm not sure how to do it. Specifically collections. Array of Pairs [{ ...
0
votes
1answer
175 views

REST and RPC in multi-tier API

My team is developing a multi-tier API with scalability and modularity in mind. The public access point of the API is fully REST. However, we are splitting the data access layer as another tier in our ...
2
votes
3answers
230 views

Is a bad choice to consume the REST API also from the back-end?

Using a REST API for front-end code is a desiderable and quite common practice. However, I was wondering if using it also for the back-end could be a good choice. What I mean is leaving the burden of ...
0
votes
1answer
26 views

How to implement a RESTful API that updates a list which might have exclusion and addition of related resources?

We have an application where there is an API to create a document with a POST and update it with a PUT. There is a separate API to share document with users. Now, How should we approach updating the ...
1
vote
2answers
374 views

Is performance the only reason not to use SignalR (websockets) entirely in lieu of a traditional REST API?

I have used SignalR to achieve real-time messaging functionality in several of my projects. It seems to work reliably and is very easy to learn to use. The temptation, at least for me, is to abandon ...
13
votes
7answers
700 views

Why is a small fixed vocabulary seen as an advantage to RESTful services?

So, a RESTful service has a fixed set of verbs in its vocabulary. A RESTful web service takes these from the HTTP methods. There are some supposed advantages to defining a fixed vocabulary, but I ...
2
votes
6answers
389 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: ...
-2
votes
1answer
104 views

Using a REST API for both mobile and web [closed]

I've always only used REST to build web services for mobile apps, for example i use Django to build the website using templates, and build a REST API using django framework, but would it be a good ...
5
votes
4answers
2k views

Why REST Api do not follow the Facade design pattern

In comparing REST [api] structure with a OO model, I see these similarities: Both: Are data oriented REST = Resources OO = Objects Surround operation around data REST = surround VERBS (Get, ...
2
votes
1answer
179 views

Avoiding Double POST

We are implementing a RESTful webservice that will allow client applications to POST documents to it and it will store the document returning a unique identifier in the response. The clients will ...
15
votes
3answers
8k views

Should I use WADL to describe my RESTful API?

I'm about to embark on a project that makes extensive use of a properly RESTful approach. That is, it uses HATEOAS and serves up resources in a manner that allows for general exploration by a client. ...
4
votes
1answer
51 views

How to design URIs to initate batch jobs in a RESTful service

If I want to run a job at the end of the month to calculate the commission for all the sales consultants based on the current transaction data, eg commission rate for the person, sales done in the ...
0
votes
2answers
391 views

DTO - service layer - statelessness best practices interfering with each other

I am designing a REST API coupled with a service layer that takes DTOs as input and produces them as output. This works fine for most service calls where the DTO is used to access an underlying ...
-2
votes
2answers
116 views

Where is it implied that REST is not based on HTTP [closed]

I've been over Fielding's paper on REST and all over the web, including StackOverflow trying to understand this. After reading everything I can about REST, I was under the impression that Fielding ...
1
vote
2answers
87 views

How to deal with multiple “entry points” for an action in a REST API?

Let's say we have two kinds of resources, user and group. Every user can belong to multiple groups and each group can have many members. Thus I can model my API like this / |_ /users/{id} | |_ ...
3
votes
1answer
138 views

Why PATCH method is not idempotent?

I was wondering about this. Suppose I have a user resource with id and name fields. If I want to update a field I could just do a PATCH request to the resource like this PATCH /users/42 {"name": ...
0
votes
1answer
77 views

What should my RESTful API method look like for a Roulette game?

I'm building a roulette game for fun, and the game will use a RESTful API. I'm building out the functionality for spinning the roulette wheel. I'm using MongoDB and have a collection for players _id ...
1
vote
2answers
451 views

Is this a secure solution for RESTful authentication?

I need to quickly implement a RESTful authentication system for my JavaScript application to use. I think I understand how it should work, but I just want to double check. Here's what I'm thinking -- ...
1
vote
1answer
286 views

Implementing a tricky REST API with ASP.NET Web API

I'm trying to build a RESTful API using ASP.NET Web API for a game, and here are the methods I have so far: /games GET /games/:id GET /games POST /games PUT /games DELETE /users GET /users/:id GET ...
0
votes
1answer
43 views

Link relation values and REL attribute - edited

In REST, do we always use link relation values to convey semantics/role of a linked resource? I assume link relation value is always specified using rel attribute? Should rel attribute only be ...
4
votes
1answer
295 views

What is RESTful way of action confirmation?

Some of my API actions require SMS confirmation due to security reasons, like creation of payment and CRUD for scheduled payments. Right now I just return an entity with AwaitingSMSConfirmation state ...
0
votes
0answers
28 views

How to Handle Multiple Versions of a REST API [duplicate]

At an interview I was asked the following question. You are giving out a rest API and you know that there will be multiple versions of it. The API methods will remain the same across versions but the ...
0
votes
1answer
54 views

Sending multiple resources under REST endpoints

I am designing an API where- 1. There can be multiple devices under a gateway. 2. There are multiple sensors on every device. GET /devices/d1/sensors/s1 returns the status of sensor s1 on device ...
2
votes
1answer
126 views

Gradual reveal in REST APIs [closed]

In the article Building Web Services the REST Way, the author states: Design to reveal data gradually. Don't reveal everything in a single response document. Provide hyperlinks to obtain more ...
0
votes
3answers
102 views

Website testable design [duplicate]

I have developed two web services. The main service is a RESTful service (using DB), and another UI service that uses the RESTful service. Say I want to test the UI for now (integration tests), every ...
0
votes
0answers
85 views

REST API + “Micrososervices” boundaries

I have a REST API. The fundamentals of the API takes care of two things. Authentication Routes Let's say I was about to do a small service (microservice whatever...) next to the API and have it ...