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

learn more… | top users | synonyms

2
votes
2answers
110 views

Is it correct to use PUT with multipart content?

We are using Spring and want to implement a REST with a "override file" call so we think using PUT verb with a multipart body only to find that Spring don't accept it. My question is it can't be done ...
4
votes
1answer
106 views

Considerations for decoupling and refactoring business logic to a REST API

We've got a .NET Solution consisting of a MVC Website and a bunch of libraries for business and data logic. In the past the website was the only way to interact with our business logic, but we're ...
8
votes
3answers
189 views

In REST parlance what is the difference between a resource and a representation?

My understanding of REST that is enables modelling service operations as representation of state and transition from one state to another making use of HTTP. I have always understood resources as ...
1
vote
1answer
155 views

REST is not appropriate for business applications because of necessary to distribute business logic accross layers. REST alternative required!

I have Spring+Java Server Faces (Facelets) application for which I would like to create Single Page Application (SPA) version, e.g. using AngularJS (which is the best and most popular GUI framework). ...
2
votes
3answers
137 views

Correct RESTfull way to refresh a resource

Imagine we have resources like reports. We have a collection because every report contains its own settings to build some data. Every report calculates its values on regular basis but not to often. ...
5
votes
1answer
134 views

REST API - What HTTP code should be returned when resource is not in a state required to complete the operation?

Our API accepts PUT requests in order to change status of resources. Think of this as a state machine. Client can specify the target state of the resource via PUT request but it is possible that the ...
4
votes
4answers
217 views

Proper RESTful web service response code usage

Assuming I create a RESTful web service that looks up a user in a database given the id as a parameter. If the user does not exist, should I return a 404 response (because user not found)? Or a 200 ...
4
votes
2answers
191 views

Ubiquitous language and maturity level in REST API?

According to Richardson Maturity Model there are several levels of maturity in REST approach. http://martinfowler.com/articles/richardsonMaturityModel.html Since DDD uses ubiquitous language, I am ...
2
votes
1answer
135 views

How can I find out network latency in rest service

I have two Java applications deployed on tomcat. For inter application communication I provide jar file of application (Java API) to other application and it becomes a method call which is fast. Now ...
7
votes
2answers
183 views

Prevent abuse to REST API endpoint

Question 1 I have a login API endpoint http://127.0.0.1:8080/api/account/login It checks if the phone number has been validated. If not it will call POST http://127.0.0.1:8080/api/account/sendsms ...
2
votes
1answer
78 views

RESTful HTTP and websocket in the same application?

If an application has already an opened WebSocket for live feeds, should I use it over AJAX for the other communications with the server? Because the connection is already opened, should we use it ...
3
votes
1answer
105 views

RESTful API/Data Modeling - How to model an subordinate resource that will only ever have one element

I'm creating an API and data model for a multi-user document-creation application and I'm having trouble with a particular part of the data model/API design. Below is my current line of thinking: ...
14
votes
3answers
657 views

HTTP Status Code for “Still Processing”

I'm building a RESTful API that supports queuing long-running tasks for eventual handling. The typical workflow for this API would be: User fills in form Client posts data to API API returns 202 ...
1
vote
1answer
36 views

Rate-Limiting in an OAuth REST API: per token or per consumer?

