Questions tagged [rest]

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

Filter by
Sorted by
Tagged with
-2
votes
0answers
37 views

Rest API better alternative to polling for asynchronous long running task

I have created a flask restplus API that accepts xlsx file as input and returns an XML. This would be consumed internally by our different APIs The current flow: other API POST an xlsx file by ...
1
vote
1answer
77 views

How to keep user inputs consistent with assumed inputs to slow computations at the backend?

Background: I'm writing a clinical trials simulator. The user defines future trial options, eg a trial with 100 placebo patients, 200 treatment patients, "optimistic" outcome scenario, etc. There can ...
0
votes
0answers
33 views

REST api - search url

I'm building a REST api and want to make sure to follow the best practices. I need to expose a method which will return a 'Document' entity by its 'Lot' number. It is possible that for a specific '...
1
vote
2answers
115 views

how to build microservices that also have GUIs

In a microservices architecture where each component does one thing, how do you handle GUI logic? How do you avoid building a front end web application that has a lot of smarts built into it where it ...
0
votes
2answers
85 views

How to increase difficulty of intercepting resources downloaded from developer console

I have a web application that allows user view our data that front-end in JavaScript fetches the data via a Restful request to back-end, then render it in the application. The size of each data can ...
-1
votes
0answers
38 views

REST API design - recommended response with SPA apps

consider SPA application which uses centralized store like ngxs or vuex. Are there some recommendations about response of REST API? Any specifications where I can read more about that? For instance, ...
0
votes
1answer
78 views

Should a GET endpoint in API server A make a POST request to a separate API server B?

I'm having trouble finding an answer for this when I search variants of my question. A use case I'm thinking of is a client makes a GET request to API server A for some data, but in order to provide ...
2
votes
3answers
142 views

Rest API design - ids as string

I started creating an application which uses strings as key, in order to have readably, non-guessable API values: GET https://myApi.com/docs/obuxn6xhzg GET https://myApi.com/docs/qxfj1g40xf PUT https:...
-3
votes
1answer
144 views

A True RESTful API | Help needed

