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

learn more… | top users | synonyms

-3
votes
1answer
131 views

Less PHP request to REST API

I had an argument with my PHP developer today who tried to convince me that REST API has to provide all the request from PHP since a server is faster than client devices such as desktop. As I am a ...
5
votes
5answers
2k 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: ...
0
votes
1answer
207 views

Best way to represent multiple JSON response in a REST service? [closed]

I am working on a REST service in which I am trying to come up with a JSON response that I am supposed to return back. Below is the design I am able to come up with in which each line is a response ...
2
votes
2answers
68 views

How are hypermedia rel values specified in the REST uniform interface?

I am learning a bit about REST and am intrigued by the concept of a uniform interface, and the ability of a client to follow hypermedia links in order to detect service capabilities. As I understand ...
27
votes
6answers
6k views

Putting a password in a REST API call

Suppose I have a REST API that is also used to set/reset passwords. Let's also suppose that this works over a HTTPS connections. Is there any good reason not to put that password in the call path, ...
3
votes
1answer
120 views

Can this be considered an API? [closed]

I'm writing my first API, but I think I screwed it up from the design. It's a simple CRUD API which behave like this: READ: /api/data gets redirected to api.php?data1=data. POST variables: user, ...
4
votes
3answers
546 views

is using a PUT with side affects acceptable (REST)

I want to create an undo history whenever the user updates a form. Because it's an update, I want to use a PUT request. However, I read that PUT needs to have no side effects. Is it acceptable to ...
0
votes
1answer
41 views

Architecture/technology for implementing Management console [closed]

I'm having a distributed environment which include several machines under the same network , which are being controlled by another computer in another network which is also running a UI for doing the ...
1
vote
1answer
160 views

How to have my callbacks authenticated in a REST app?

I'm developing a REST application and I allow my clients to authenticate in several ways (typically using Authorization: Token ... as in OAuth 2.0, but also there's session-based auth option for the ...
18
votes
5answers
20k 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 ...
0
votes
2answers
109 views

Should my public webservices use HTTP or HTTPS?

The situation is a bit more complex than the title suggests (but not much). I'm working on a REST API that will have a few open / publicly available resources and a few with authentication. (The ...
33
votes
14answers
17k views

RESTful API design. What should I return if there are no rows?

I'm currently coding an API for a social network with the Slim Framework. My question is: What are the best practices when there are no rows to return in the json structure? Lets say that this call ...
3
votes
2answers
79 views

How do I model a sortable resource in sql database? [closed]

I encounter this issue when I create REST API. I cannot tell the exact scenario, but let's say it is for a website that has category and product resources. Each category has many products and both ...
1
vote
3answers
183 views

Soap vs. rest - a hybrid approach? [closed]

I have a proper SOA architecture, with web services defined with WSDL and responding to SOAP requests. But this application has also an endpoint that responds to json request and replies in json ...
2
votes
1answer
106 views

Can “REST without PUT” support optimistic locking using ETags?

Rest without PUT models immutable, append-only (event-sourced) state changes by favouring POST-ing new reified change resources over PUT-ing updates to original. Example: making and then changing a ...
20
votes
3answers
28k views

What is a recommended pattern for REST endpoints planning for foresighted changes

Trying to design an API for external applications with foresight for change isn't easy, but a little thought up front can make life easier later on. I'm trying to establish a scheme that will support ...
5
votes
1answer
2k 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 ...
11
votes
3answers
5k views

Represent actions(verbs) in REST URI

I have a print operation to perform for my customer documents. I need the other standard operations to be performed as well, like add,update, delete. so, I have following: For creating new ...
3
votes
1answer
103 views

Why would a Rest Api demand a hash of the parameters?

I'm working with a Rest Api that demands to send with any request a hash of the parameters of the request: Hashkey Calculation This hash key has to be generated by the device itself and has to ...
15
votes
2answers
12k 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 ...
3
votes
1answer
63 views

Image resolution in a RESTful interface

Background I have a RESTful HTTP API. I have a resource. GET /my/cat HTTP/1.1 Clients may want to retrieve the image representation of this resource. GET /my/cat HTTP/1.1 Accepts: image/png ...
0
votes
1answer
35 views

must all urls for a resource be same

I have a Resource named Company, that can have Post Resource, I have a path for create of post as: POST /api/company/{companyName}/post. My question is whether, must i use a path as PUT ...
0
votes
2answers
98 views

REST Service Description in a Hypermedia agnostic way?

How do I implement REST service description in a Content-type agnostic way? Background I am developing a RESTful API for Web Application. Now this app is somewhat different than a standard ...
1
vote
4answers
134 views

Performing a username lookup before registering a User while conforming to REST philosophy

I have a REST Service based on Spring MVC. JSON is the only interchange format for any client to talk to this service. I'm working on implementing a user registration workflow. So I have created an ...
2
votes
1answer
58 views

Using short-lived REST requests to obtain messages from a message queue for clients

I would like to put together a system where clients obtain messages from a REST API, but with the producer being able to use the semantics of a message queue: e.g. ordering of messages, a destination ...
6
votes
4answers
515 views

Should a REST API be able to convert datetime to appropriate clients timezone?

Whilst implementing our API, the issue of datetime and timezones came up. All dates are normalized to UTC in the database. Currently, in the non-API application, all datetimes are converted based on ...
2
votes
2answers
99 views

