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

learn more… | top users | synonyms

4
votes
2answers
87 views

Rest design - Multiple calls vs returning all data in one call

I am trying to build a rest API for an android app. Suppose I have a users table with (id, name, email) and a songs table with (id, song_name, album) and a rich join association between them as ...
1
vote
0answers
22 views

Architecture: mobile apps for different clients with their own dbs different servers?

My general feeling is that this is a question which must have been answered but I am struggling to find resources for it. I know little about mobile app dev but my knowledge of web services is pretty ...
1
vote
2answers
60 views

REST autocomplete endpoint design

We're designing a rest endpoint for retreiving name autocompletion suggestions for hotel names. Currently it's defined like this: GET /suggest/:term, so that if you queried `/suggest/hil' you would ...
0
votes
0answers
17 views

Combining Fitnesse, .NET and RESTful APIs

I know there is Fitsharp for combining Fitnesse and .NET. And there is RestFixture to combine Fitnesse and REST. Is there a way to test a RESTful service with Fitnesse under .NET? If not, is there ...
1
vote
1answer
46 views

Webapp : 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 ...
2
votes
2answers
109 views

Restful User/Password Authentication

I'm currently designing a REST-API with the following properties: Backend for a single page application (Later Apps) Integrated user database for each instance HTTPS/TLS only Authentication with ...
15
votes
1answer
270 views

Rest APIs - mobile specific challenges

I'm working on a new iOS app project, on the mobile side. Some architecture changes are happening and it turns out we will have to rely on a custom built private API that will be used by the app we ...
3
votes
3answers
89 views

Designing CRUD part of an HTTP API

This question is in the context of web based applications. A web server exposing an HTTP api for clients (e.g. running in a browser but not necessarily). Usually the web server would be connected to ...
1
vote
1answer
44 views

Handling Many to Many Relationship using Restful Uri

I am having confusion while choosing a database relation and Restful URI for application I am developing. I am making a simple library application with following requirements. Book can belong to ...
1
vote
2answers
51 views

Good practice to save the last time user accessed the app

Using a JWT authentication, the user doesn't have to log in each time he uses my app. I would like to save in DB the last time the user used/opened the app. Technically, I have a set of REST API ...
0
votes
0answers
41 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 ...
0
votes
0answers
50 views

Better Approach for retrieving multiple RESTful calls

I have an Android application that associates bluetooth beacons with data that is retrieved from a server via RESTful calls. Once the app is launched, we have a page with a table that is being filled ...
0
votes
1answer
28 views

Field level permission checks for REST API - is this validation?

Let's say that we have some sort of "schema" for a rest resource, something like (pseudocode): ExampleResource: field1 = field(validate=is_string()) field2 = field(validate=is_int()) ...
0
votes
0answers
22 views

SPA with RESTful backend

I'm building an app based on ng-seed which is angular setup with routing out of the box. I'm backing the app with a rest interface of which I aim for Richardson level 3 compliance. Often it seems ...
2
votes
3answers
136 views

Best practice for a REST-ful API where objects would naturally have a “/” in their identifier

I am designing a REST api for a document management system. To make the API more natural, I thought about using the natural identifier for a file, which is it's path (usually having forward slashes ...
0
votes
1answer
59 views

What is the best way to organize RESTful endpoints [closed]

Let's say I have two types of resources I want in my API: person and class. These two have a many-to-many relationship. As such, would I expect to be able to interact with the following endpoints: ...
1
vote
0answers
89 views

Why does convention say DB table names should be singular but RESTful resources plural?

It's a pretty established convention that database table names, in SQL at least, should be singular. SELECT * FROM user; See this question and discussion. It's also a pretty established convention ...
3
votes
1answer
39 views

How to handle mismatched request body and content-type header?

If someone makes a request with a Content-Type that doesn't match the syntax of the request body, how should the server respond? Is there a standard way of handling this (seems like there would be), ...
-2
votes
1answer
61 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 ...
1
vote
2answers
143 views

What is a good way for Tomcat to interact with another Java application running on the local machine

I'm new to using Java within a web environment. At the moment I have a Java application that we run on a local machine, we'll call it the server app. We want to add the ability to communicate with ...
2
votes
2answers
101 views

Why use a unique hashkey for form submissions?

I have multiple forms and use AJAX to submit them. I asked my boss if he needed any specific format for the form ID and he told me to generate a unique hash and keep it in session; check it whenever ...
0
votes
0answers
22 views

Resource manager for restful service

I was just brought onto a project with a service oriented architecture. There is a central WCF "profile service" that all projects call to get information on users etc. That central profile service ...
2
votes
5answers
423 views

Securing ajax calls to rest api

I need for my app to consume a rest api service and since I will call it from javascript/jquery i need to expose it to the end user. In this case I would also need to expose credentials to the end ...
2
votes
1answer
61 views

How can I create a RESTful-style website if HTML forms only allow to use GET and POST?

Let's say that I want to create a website where users will be able to create, edit and delete some kind of resources, for example posts. I have created a RESTful API, so user can create a post by ...
0
votes
1answer
118 views

When to implement WCF Rest Service and WebApi

I have gone through many articles to understand why we need WebApi's when we can create restful architecture using WCF rest services but could not find some solid reason. Can we use these ...
2
votes
1answer
68 views

REST API paging via headers

Let's say I have REST API which provides me list of something and I want to implement paging support - possibility to tell "give me records 20-29 (page 3)". Currently, I don't care about ...
2
votes
1answer
65 views

what the best practice in REST to append or delete to a list

Suppose GET /users/<id> { user_id : "asdasdas-da-sd-asd-as-d", firs_name : "asdasd", .... department : [{ id : "asdas-da-sdasd-asd", name : "asdasdasdasd", ... ...
0
votes
0answers
37 views

Using REST to get/post/etc polymorphic types stored in Table-per-Type database

I've got a Table-per-Type database something similar to this: public abstract class WorkItem { public int WorkItemId {get;set;} } public sealed class CancelingWorkItem : WorkItem { public ...
2
votes
3answers
116 views

Recommended HTTP status code for “plan limit exceeded” response

I'm designing a REST API for a project where users are always on one of several "plans" - each plan defines some resource limits, such as the max number of users an account may have or the max number ...
3
votes
0answers
83 views

Is there a language for defining restful web services? [closed]

I'm implementing a restful service automation tool for client applications. Basically, the tool takes a config file that defines restful resources, and creates some DTOs and resource classes for ...
2
votes
1answer
36 views

Status transitions with extra information in RESTful interfaces

How would you design a REST interface that triggers a status change of an object, but requires additional properties in that moment? For example, the deliverer of a package needs to change the status ...
5
votes
3answers
124 views

REST API: Resource Ownership

Let's say there are Users and Pets. Each Pet has a single User as its owner, and a globally unique id. Endpoints could be /users/1/pets/2 /pets/2 I feel like the first option could be unintuitive ...
5
votes
3answers
327 views

Is REST only limited to optimistic concurrency control?

Context Due to the statelessness of the REST architectural style involving that each requests stands completely alone, leading server to never store any informations about client. Thus, pessimistic ...
0
votes
1answer
53 views

REST API - Updating a Variable

If you are updating a variable in a RESTful API, for example person's weight, how should this be laid out? What I have thought of: PUT /person/1/weight?weight=150 PUT /person/1/weight {"weight": ...
4
votes
3answers
379 views

Java & REST API: How do I check for duplicate before inserting record?

I am developing an application in Java to parse and upload records from a CSV to an online database, via a REST API. While I know for sure that there are no duplicate records in each CSV file, I ...
1
vote
0answers
179 views

LDAP Authentication with RESTFUL API

I am developping a RestFul API with Symfony2. (v2.6) The front-end application is build with AngularJs. (v1.3.16) I would like to install SingleSignOn Authentication with an Active Directory. Both ...
2
votes
1answer
82 views

URI construction for REST API and use of verbs as resource?

I have two questions. 1) I have a issue of understanding the correct URL construction for a REST API. For example, ...
2
votes
6answers
672 views

What is faster? Using REST API or querying a database directly?

What is faster performance wise? Creating a REST API and having your web app use the REST API to do all interactions with your database OR querying your database directly (i.e. using whatever typical ...
0
votes
0answers
37 views

API Architecture

I have a Laravel web application. Imagine if our company has many customers. Each customer has one or more addresses. Each Address can have multiple fences and each fence has points which define ...
2
votes
3answers
250 views

Best way to consume REST service within Servlet on same server?

I'm builiding a web app and I'm implementing a RESTful API to expose the server to all sort of clients. On the web client I want to have both server rendering and client rendering. The majority of ...
0
votes
2answers
58 views

How to acquire data and render page in context of REST/API application?

In typical REST/API application, build on MVC architectural pattern, what is the best available technique for acquiring data for rendering views? Should it be: as in any non-API application: data ...
2
votes
3answers
97 views

Appropriate use case for “accepted”?

We have a task enqueued by a REST endpoint that will create a resource and then enqueue a task either immediately or delayed based on some business logic. I was thinking of using HTTP/1.1 200 OK for ...
2
votes
2answers
295 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: ...
3
votes
2answers
126 views

Best practice to handle POST with array of objects if at least one object rise 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 is not conform and rise an Exception ? (cancel all transactions or ...
1
vote
2answers
62 views

ID's in resource URLs: database id or per-user id?

For REST interfaces or webapps with nice-looking URLs, I constantly ask myself on what numbers to use if we want to refer to specific resources/pages. A typical approach seems to be to use the unique ...
0
votes
1answer
19 views

Sync client-side data after service invocation in SPAs

Here's a simple scenario: We have a list of tasks and can mark a task as completed by invoking a web service. Doing so will transition the status of the task to completed as well as initialize a ...
-3
votes
1answer
33 views

Validating Server Response [closed]

I have written a REST API and a c# program. how do i validate that the response is real, and from my server. SCENARIO: i distribute a freeware to a certain community, which will then require them to ...
0
votes
0answers
39 views

Adding a chat api to infrastructure

I currently have a REST Api and will be adding a new real time chat feature. I want the applications to have a separation of concerns. I initially was planning on adding a new realtime messaging ...
3
votes
1answer
317 views

null vs missing key in REST API Response [closed]

Say in my application, some users give us their last name, and others do not. In a REST API response, which body is preferred: With a "null" value: {"firstName": "Bob", "lastName": null} Or just ...
1
vote
1answer
110 views

REST - Recommendation route: POST or GET?

I'm building an api route which will pull data from our server. This data is sorted in an arbitrary (changing and unknown to the client manner), and will never return the same data more than once. ...