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
3answers
406 views

Are colons ok in a REST API?

I see many REST API examples with URIs like http://<whatever>/widgets or http://<whatever>/widget/123, for a specific thing. For most things I would just stick with the front slash, but ...
2
votes
2answers
294 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
1answer
219 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
3answers
563 views

Testing front-end app that hits a REST service

A lot of questions about testing here... And I have another one. Forgive me, but I want to make sure I do this right. Let's say I have a front-end application, be it a mobile app, or a single-page ...
4
votes
2answers
169 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 ...
5
votes
1answer
181 views

What is the most efficient way to implement a RESTful client app?

I am working on a web application for ranking some products based on some factors. The user send a search query to 5 restful webservices which by their turn send a response in a JSON format and ...
2
votes
1answer
113 views

Tracking online users with a stateless architecture

I own a stateless architecture, exchanging a JWT token between client and server at authentication time. I want to store in database (once per day) a timestamp related to the user access. Indeed, I ...
4
votes
1answer
209 views

Many asynchronous calls vs single call to the API

We are developing a REST API which among others is going to be consumed by an HTML5 frontend via javascript. The application is for use within the organization and usually has about 300 users, but we ...
0
votes
2answers
151 views

JSON API specification : When do I need to return a 404 not found?

I'm working on a REST api following the JSON api specification and I'm struggling with the "no data" responses (described here). A server MUST respond with 404 Not Found when processing a request ...
3
votes
1answer
300 views

why use authentication token instead of session_id for app(android side) in REST API

in normal php web application after login we use session_id that came from web browser to check if user loged in or not. But in REST API authentication I read some tutorials that say php should send ...
4
votes
2answers
741 views

Best practice to handle POST with array of objects if at least one object raise an Exception

I want to POST an array of objects and make an insertion in database concerning each of them. What is the best practice if one object does not conform and raise an Exception? (cancel all transactions ...
3
votes
0answers
135 views

How to make sure media are used only on authorised sites?

I have a video library that I need to publish for my clients. The clients need to be able to embed a player to their sites and play the videos. I need to restrict access to my clients only so that no ...
3
votes
1answer
130 views

Is having only static pages calling the backend a good idea?

I'm new to web applications development, specially when it comes to frontend, but as I understood, a typical structure for a big application would have a frontend php (or equivalent) layer calling the ...
3
votes
1answer
248 views

Best practice for Restful API that perform heavy calculations (Image Processing)

We are currently developing an image processing restful api. Server performs some CPU-heavy computations image processing upon request and return the image to the client. We want to make this a ...
-3
votes
1answer
144 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 ...
7
votes
5answers
3k 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
823 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
95 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
127 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
635 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 ...
1
vote
1answer
45 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
173 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 ...
0
votes
2answers
113 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 ...
35
votes
14answers
20k 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
103 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
256 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
154 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 ...
21
votes
3answers
33k 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 ...
6
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 ...
12
votes
3answers
6k 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
141 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 ...
20
votes
2answers
16k 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
89 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
109 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
156 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
65 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
830 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
158 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
70 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
233 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
210 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
85 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
100 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
162 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
212 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
160 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
81 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 ...
15
votes
2answers
2k 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 ...