I am building a REST API and intent to use rate limiting (using the leaky bucket algorithm) as a way to protect against crawling and enumeration. The API will be consumed by a Mobile/Tablet App (...
1
vote
3answers
100 views

Alternatives on how to deal with data fetched from external API

We are planning to build a web application which will consume data from an internal REST API that centralizes all of our "core" business data. For matter of demonstration, let's say this API exposes ...
0
votes
2answers
70 views

Modelling a REST Object Question (Python)

I have a REST API that I want to model in a class so I can access the properties using the dot notation (JS list notation). I explicately defined the properties on my class using the @property tags ...
1
vote
1answer
45 views

Am I making use of REST if I have implemented an Android app that connects to a localhost?

Would I be using REST or would my app be considered RESTful if I was using the Google Volley library to connect to a database on localhost?
2
votes
2answers
164 views

Warnings in a REST API as not critical errors

I have a REST API that for some of entpoinds like DELETE, POST or PUT I have some validation rules that can return an error. Now I need a new type of an error like a non-critical error, that it ...
-1
votes
1answer
124 views

Code structure of third party framework [closed]

Is an API always returning 200 OK, an issue?
1
vote
1answer
67 views

Eventing solutions for java legacy applications too old for real JMS queue/topic eventing?

What are some architectural solutions that can mimic eventing for systems (Java) that are too old to implement eventing solutions, such as conventional Queue/Topic based JMS messaging? I have a ...
1
vote
0answers
27 views

Implementing real world Consumer-Driven Contracts in a single web application

I've been leaning towards the idea of Consumer-Driven Contracts in order to allow separate API consumers evolve on their own. To approach this concept initially I'm tempted to dip my toes in slightly ...
2
votes
1answer
152 views

REST api design: How to manage multiple type of resources in URL?

Lets say I have an Organization and Users inside that organization. To get a user in particular organization what should be the GET request url from below options? 1. /api/organization/:orgId/users/:...
0
votes
1answer
63 views

Should models be returning data directly to the client, or to the controller instead?

Disclaimer: This is my first time: using node, creating a REST API, and trying out MVC server side. (so, just statistically speaking, I'm probably doing something wrong ¯\_(ツ)_/¯) I'm working on ...
1
vote
4answers
117 views

Where is the place for contracts/protocol in RESTful communication?

I am trying to explore and understand RESTful approach to things. I've read that the interface be should not be contractual. That is what I get from HATEOAS. But surely there must exist some ...
6
votes
3answers
71 views

RESTful way of requesting server generated resource

I want a server to be a producer of tasks for the client to process and be sent back. What is the proper HTTP method in RESTful approach to create and return a new resource? This seems silly, but the ...
4
votes
1answer
46 views

How to structure path-colliding REST webservices with role-access

I have a bunch of REST webservices that my client uses. For instance, to create a user, I have POST /users and to modify it POST /users/{id} The problem is, some fields, as marketArea, are ...
7
votes
3answers
309 views

Best solution to authorize that a user is only allowed to modify/act with their own resources in a REST API

Background: Currently in the process of building out a REST API, using node w/express and it is consumed by a mobile app and eventually a (modern browser based) website. I'm trying to identify the ...
11
votes
3answers
498 views

RESTful API. Should I be returning the object that was created / updated?

I'm designing a RESTful web service using WebApi and was wondering what HTTP responses and response bodies to return when updating / creating objects. For example I can use the POST method to send ...
4
votes
1answer
284 views

Boolean endpoint within a RESTful API

I am currently designing a JSON RESTful API which should have a boolean endpoint such as /item/vote which can either be false meaning that a user has not voted for a specific item or true meaning that ...
0
votes
3answers
99 views

Should REST APIs contain the ability to dispatch email?

When building a service that uses both a back-end REST API, and (a) front-end application(s), is it proper to build into that API the ability to dispatch email? Take Twitter for example; for those ...
1
vote
3answers
130 views

REST: Can I use POST request to read data?

Is it against best-practices to use a POST request to read data? Are there any exceptions to this? e.g. Authentication requests where you have to POST data to perform a read action. I have an API ...
6
votes
1answer
156 views

Paging Strategies : Page Token vs Skip/Start Index

I am seeing that more and more new APIs use page tokens to let the user move between the pages of results containing a lot of items. However from an API designer point of view I'm not clear on what ...
6
votes
1answer
129 views

Implementing a composite REST service

The past years I have had the need to implement business logic in a larger type of service, most often orchestrating a handful of atomic/microservices. Operations like "search and update document, ...
3
votes
1answer
112 views

Whether to embed linked resources in REST API

I am building a REST API where clients can query user-sent messages, like this: GET http://example.com/api/v1/messages?from=0&to=100 Response: [ { "id": 12345, "text": "...
4
votes
1answer
36 views

Restful user routes with web token

I'm trying to create an api which has a login that issues a JSON web token and then offers a handful of resources to authenticated requesters. User is a type of resource, and this is where I get ...
2
votes
0answers
48 views

Cache updates after not related REST request completes

I am wondering about the following scenario - it's in the land of Spring/AOP and Ehcache. Happens in REST Web Application - REST/Service/DAO layers - I have objects in cache (@Repository + @Cacheable)...
2
votes
2answers
224 views

Does RESTful response always return a 404 and empty content when an array is expected but the result is empty?

I worked with Ruby on Rails and RESTful api before and now with Django Rest framework. For this question let's say we only consider the case of JSON but not XML. It seems that when we expect an ...
0
votes
3answers
316 views

Is returning a json object instead an array via REST good or bad style?

I am working on my API and would like to return some stats. Those are stored and collected in code, and I can choose my way to return those. My first approach was using hash, so my data looks like: {...
1
vote
0answers
155 views

Securing a REST API based on authentication with external site

I have a website with an already-established authentication system. Once a user logs on to it, one of the features is a statistics application based on AngularJS. The app communicates with an ...
3
votes
1answer
106 views

Should I be permissive of unknown parameters?

I'm designing a RESTful API and faced with the title problem, restated for clarity: Should I fail fast if a client sends an unrecognized parameter? For example, http://example.com/api/foo?bar=true&...
2
votes
1answer
60 views

More scalable alternative to a transaction-per.request in a SQL+REST stack?

I'm new in web programming with SQL database. So please forgive my ignorance. I'm using some modern framework to make a REST server with a SQL database. I'm using transaction only when I think I need ...
0
votes
0answers
56 views

Publish / Subscribe via HTTP Callbacks?

My team is tasked with creating a publish/subscribe system for incoming REST messages. 99% of the time, this system will be used for notifications between different processes on the same cpu, but we ...
1
vote
2answers
89 views

RESTful API, what's the best way to implement status changes and events?

For example I need to update the status of a "Purchase Order" from "Draft" to "Sent". What's the best way of doing this? Do I just the update the status field in the client side and then just POST ...
-1
votes
1answer
88 views

Considerations about returning text instead of JSON in a JSON compliant API [closed]

I'm using Spring-Boot + Jackson to implement a Rest API. When I return some object from my methods the controllers are building a JSON compliant response. However, that's not happening when I return ...
2
votes
1answer
131 views

Fine-grained data level permissions on a laravel RESTful API

The problem: We want to restrict access to properties returned from our services. Details: We have route level permissions working with no issue. For a user that can view /product/{id} for example,...
1
vote
1answer
134 views

JsonAPI - Updating the relationship for a resource

I am having trouble understanding http://jsonapi.org/. Say, I have the following endpoints in my API for authors and articles. /authors /authors/:id/articles If I wanted to fetch the ...
1
vote
1answer
93 views

Layer application and token authentication

Suppose we have an application with multiple layers in .Net: Domain layer (entities) Data access layer (entity framework) Business layer Web Services layer (Web Api) Presentation layer (MVC) Now I ...
4
votes
1answer
176 views

How to build notification system in Azure

I have a system running in Azure that accepts messages via a REST endpoint. The customer has a certain number of devices that send some data for example temperature and we present this data in a web ...
0
votes
1answer
120 views

Spring Consuming Internal REST WS for MVC

Sorry in advance if this is a little confusing, it's difficult how to phrase this. I am currently using Spring MVC with some RESTful services mixed in for some AJAX client side logic. I am looking ...
2
votes
2answers
132 views

Scaling a Restful Web Service Hosted in Server

We have deployed a restful web service on a application server (Apache). The volume is getting higher and we do want to scale it. We will deploy two more Apache instances on two more machines. How do ...