Tagged Questions

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
2answers
50 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
62 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
84 views

the better url for a API: /api or api [on hold]

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
0answers
26 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 ...
20
votes
3answers
749 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
24 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
173 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 ...
0
votes
2answers
175 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
330 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
95 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 ...
0
votes
1answer
61 views

how will my api interact with Ejabberd?

I am working on backend of chat application that provides services to Android,iOS and Web application. To keep everything central,I have created web services which allows apps to read and write data. ...
4
votes
1answer
47 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
115 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 ...
1
vote
2answers
82 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
118 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
68 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
173 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
285 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
47 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
98 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
79 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
53 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
206 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
117 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 ...
0
votes
1answer
84 views

Are there any serialization schemes for OOP that include methods or operations in the contract in addition to data structure?

So typically we create schemas, mime-types, etc for our objects when we're communicating to another system about objects. The document usually defines data structure of the objects for serialization ...
0
votes
1answer
81 views

Real time middleware system: Direct DB access vs REST API access

I'm developing a complex environment which involves a web application, a mobile app and a real time middleware system which accesses the DB for on-site tag readings. Currently, the web application ...
-2
votes
1answer
113 views

JAX-RS and application wide business logic/resources. My brick wall has be found [closed]

I think I'm definitely hitting a brick-wall in understanding how to implement this. I would very much appreciate any assistance in this. All my JAX-RS links, Oracle, IBM and Stack overflow links ...
0
votes
1answer
64 views

What are the standards for having nested resources in REST API

I am designing a REST API and figured I'll just look at how others are naming their resources and choosing the routes. I look at Twitter's API and see that they have nested resources. For example: ...
1
vote
0answers
46 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 ...
-1
votes
1answer
82 views

How to design RESTful URI to get all unread messages?

I'm developing an ASP.NET MVC Web Api 2 with .NET Framework 4.5.1 and C#. I have these entities in database: Users, which are members of groups. Groups. Messages. Users can sent messages to a ...
2
votes
2answers
151 views

What is a good design pattern to implement REST services on mobile?

It is easy to implement calls to API endpoints, then to parse JSON and handle the data - but what is a good design pattern for this? Here are some ways I have tried but I feel like there should be a ...
0
votes
1answer
94 views

Anonymous access to api REST, protection

I have a public website that does not require authentication. It's a lighting calculator for indoor cultivation. Anyone can enter and complete the process and ultimately save your settings for future ...
1
vote
2answers
376 views

Is this a good Visual Studio solution structure for a domain driven design RESTful web service?

I am building a .NET 4.5 C# Web API RESTful solution and I would like someone to tell me if my project solution is correct and/or wise(-enough?) for a solution designed using Domain Driven Design, ...
0
votes
4answers
152 views

How to design RESTful Web Api to represent Resources

I'm developing an ASP.NET Web Api 2 RESTful web api with .NET Framework 4.5.1 and C# and I'm trying to understand how to expose resources through a Web Api: Imagine that I'm a group owner and I am ...
1
vote
2answers
125 views

Architecture to handle service concurrency on resources exposed via REST API [closed]

REST API frameworks like Python Eve handle concurrency control via an entity tag. This ensures that several clients which loaded the same resource will not overwrite the changes of each other, because ...
16
votes
4answers
445 views

Providing friendly URLs for a website vs. realities of database IDs

We have a database of resources, be they products, blog posts or something. We need to design a URL scheme to address them, for the public website. Here are two examples that are database ID bound: ...
2
votes
1answer
243 views

What is the advantage of using Direct Web Remoting over a REST web services design? [closed]

I have an enterprise Java web application deployed in tomcat. I am looking for ways to integrate a HTML & JS UI with the mid tier java code. So far, looking around I have found that there are two ...
1
vote
1answer
75 views

How to avoid model duplication in JavaEE web applications with a JSON front end

Recently we developed a web app that uses the following tech stack: hibernate as orm spring extjs (MVC javascript front end) For 1 business object, let it be a Personnel, we have: 1) a Personnel ...
1
vote
1answer
316 views

Public API Facade with Micro Services

Consider a micro service infrastructure in which each service is responsible for one set of activities, and exposes a RESTful interface to its functionality. For example, assume a chat application. ...
1
vote
1answer
103 views

What standard to use for RESTful JSON API [closed]

I am currently reading the book RESTful Web APIs by Leonard Richardson, Mike Amundsen and Sam Ruby, that describes the Collection+JSON pattern, and while searching around the web during my exploration ...
6
votes
3answers
290 views

Proper Response to HTTP Request When Too Much Data is Requested

I'm building an API for an ad serving platform that will allow you to request tracker data for ad campaigns. Campaigns often exceed hundreds of millions of requests, which means there will be many ...
0
votes
1answer
145 views

REST API design for associations/aggregation

I am building RESTful API that manages persons and lists. There can be many List and many Person each with its own set of properties. Person can be in zero or more lists, List can contain zero or more ...
1
vote
1answer
91 views

Is routing a site with RESTful not the best when you have very long URLs?

I've read a lot about RESTful, but I have always had a hard time figuring out how I'd use it with a very long query string. This is an in-house project, and it won't always have a simple /someAction ...
1
vote
2answers
160 views

Is RESTFUL API as back-end service one of the best (or suitable) choice for Mobile App? [closed]

I have a background on .NET development, recently I was asked to code back-end service for a mobile app. I had experiences on MVC, and now I'm trying to understand more on Restful Web API. My ...
0
votes
2answers
235 views

How does Twitter's “dogfooding” work? If they are using different URL's, how are they using their own API?

I heard that twitter practices "dogfooding," meaning that they use their own API for the website. However, I don't really understand how that's true. When I use Firebug, I see that all the AJAX calls ...
36
votes
5answers
4k views

Passing functions into other functions as parameters, bad practice?

We've been in the process of changing how our AS3 application talks to our back end and we're in the process of implementing a REST system to replace our old one. Sadly the developer who started the ...
0
votes
2answers
117 views

API Class with intensive network requests

I'm working an API which works as "intermediary" between a REST API and the developer. In this way, when the programmer do something like this: User user = client.getUser(nickname); it will ...
0
votes
0answers
53 views

Single result as REST/ODATA response on GET

In an API which should be both restful and support OData for different client types. I have an endpoint that always returns a single result. Should I: Return the entity as a single entity? Put it ...
0
votes
2answers
148 views

Which pattern is suitable to send multiple type of responses through REST web service?

I have bunch of REST style web services which support XML and JSON type responses. Now I have to modify existing web services such that they provide Protobuf type of responses. Developer who has ...