I know that a RESTful would have unified API and it treats everything as a resource (a noun, example a book, a product,...) and it can be applied with CRUD operations using HTTP Verbs (GET, PUT, POST, ...
2
votes
4answers
189 views

Is it better for a microservice to access database tables individually or to work with joined data?

In my limited understanding of microservices they seem to focus on quite limited pools of information, leaving it up to the application to bring all the data together in ways which were perhaps not ...
6
votes
4answers
798 views

Is it a bad idea to pass JSON objects on the query string for an API “search” operation?

I'm building an API endpoint for a UI grid to search, filter, and display a list of domain objects, let's call them "widgets." In the past, I would have built this with a list of named query string ...
1
vote
3answers
241 views

Should 404 response include body

I wanted to know what fellow developers follow while designing rest API error responses. For all the not-found get resources, do you also send the some sort of body indicating that resource was not ...
0
votes
1answer
81 views

What is the best practice to insert two similar records in sql server db table which will be sent to two different destinations?

I am working on parsing a file and inserting records into SQL Server DB.The database table structure will be something like this: A Users table which contains (id, name, address, destinationName,...
-1
votes
1answer
46 views

Would it work to use http patch more general and even “unpatch”?

Is it a good idea to make http patch more general and also create a new property or even a new persistent entity if it does not exist. The patch could be general and send http body for different ...
1
vote
1answer
60 views

Design of a Router/UrlMatcher

Note: I am not sure if the question belongs to this particular stackexchange . If it does not, please let me know and I will delete it here and post it on the relevant exchange. Though it seemed more ...
2
votes
2answers
51 views

API naming for authentication API composed by many steps

I have an API which include a registration and login process. Both process have an authentication sub-process. This sub-process are many steps which API validate a client specific data. I have many ...
1
vote
0answers
40 views

How to store the state of an IoT device in a REST backend?

I'm facing a very simple scenario that should have a simple solution, but can't seem to figure it out. I'm trying to design a RESTful app that replaces a (stateful) remote for an electrical appliance....
1
vote
1answer
79 views

Designing low fault software rest API calls to achieve data synchronization between two different systems

I have been looking for a better design approach and will be providing my problem statement here with a similar example. As I don't have logic already in place but have the solution in mind which I ...
2
votes
4answers
136 views

How to model correctly a non persistent action via REST API

Hi I have a Order this order needs to be sent to an order system. There are several oprations that can be performed. Create Modify Check-Modification (this happens on existing order) Simulate ...
0
votes
1answer
23 views

API Request/Response Model for showing differences in JSON objects

I am writing an API to merge two different JSON Objects. Both of these objects can have same as well different number of properties. Object 1 : { "name": "Sam", "lastName": "Hanks", "...
0
votes
1answer
87 views

Should REST API rate limiting specifics be told to the caller?

I have an REST API, which has a rate limit of 1 query per IP per 5 seconds. When the user tries to call the API too often, I respond with the HTTP status code 429 Too Many Requests and a JSON message. ...
1
vote
3answers
91 views

Is RPC itself a network protocol?

Design Data Intensive Applications compares RPC and REST. It says The RPC model tries to make a request to a remote network service look the same as calling a function or method in your programming ...
2
votes
3answers
98 views

Rest application header based vs path based service routing

i have a rest API that is a front end to a more complex SOAP based service. The soap based service uses extended(custom) WSA-addressing headers in order to perform its routing. The extension of the ...
1
vote
1answer
63 views

Background job in microservices

I have a basic java Dropwizard service within cluster of microservices. It manages user resources with restful api styles. Let's call it user-app Then there is a new operation / api endpoint that ...
0
votes
1answer
34 views

Appropriates names for Api implementation and Api Client Library

Suppose I have a big project, called Northwind. It's a website in front of a database. Now management want me to create a public API for this. I create a new ASP.NET Core project called Northwind.Api ...
1
vote
0answers
11 views

Hypertext Application Language grouping items in a collection

For the purposes of this question I can use an example document straight from the HAL spec, since my problem is very similar: { "_links": { "self": { "href": "/orders" }, "next": { ...
2
votes
1answer
61 views

Should I use Repositories or wrap that logic in an additional service layer in my Controllers

I am building a Loopback4 app just for learning; I have a scenario where I have to check for a couple of things before sending that request to the database, so my entry point is my Controllers Method, ...
2
votes
2answers
94 views

Elegant way to relate two php scripts

I have been writing some code in PHP for a bit of time, but I am still pretty new on it. I have a script with all functions I need for my webapp. The script looks like this? function foo(bar){...} ...
1
vote
1answer
58 views

Why does the Django Rest Framework encourage separating Model, Serializer and Views for the same object across multiple files?

Summary: Why shouldn't I put model, serializer and view classes for the same object in the same file in my Django Rest Framework application? I'm building an application using the Django Rest ...
1
vote
4answers
98 views

REST API include permissions into resource

We currently have REST API, where you have a set of different resources, like: GET /cats GET /cats/{catId} GET /dogs Clients decide whether they can perform an action based on resource permissions. ...
-3
votes
1answer
240 views

How do I overcome the limit of 4000 results returned from the REST API?

I have an application which records the company man hours of employees and other related details. Because it gets updated everyday or when a new employee is added, it tends to lead to a very large ...
2
votes
4answers
152 views

Alternatives to polling an API

Assume we have a desktop application (probably WinForms) that acts as a client to some API for an app with a messaging function. This API has endpoints that return a JSON of messages, and who sent ...
2
votes
2answers
92 views

How to combine session-based authentication and stateless REST API

What is the proper way of combining session-based authentication with stateless, token-based authentication for a REST API? Use case: User logs-in in the standard, traditional, session-based way. ...
8
votes
1answer
841 views

Use 404 or 200 when null result (REST) [duplicate]

Let's assume we have an Entity { "id": 1 "inProgress": true, } We have endpoints: /api/v1/entities/ for fetching all entities, /api/v1/entities/1 for fetching entity with id = 1 /api/v1/...
2
votes
1answer
62 views

best way to create @PUT upon multiple entities and compatible with RFC

I am trying to build the best PUT possible that allows modifying multiple entities upon single requests using java jersey. The idea is to send a request with multiple entity ids as @PathParam values ...
0
votes
2answers
149 views

Is it wrong to build as much granularity as possible into a REST API?

I was recently considering the difference between using raw SQL and using a query builder like knex.js for writing dynamic queries so that I get any level of granularity for filtering database tables. ...
1
vote
1answer
90 views

How should REST resources relate to the server database schema?

I am trying to understand whether resources in a RESTFUL API should directly represent the underlying database or not. In particular, a problem that I have is that I usually use highly normalized ...
-4
votes
3answers
73 views

REST API design: Best practice for POST to create an object to a list

I have an API that return list of Employee. This API will have an offset and limit for pagination purpose. On the frontend, I use Single-Page Framework (Vue/Angular/React..). This SPA have a Employee ...
0
votes
2answers
87 views

Http Status Code When Downstream Validation Fails

I have an API that charges for an order. It accepts the orderId and the amount as inputs. Then it makes a '/charge' call to the downstream, which returns a 202. Immediately after this call, it calls a ...
1
vote
2answers
409 views

Retry a failed REST API request - Java/Postgres

We have a REST API which calls a third-party REST API to Send Emails. The Third Party API is not super reliable and randomly fails every now and then with a 500. Our Clients do not want to retry at ...
2
votes
6answers
452 views

Is building REST API compatible with Agile approach?

I believe I understand what REST is and what Agile is. Our company has some APIs that we maintained, usually we only needed to tweak some requests or responses to fit new requirements. Recently, we ...
1
vote
4answers
657 views

Is creating ViewModels in Web API a bad practice?

So, somebody at work who is twice as experienced than I am, told us that we must not create ViewModel classes within Web API. (We are using Angular for UI) In his opinion ViewModel is ASP.NET MVC ...
1
vote
4answers
128 views

What's the ideal way to send a success message in the response of a HATEOAS Rest Api?

I am using HATEOAS architecture in my rest application and want to send internationalized success message that will be directly consumed by the client. I know we can just add a key in the response but ...
2
votes
5answers
423 views

Is it acceptable to accept multiple results in a unit test?

I've noticed this while implementing a Rest-API today. We first define interfaces for each API method and the api contract for one endpoint allows (amongst others) two status codes: 200 and 204. Both ...
2
votes
0answers
103 views

How to implement SAML Authentication SPA and REST Backend

Developing a SPA (with VueJS) that is talking to our own REST API Backend(Separate server). Normal authentication flow in the SPA: User credentials after submission are sent to the backend and if ...
1
vote
4answers
415 views

Cron Job Microservice

I'm implementing an application that's made of bunch of microservices. Each of them is fairly simple, focusing on its own task. Let's call two of them Service A and Service B. They are both ...
2
votes
3answers
219 views

REST API: what should PUT do with complex objects?

Let's suppose I have the following objects in my domain: class Warehouse { int Id; string Address; Item[] Inventory; } class Item { int Id; string Name; int Price; int ...
1
vote
1answer
61 views

Abstracting common functionality for REST and CLI

I have made an application that deals with collections of images. Currently it has a REST api to add/remove images, create/clear/delete collections and a worker that can automatically fetch images ...
1
vote
1answer
85 views

Bounded contexts and domain-wide public REST API

I'm prototyping out an application here where I'm using domain-driven design to identify the domain(s) of the application and I've ended up with something that - at least so far - feels like a fairly ...
4
votes
2answers
146 views

client / server division of responsibility

It makes sense to give the server applications as much responsibility as possible as to avoid having to rewrite logic across different types of clients. In my case I am developing a data structure ...