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
-3 votes
1 answer
73 views

HATEOAS API - best practice to create multiple entities in one request

I have a HATEOAS API (in ASP.NET) with an endpoint: POST /api/messages - to create a new message and it returns the location of a new message Now I have a requirement that in some cases based on ...
MarisKs's user avatar
  • 97
11 votes
5 answers
3k views

Why split up data retrieved from a database into multiple endpoints, if we need ALL the data anyway?

I have a "Games" API which retrieves video game data from a large database. The /games endpoint returns some very basic information about the game, such as the title, description, etc. More ...
Yeager's user avatar
  • 121
0 votes
3 answers
85 views

How can I avoid duplicate annotations when validating both Entity and DTOs?

I am using the Spring Boot framework to create a RESTFUL API and I need a way to avoid the duplication of validation rules when using multiple DTOs as request/response objects for my endpoints. Using ...
Marco Pierre White's user avatar
0 votes
1 answer
94 views

How to handle different json response for the same api rest endpoint and different http status

I have an endpoint similar to GET ../produtcs/123 where 123 stands for an ID. The REST service response with either status 200 and a json object A {"deliveryData": {"status": 200, ...
surfmuggle's user avatar
-1 votes
2 answers
103 views

Efficient access control list for collections of objects returned by REST api

We have a REST api endpoints that return collections of objects where users could perform different types of actions on those objects. We need it to turn on/off different UI options based on that ...
tlzg's user avatar
  • 113
0 votes
1 answer
100 views

POST and PATCH for a nested resource in REST API

One post can have many comments. How can I design REST API urls for HTTP POST and HTTP PATCH for comments. My idea is to have the following endpoints: HTTP GET: /posts/{postId}/comments HTTP GET (all ...
Aleksander Chelpski's user avatar
0 votes
1 answer
72 views

Alternative ways to transfer records from one environment to another

I'm working on an application which has a feature of syncing records between two environments. For example, a record A is created in environment A. After a user verifies it, the user can use the sync ...
Lucifer Darknight's user avatar
1 vote
2 answers
77 views

Request validation on API proxy

I am creating an API proxy that acts as a bridge between our frontend application and an AWS opensearch server. This proxy has additional features such as retries and timeouts. One of the features I'm ...
lightning_missile's user avatar
1 vote
2 answers
158 views

Creating associated resources before creating the main one in a REST setting

I'm not sure how common of a scenario this is, but what are some approaches to creating associated entities before you have the actual main entity they're supposed to be linked to? (basically having ...
string_loginUsername's user avatar
1 vote
5 answers
250 views

DTO vs POJO (Entity) on POST request

If I have for example a User POJO like the following @AllArgsConstructor public class User { @Id private final String id; private String username; private String password; private Date createdDate;...
iqueqiorio's user avatar
1 vote
3 answers
221 views

Should this request return a status of 404 or a different status

We have an API that allows clients to POST some request which takes some time to complete, so the API simply places it on a message queue and returns a 202 (Accepted) and a new GUID in the body. The ...
JoelFan's user avatar
  • 7,091
1 vote
1 answer
107 views

Many to many REST design for users and teams

I am designing REST API for users and teams of users. One user can belong to multiple teams . One of the requirements is to be able to sort the users belonging to team in alphabetical order. Teams can ...
Marcin Majewski's user avatar
1 vote
0 answers
48 views

Endpoint design for single and bulk requests

I'm working on a project in Python and want to get it hosted for others to use, the internal recommendation has been to host it on AzureML (it is a non-machine learning model, but follows the same ...
evaless's user avatar
  • 11
0 votes
1 answer
121 views

When to use PUT vs POST while calling APIs?

GIST: PUT is idempotent PUT is used for updating/creating a resource. POST isn't idempotent. POST is used for creating a resource. So, I'm wondering what should I use in this case and why? I want to ...
barnyard9's user avatar
  • 143
0 votes
1 answer
141 views

Which is better API design for POST endpoints?

I want to create an endpoint for posting different types of commands. I have the option to have one route /commands which can be used for every command type or one route for each command i.e. /...
Christian's user avatar
  • 101
1 vote
3 answers
183 views

What are the benefits of HATEOAS in programs without user interaction?

Let's assume I have a batch job that needs to print orders. It will do so by getting orders from the order service and send them to the print service. It uses HATEOAS to discover the link from the ...
wertzui's user avatar
  • 119
0 votes
1 answer
263 views

Is it okay to combine bff and rest api?

I'm building an application related to donation on streams. And I have such models as "alert" and "alert-template". "alert" is a set of different parameters to understand ...
eugenedrvnk's user avatar
3 votes
1 answer
128 views

Strategies for Adapting SQL-Based Data Retrieval to a Newly Introduced REST API in a Short Timeline

I'm in a pickle following a recent executive decision by our parent company. They have elected to abstract away our SQL data warehouse, transitioning to a REST API for data retrieval. The purported ...
javery's user avatar
  • 61
-3 votes
1 answer
278 views

I do not like RESTful APIs anymore and dont understand why nobody agrees with me [closed]

Some years ago, every API I developed was a REST API and I did everything to follow the best practices to make them "RESTful". But after some time, I have my doubts if RESTful APIs that ...
David Mason's user avatar
0 votes
2 answers
624 views

Do we need APIs to just access databases?

At work, we have a Web application, which makes queries to databases, and I’m asked to determine if using Web APIs could be an added value. Personally, I’m not convinced it is. I know Web APIs are ...
Pine Code's user avatar
  • 109
0 votes
1 answer
91 views

REST - Adding a new field

I have an object with fields like ID, CODE, NAME, etc., and it has its own database table with each field. And I am working on implementing the REST API for this object. I want to expose all these ...
Arpit Jain's user avatar
0 votes
0 answers
175 views

Client-Server Coupling in gRPC vs REST

Quoting this article - The Other key differences: gRPC vs. REST section (client server coupling): Client-server coupling REST is loosely coupled, which means the client and the server do not need to ...
Veverke's user avatar
  • 431
1 vote
4 answers
721 views

How to build REST uri that fetches children by parent ID

I am building 2 REST microservices: ParentService and ChildService. I need to build endpoint to fetch all Child resources related to specific Parent, so I have these URI's as options: GET /parent/{...
milosdju's user avatar
  • 111
-2 votes
2 answers
856 views

API design. Make multiple PUT request or one single PUT request for updating multiple fields of the same database

I have three seperate fields and all three are unrelated to each other but part of the same collection (Tables for SQL folks). Now, what I'm getting stuck at is, should I allow end-users to make one ...
CrumpledMemories's user avatar
-2 votes
1 answer
70 views

How to Implement Spring Boot Endpoint for Confluent Cloud-Like Batch Payloads?

I'm currently working on a Spring Boot application where I need to create an endpoint similar to the one mentioned in the Confluent Cloud documentation (link). The cURL example provided in the ...
Manupriya Logus's user avatar
0 votes
0 answers
160 views

REST Api filtering, sorting and order

I've seen in several REST API guidelines recommendations to use filtering in form of, e.g.: /products?filter=name eq 'Milk' or price lt 2.55 (example from: https://github.com/microsoft/api-guidelines/...
andrew.fox's user avatar
2 votes
2 answers
175 views

Do RESTful endpoints elminate the need to SQL triggers?

Do RESTful endpoints eliminate the need to SQL triggers? Triggers are supposed to execute after a certain event. Would moving to RESTful api endpoints conceptually eliminate the need for SQL triggers? ...
henhen's user avatar
  • 149
0 votes
3 answers
280 views

Is it appropriate to use PUT for resources when the id is deterministically derived from immutable properties?

I'm working with a RESTful API where a POST operation is used to create a user. A required field, which could be an email or a unique user nickname, is unique across the system. The response to this ...
Sergey Kolesnik's user avatar
2 votes
3 answers
625 views

Is it bad practice to create a resource in a GET request when the resource will be created later automatically?

At the moment I design a RESTful API for a resource that is normally created by a cron job from existing data. Since the cron job runs only every 10 minutes it is possible that GET: /user/{id}/...
Timo's user avatar
  • 29
1 vote
3 answers
700 views

Should I use a REST API in addition to websockets?

I am writing a web application for a simple, multiplayer dice game so the traffic from the client to the server is going to be pretty light and latency tolerant. The client will need real-time updates ...
StaticMethod's user avatar
1 vote
2 answers
282 views

Handling simultaneous duplicate expensive read-only HTTP requests

(updated) We have a read-only REST endpoint that performs a somewhat “expensive“ but transient request. Without client needing to poll, we need a mechanism for the server to avoid unnecessary ...
eliangius's user avatar
  • 111
0 votes
0 answers
73 views

sync over async in K8S

We build up a microservice architecture which is called from above by a REACT SPA. All is deployed in the AWS Cloud, that is to say in an AWS EKS (K8S). We have at most 600 users in parallel. Do you ...
kladderradatsch's user avatar
0 votes
2 answers
302 views

Is this service considered "an API"? Could it benefit from being Restful?

I'm confused about the meaning of API, specially in the context of REST. I'm thinking of one example. My company creates an application that runs on a server (the "backend"). (JavaScript in ...
Juan Perez's user avatar
-1 votes
3 answers
933 views

HTTP REST API: Is it wrong to put search parameters in a custom header?

The contents of search string are typically sent as part of the URI query: https://domain.name/resource?search=something+i+am+searching+for Those same contents can be sent as the value of a custom ...
SunSparc's user avatar
  • 175
0 votes
1 answer
81 views

REST API: Include graphical resource representation URL: multiple formats problem

Many resources in the REST API I'm designing have a graphical representation. My fist idea was to include the image URL into the resources: Resource1: type: object properties: image: ...
Maxim Zabolotskikh's user avatar
0 votes
1 answer
151 views

How do I avoid reading from S3 every time the user updates a filter on the webpage?

I am building a web application where a user logs in, and uploads a CSV file with employee data to S3. This is an example of the format of the file. id name country age 3243 John Doe USA 48 Using ...
the_muffin_man's user avatar
1 vote
3 answers
1k views

Correct way to return JSON schemas in a REST API

in our company we have some APIs that return some JSON data. Before sending, for instance, data to the backend using PUT, PATCH, or POST, we need to do some kind of validation in the different clients ...
Antonio Gamiz Delgado's user avatar
1 vote
4 answers
3k views

What's the convention to name a REST endpoint that returns a boolean?

I have an endpoint that returns whether a resource is valid or not (true or false): GET resource/{id}/valid Where the returned value is not a field of the resource and is dynamic, it does not depend ...
Marco Lackovic's user avatar
0 votes
1 answer
126 views

How can I implement a lazy-loading cache for REST objects with custom role-based access?

I'm thinking through adding a lazy-loading cache to my API. Currently, REST objects are filtered out (scoped) based on the user's role, and additional constraints in the system. Users of the same role ...
Brady Dean's user avatar
0 votes
1 answer
2k views

Multithreaded processing of single REST requests

Background: We're providing an API that provides information about all users within a given group. Our API is a high level facade over another low-level REST API. To gather those information we first ...
das Keks's user avatar
  • 203
0 votes
3 answers
705 views

Should a REST endpoint return always the same JSON fields?

For example, let's say that I have an endpoint to get a list of buildings, that can be either apartment or house. The client can filter by apartment or house. Apartment has a property floor that house ...
Henrique Andrade's user avatar
1 vote
3 answers
478 views

Filter using routes in REST API

I am working on making changes to an existing Web API that exposes information about orders for specific customers. As a developer, I am used to seeing "more or less" RESTful APIs, and I ...
bakided698's user avatar
0 votes
1 answer
479 views

Exchanging data between two Microservices

I am facing this problem and would like to review my approach to it here. A Client sends an HTTP request to Service A and is expecting an answer. Service A is connected to DB A. When it receives a ...
Solidak's user avatar
  • 157
-1 votes
1 answer
210 views

When does a REST API stops being one in terms of state management?

As far as I understand, there is no certain boundaries for the RESTness of an API. However, I would like your help to understand how large and long (in terms of running time) a caching or state ...
yokus's user avatar
  • 7
1 vote
1 answer
59 views

How to deal with mixing models between services?

I am working on an API that has a User resource to represent the current user and a User service that handles business logic for representations of this user. I need to introduce an Organization ...
JRhodes's user avatar
  • 19
0 votes
0 answers
168 views

How can I secure the backend in a meaningful way when users log in via OAuth2 in the frontend?

I'm thinking about a rewrite of a existing application. This legacy application does not separate frontend and backend. It's a single application with server side rendering. I want to rewrite it to a ...
samjaf's user avatar
  • 121
0 votes
0 answers
331 views

Howto design a Rest-Client in c# the right way?

apologies, if my question is to trivial. But i after doing some research i couldn't find an appropriate answer to this seemingly simple question. As a developer with some experience, i know that i ...
Michael's user avatar
2 votes
3 answers
254 views

Rest API: paths versus queryparams for user accounts

I'm looking for some guidance around REST design for user account endpoints. I generally understand REST and some of the principles involved, with paths being used to fetch items from a resource: /...
aroooo's user avatar
  • 255
0 votes
1 answer
285 views

Testing REST API endpoints. How do I setup the tests?

When writing tests for my FastAPI endpoints I am not sure which is the best way to setup the test (store data in the DB, prepare data for the body of a POST call, etc.). I can either use: direct ...
user's user avatar
  • 479
-1 votes
1 answer
135 views

How to auto-scale a service based on requests count and internal processes

I have a service which is used to register tasks. These tasks are asynchronous and executed in background using a state management engine. The state management engine is running inside the service and ...
S7H's user avatar
  • 107

1
2 3 4 5
32