Rest api with a hello resource / main entry point

I'm designing a Rest API for our web application. There's one idea that came to my mind today and I haven't found in recent searches: a "hello" resource, where clients are supposed to connect as the ...
2
votes
1answer
69 views

Modeling resources with links

Context To be fully compliant with the REST principles enumerate in Fielding's dissertation, a resource must contains links that redirect to other resources that have a relation with it functionally, ...
1
vote
2answers
142 views

WCF service design

I am rather new to WCF (or rest, or Json for that matter) and I'd like to have some expert opinions on which methods to define. Some short introduction to give an idea of what the webservice should ...
1
vote
1answer
115 views

Databaseless ASP.NET MVC 5 on top of an external REST API

Where you would envision an out-of the-box ASP.NET MVC 5 web application on top of an MSSQL database, I have now been placed in a situation where I'm supposed to use custom external token endpoints ...
0
votes
1answer
70 views

sessions and stateless rest

I believe this question has been discussed to death. I was reading up on REST and it says that it has to be stateless. Yes i do understand there are application states and resource states. Taking ...
1
vote
1answer
94 views

Is it correct to implement all the payment flow in the client rather than in the server?

I’m building a mobile app marketplace and I came to the point of integrating a payment tool. I'm using Mangopay, which has a nice workflow for making payments in a marketplace using its REST api. The ...
2
votes
3answers
161 views

HasMany RESTfull Implementation

So I've been reading a lot on RESTfull design - specifically dealing with resources. Taking the canonical example of Users, Posts, and Comments, with relationships as: Users ---(hasMany)---> Post ...
1
vote
1answer
96 views

RESTful service layer with MVC

I need a advice on creating an architecture where I want API layer in between UI layer and business layer. UI layer should only consume REST services for displaying data. Reason for doing this is ...
0
votes
1answer
81 views

API Breaking Changes

I have a public REST API for creating new business profile records in my system. The request itself looks similar to this: { "BusinessName" : "AName", "CurrencyCode" : "USD" } You can see ...
1
vote
1answer
67 views

REST API and user rights

I am developing an application using Angular and REST API and I'm facing a problem concerning user access right. The application runs this way: A user signup The same user creates his organization ...
14
votes
2answers
975 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 ...
1
vote
1answer
42 views

Where to do post-processing of API call when used in MobileApp

Let's say I want to write an (iPhone) app, which tells you if you are in manhattan or not. This query involves additional computation after a google map API call (and is of course just an example). ...
0
votes
1answer
215 views

Asp.net MVC web application and iOS mobile app

I am currently writing a web application in ASP.NET MVC, so far it is mostly a simple CRUD web app. The database is hosted on the cloud and I am using Entity Framework to interact with it. I know ...
2
votes
1answer
138 views

ASP.NET how to handle external application settings

I'm converting an application from C# WebForms to MVC. The application gets settings from a centralized location using Web Services. These are settings you would typically find in a Web.Config, but ...
0
votes
1answer
206 views

How to avoid LazyInitializationException using Hibernate and Jersey

I am working with Spring Boot + Jersey + JPA/Hibernate to build a RESTful API. The issue I am encountering right now is when I have a relationship in my JPA Entity that is lazy loaded I get a lazy ...
1
vote
0answers
44 views

Server responding with UI logic, String representations of data as string over flags

I think there isn't a large enough degree of separation between Business Logic, Data and Presentation in some of our products. I'm trying to explain this to collegues but I'm finding it difficult as I ...
3
votes
4answers
149 views

What HTTP status using for REST search query which returns nos results

I'm wondering how to manage empty results returned by search queries in a REST web-service : I there was a query like my_ressource_collection/{id} and the resource didn't exists i would return 404 - ...
1
vote
1answer
248 views

Rest Client API design and implementation (with RestEasy)

I am working on a design to create a generic rest client for our application for current and future integration's with multiple services (different external systems). Following is a high level diagram ...
3
votes
1answer
173 views

How should I pass login data from client to server using REST API

I want to create a new session, the new session will be created by logging in (naturally). Should I pass the username and password: via URL (POST request to ...
5
votes
5answers
1k views

OAuth2 ROPC vs Basic Auth for public REST APIs?

The specific use case I'm interested in here is authenticating REST clients against publicly-available server endpoints (such as a public REST API). The simplest solution here is Basic Auth. But I ...
1
vote
1answer
67 views

I am able to use PUT to act like GET when using my REST API

I wrote a simple REST API (just learning) using Go and I am calling it using python requests. I have two methods, "update_x", which updates the value of the resource, "get_x_times_n" which gets the ...
1
vote
3answers
121 views

Service oriented web architecture speed

Imagine a simple service architecture setup: single server where I have one service acting as a REST API (PHP), another service for rendering frontend (nodejs), and maybe a database service. They all ...
10
votes
2answers
756 views

Event sourcing and REST

I came across Event Sourcing design and I would like to use in an application where a REST client is needed (RESTful to be precise). However I fail to connect these together as REST is quite CRUD-like ...
3
votes
1answer
676 views

REST API security: HMAC/key hashing vs JWT

I just read this article that is a few years old but describes a clever way of securing your REST APIs. Essentially: Each client has a unique public/private key pair Only the client and the server ...