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

learn more… | top users | synonyms

0
votes
0answers
5 views

RESTful Api: Send email with links relative to client domain

I have a RESTful api that sends out notifications of various events via email e.g. order received. The emails will contain a link that takes the user to a relevant resource e.g. /orders/1234. The ...
0
votes
1answer
28 views

RESTful way of referencing other resources in the request body

Let's assume that I have a resource called group with the following representation: { "id": 1, "name": "Superheroes" "_links": { "self": { "href": ...
0
votes
0answers
18 views

How to consume inconsistent REST API with Mongo DB backend?

We are using a third party REST API and we are building one of the pages on our ASP.NET site around the data it delivers. We get results in JSON, and interact with it mostly using .NET MongoDB Driver. ...
1
vote
2answers
34 views

Using many Resource URI to create a Record and handling failure

Hi Guys, I have a decision to make to solve a problem, I’m describing the problem below. Application Overview I have an ASP.NET MVC 4 webApp which uses Rest Api for almost all the tasks, from Login ...
6
votes
3answers
272 views

Designing a REST api by URI vs query string

Let's say I have three resources that are related like so: Grandparent (collection) -> Parent (collection) -> and Child (collection) The above depicts the relationship among these resources ...
1
vote
2answers
79 views

Do web applications use HTTP as a transport layer, or do they count as an integral part of the HTTP server?

Given an HTTP server (e.g. Apache, IIS) and a web application (user code running in the server using PHP, ASP.NET and the likes), which of those can decide which HTTP status code to return for any ...
1
vote
0answers
44 views

REST request of different length

When a client requests my .../resources/user URL with a HTTP GET I get the following response: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <collection> <User ...
1
vote
1answer
22 views

Best way to keep consistent data in model across devices?

I have a model for an app that is fairly large, all of which needs to be on a users' device at the same time. For example, a spreadsheet. If a user makes a change to the model on one device, I want ...
1
vote
1answer
61 views

Purpose of authentication on API's?

After asking this question I found that I have a different question. What's the purpose of authenticating an API anyway? Take Twitter for instance. If you want to use this link to load some user's ...
2
votes
2answers
113 views

What is the best way to create REST API error response model and error codes system?

My REST implementation will return errors in JSON with next structure: { "http_response":400, "dev_message":"There is a problem", "message_for_user":"Bad request", ...
0
votes
0answers
6 views

Which ORM should I use for Node.js Express and Postgress [migrated]

I have been looking around an architecture for my backend services that needs to be developed using open source technology. A Node JS with Express is an option for REST-API. However, what about ...
1
vote
1answer
31 views

RavenDb - Get data through a REST Web API

I would like to build a RESTful API where I need to get data from a RavenHQ-cloud-database. First of all, is this possible? The idea is to have multiple applications (xamarin-app, mvc-app, etc.) and ...
0
votes
2answers
103 views

Saving to file before storing into a database in a REST service

A mobile back-end I am building should receive a larger amount of data (some sensor recordings) from an Android phone. The phone does not have much use of it so it was most efficient to store the data ...
1
vote
1answer
38 views

Breaking dependencies on remote APIs

The system I'm working on has a core web application where the bulk of the work is done. However, it relies on another server to handle transactional finance data. It connects to the server using a ...
0
votes
0answers
44 views

Separation of web server and stateless REST API

Currently, I have a single Node server that provides both (a) stateless API routes returning JSON, and (b) session-based web routes. My API routes and web routes have started sharing a lot of code, ...
3
votes
2answers
53 views

get All data vs get partial data Optimization

Let's say a client makes a GET call to the server to get all the followers of some user. now the client shows a list of all the followers but the only data the list needs is: {"username" : "user", ...
-3
votes
0answers
75 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 ...
0
votes
0answers
43 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 ...
2
votes
4answers
110 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: ...
0
votes
1answer
53 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
28 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
67 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 ...
0
votes
2answers
83 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
91 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 ...
1
vote
4answers
84 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 ...
1
vote
2answers
67 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: ...
2
votes
2answers
79 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
87 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
92 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. ...
1
vote
2answers
67 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 ...
22
votes
3answers
967 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
1answer
27 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 ...
2
votes
3answers
255 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 ...
2
votes
2answers
783 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 ...
2
votes
6answers
471 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
111 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
1answer
62 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 ...
-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 ...
2
votes
2answers
109 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
181 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
84 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
1answer
432 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 ...
4
votes
1answer
307 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
66 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 ...
0
votes
3answers
112 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
94 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 ...
0
votes
1answer
76 views

How to host a web service with dependencies on many APIs/SDKs which expose methods in different languages

A project I'm working on currently depends on several SDKs and APIs that perform identical tasks, but for different external products. For example, in an Internet of Things world we have a common ...
0
votes
3answers
300 views

How do I design my application to use REST for itself?

I'm not sure how to ask this. I know this is simplistic, but I understand (I think): REST is an architecture, not required, simply a way to build REST is a style and a community standard for ...
2
votes
1answer
146 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 ...