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
4answers
114 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
68 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
45 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
278 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
410 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
209 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
98 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
116 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
133 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
118 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
91 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
185 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
268 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
128 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
91 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&...
1
vote
0answers
48 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
55 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
88 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
77 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
103 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
103 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
76 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
169 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
101 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
113 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 ...
3
votes
2answers
166 views

REST API - omitted properties in POST request: How should they be handled?

Given the following scenario: Teacher entity { "id": "1234", "name": "Mr. Didactic", "Subject": "History", "Classroom": "1A" } REST API endpoint: /teacher/id/1234 Let's say I submit ...
0
votes
0answers
78 views

Is pure RESTful required for Angular JS / Backend running on same web server?

I am developing an application with Sprintboot + REST + Angular. While I am working on the REST API, I am trying to design as RESTful as possible. I'm encountering certain pages where the Angular UI ...
8
votes
3answers
418 views

REST API design for web pages with wizards

I have a web page with wizard format. The submission button to the API will be in the 4th step of wizard. However I want the data entered to be stored in database before moving to the next step in the ...
0
votes
1answer
142 views

Relationship between REST APIs and Databases [duplicate]

I've been studying databases and rest APIs lately and I have a question about the relationship between the two. Imagine I have a database with three tables, STUDENTS, ENROLLED, and CLASSES. STUDENTS ...
3
votes
5answers
139 views

Bulk update: return all results or only failures

I'm developing an API that performs bulk update of a large number of items in a single call. This code will consist of a REST endpoint and the internal library code that it calls. There are a few ...
3
votes
1answer
147 views

How to paginate local and remote data?

My team is currently facing a problem that we don't know how to tackle. Some technical details: we use Java 8, Hibernate, Spring, MySQL, and AngularJS for the front-end. We need to do pagination on ...
2
votes
2answers
144 views

REST API - Handling subresources

Suppose there is a primary resource "/accounts" which has Profile (name, national id, DOB), addresses and contacts(email, phones). I am considering them as sub-resources because they cannot exist ...
2
votes
1answer
360 views

Consuming REST services: client or server

I am working on a new project in which we are currently deciding which technologies and frameworks we will be using. The application will eventually be cross platform. Therefore, for the server side, ...
2
votes
1answer
83 views

REST Standard for changing SPA Model after fetched from REST API

Let's imagine. I have following data from database. ====================================== id | Title | parentId ====================================== 100 Asia NULL ----------...
1
vote
1answer
88 views

Design - shallow routes for an API

I am building an API that will connect to multiple databases. I am using Emberjs on the front end and the default rest adapter seems to prefer shallow routes. Say, I have the following routes api/...
1
vote
2answers
69 views

Difficult design with multiple associations between two entities

I'm trying to design the data schema and the restful api for a specific case. In my system I have several users and several books. Every book can have several users as authors and at the same time ...
6
votes
5answers
604 views

How to design a complex REST API considering DB performance?

I've been following some tutorials on how to design REST APIs, but I still have some big questions marks. All these tutorials show resources with relatively simple hierarchies, and I would like to ...
2
votes
5answers
579 views

API design dilemma: to REST or not to REST

I'd like to design a REST API supporting: Login Temporary token generation The reason being there are a number of client-side REST libraries that would speed up development if used, as they take ...
5
votes
1answer
183 views

Does discoverability in HATEOAS require the information must be machine readable, or can it just be human readable?

I'm trying to understand the concepts of HATEOAS (Hypermedia As The Engine Of Application State) in REST. The following have been very useful: What does HATEOAS offer for discoverability and ...
1
vote
0answers
29 views

Restful flows for data entry

I'm considering a few different possible flows for a restful api. For minimum viable product, I'm assuming a web browser as the front end. Current use case: the task of the human operator is to ...
3
votes
2answers
282 views

In REST is HATEOAS really about self-discovery or about navigation? [duplicate]

I'm trying to learn about REST and having problems with the concept of HATEOAS (Hypermedia As The Engine Of Application State). What is it for? It seems to me the majority of commenters on the web ...
1
vote
2answers
76 views

Should a client check for persisted item existence before modifying it?

I'm developing a MVC Web application with a REST interface. The REST controller performs actions on persisted items through a service class, which translates exceptions coming from the persistence ...
3
votes
2answers
175 views

How are POST/PUT/DELETE data passed to APIs?

I know that the data is passed through HTTP, but I'm not sure if I should be passing data through HTTP headers, or HTTP bodies. Which one is the convention for APIs? Also, theoretically using PHP, ...
4
votes
1answer
161 views

Filtering request and responses in RESTful MEAN stack

I have a very basic RESTful service written using the MEAN stack (MongoDb, Express.js, Angular.js, Node.js) and utilizing the Mongoose ODM. Product schema var productSchema = new mongoose.Schema({ ...
3
votes
1answer
143 views

How do I go about setting up my Sinatra REST API on a server?

I'm an iOS developer primarily. In building my current app, I needed a server that would have a REST API with a couple of GET requests. I spent a little time learning Ruby, and landed on using Sinatra,...
4
votes
1answer
290 views

Resource representations and REST API documentation tools

I find myself unsure about what exactly it means to have different representations of a RESTful resource. The canonical example is for an API to provide an endpoint - say /v1/users/:id - and allow ...
2
votes
2answers
442 views

How to correctly implement key=value storage REST API

I'm new to REST API, so I decided to get familiar with it by designing a small web service API. I have its design written down and would like you to review it. I feel like I have made some mistakes in ...
4
votes
2answers
219 views

Should a RESTful API be able to return files, or just a location

This has been puzzling me for a while. For example, we have a REST API that provides basic content to a system, consuming and producing JSON. At this endpoint it produces a URL to a picture and a ...