As of May 31, 2023, we have updated our Code of Conduct.

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
0 votes
0 answers
46 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
174 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
158 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
  • 109
0 votes
1 answer
75 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
91 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
211 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
426 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
89 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
270 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
153 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
134 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
133 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
116 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
  • 9
1 vote
1 answer
55 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
69 views

REST API design - Categorised response objects - All, Sub, Dub movies paged response

I am having trouble deciding what is the best way to implement a REST API which does the following: When page gets loaded, it displays a list of Movies and above is a category selector tab (ALL, SUB, ...
don's user avatar
  • 1
0 votes
0 answers
93 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
158 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
1 vote
2 answers
75 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
  • 245
0 votes
1 answer
133 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
  • 439
-1 votes
1 answer
69 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 votes
1 answer
50 views

How to break a bloated decorator into smaller parts in Django?

In a project I am doing, I have to perform a lot of repetitive checks at the beginning of each API end point. As the amount of duplicate code started to grow, I thought of using a decorator to wrap ...
Farzad's user avatar
  • 3
9 votes
7 answers
2k views

Implicit vs. explicit data structure retrieval from a REST API

I'm using a REST API to retrieve data from my back end at my front end. I'd like to figure out which way of receiving data from the back end is the better one (= clean, robust, and best practiced). ...
DarkTrick's user avatar
  • 207
2 votes
2 answers
613 views

What's the proper response when I try to update an existing entity but with not found parent ID

I have an update API (PUT/PATCH) entity/{id} to update a certain entity in my DB. Let's say: entity { id: number, // Primary key, unique, not null content: text, parentId: number // Foreign key, ...
Leo von Barbarosa's user avatar
-1 votes
4 answers
580 views

RESTful Batch Delete

When batch deleting a resource. e.g. deleting all Orders that belong to Customer 99: DELETE /customer/99/order If there are defined business rules1 that prevent Orders that meet specific criteria ...
Geeson's user avatar
  • 3
0 votes
1 answer
209 views

Where should I create my aggregate root? in api or frontend?

I am writing a simple application to apply what I have learned so far in DDD. I have the following mysql tables in my api server Sales Column id pk, int title varchar description varchar Images ...
emhsmath's user avatar
0 votes
4 answers
128 views

REST Route best practices for creating resources

I have some REST API endpoints set up to create a blog post. Each blog Post is owned by a user. I have the following routes: /users [GET, POST]: Get a list of all users, POST to this endpoint to ...
Snuh's user avatar
  • 3
1 vote
2 answers
550 views

Is it OK to return different DTOs for the same endpoint when the user is logged in vs when it is anonymous?

Say that I have a REST endpoint for a chess server. If I'm not logged in and do a GET on /games I could get all running games like: { running_games: [ ..... ] } but if I'm logged in I ...
tonicebrian's user avatar
0 votes
2 answers
872 views

Rest API design - endpoints for multiple types

REST APIS are a Uniform interface. Is it better to add functionality to the search parameters of a GET request with a query parameter, than to add nested resource identifiers to a collection /exists ...
Ten Jones's user avatar
-3 votes
1 answer
94 views

Restful design of read only list, with the exception of one published and one draft item

I have the following domain specs: A historic read only list of items that were published and a currently published item (if any) and an optional draft item (if any). I thought of the following design:...
Decent Dabbler's user avatar
1 vote
1 answer
357 views

Additional questions for an old topic: "How to specify many ids and their variable name in a REST API request?" [duplicate]

Sorry, I would have left a comment on the other question, but I don't have enough reputation. I have the same problem as in this question: How to specify many ids and their variable name in a REST API ...
camarril's user avatar
1 vote
1 answer
128 views

Best practise for designing REST API endpoint that accepts a nested resource POST

What's the recommended design for an endpoint that accepts a nested resource as the following: POST /account { "name": "Project John Doe", "description": "...
user2190492's user avatar
-1 votes
1 answer
129 views

REST API design for resource that is "uploaded" via Presigned URL

I have an API with some specific resource say "cars" which have the following actions: Get all Cars Get one car Add one car for Get all cars and Get one Car, I have a REST api resouce with ...
obaqueiro's user avatar
  • 147
0 votes
2 answers
240 views

Is it okay for a POST response to return resources other than those in the request?

Working on the API, I understood that the behavior for one of the endpoints might be a bit counter-intuitive, but I am not sure whether this violates any RESTful rules. Based on what I have read, it ...
Don Draper's user avatar
0 votes
0 answers
62 views

What is the best way to design endpoints for a restful application?

I am a backend developer and I am writing a restful application. I have a question about how best to design the endpoints. I have a database table that stores values (I just provided an example) |id (...
RoyalGoose's user avatar
4 votes
3 answers
748 views

What to name a POST endpoint that behaves like GET?

My app has an API endpoint GET /sessions/{id} which gets info about a session. This endpoint returns a lot of data, so we allow passing JSON in the request body to filter what fields etc. are ...
Chris's user avatar
  • 153
2 votes
2 answers
170 views

How would I use TDD / BDD when my webapp interacts with an external REST API?

I'm following roughly the TDD style as explained in the "Obey the Testing Goat" book: You have a functional test for your (Django, in my case) web app that tests the observable behaviour via ...
Lagerbaer's user avatar
  • 516
3 votes
4 answers
651 views

Composite ID in hierarchical REST API

Suppose the following: Building has 0...n Rooms, Room has 0...n Seats. I am implementing a REST API which accepts data from different companies, with the caveat that the companies must be able ...
Robus's user avatar
  • 147
-1 votes
2 answers
122 views

REST API vs upserts and "updeletes"

I am building an API that (I am deliberately simplifying the schema below to only focus on what is questionable): I have a table that roughly looks like this: CREATE TABLE IF NOT EXISTS some_table ( ...
Don Draper's user avatar
0 votes
1 answer
153 views

Handling a numerical value that may be specific or a range in a REST API

Let's say I have a REST API that needs to return the width of an object, but that width may either be a specific value or a range of values. What would be the best practice for designing the API to ...
jem473's user avatar
  • 11
2 votes
2 answers
263 views

Saving REST API IDs into a different microservice

I'm not sure how to best ask this, as it's the first time I have to tackle such stuff. It might be that it's a common problem and I'm just using the wrong keywords to search. Basically, imagine a ...
persson's user avatar
  • 123
1 vote
1 answer
275 views

Best method to differentiate between two REST methods with the same pathparam (in Quarkus)

I have an issue regarding the differentiation between two Rest methods that have the same amount of path parameters: @GET @Path("image/{ratio}/") @Produces("image/png") ...
SirHawrk's user avatar
  • 239
2 votes
3 answers
432 views

REST API Sub-Resources

I feel as if i am over-thinking this, but with a RESTful API design with resources being themselves resources of something how should these 'typically' be accessed? Of course, an acceptable answer is '...
m1nkeh's user avatar
  • 217
0 votes
1 answer
285 views

REST API designing resources for complex entities

I have an ASP.Net Core Web API where I am having difficulties designing the REST resources based on the EF Entities I have. There are three entities that describe a Reservation. First, there is the ...
J.Paravicini's user avatar
1 vote
0 answers
492 views

How to handle relationships between resources in Restful API

Problem Hi, we have an API that it's pretty similar to a standard CRM. That is, we have a really big amount of resources (even our own customers can define new resources). All of these resources share ...
Antonio Gamiz Delgado's user avatar
3 votes
2 answers
571 views

Oauth 2.0 - MFA for REST APIs

We are looking at implementing Multi-factor authentication for our application, using Time-based one-time password (TOTP) algorithm. What we want to achieve: Users should have the option to enable ...
user1583803's user avatar
0 votes
3 answers
1k views

Designing APIs that don't expose database primary keys

People say "don't expose primary keys from the database in your API" because its a major security leak, so I'm trying to come up with a way for: RESTful HTTP requests to reference server-...
hotmeatballsoup's user avatar
-2 votes
3 answers
754 views

What HTTP response to return for a patch request with partially correct and partially wrong

I have a campaign, which has URL as a child. If I make a patch request to add a list of 3 URLs out of which first one is invalid URL, second URL already exists in the campaign and we do not want to ...
Akshay Vijay Jain's user avatar
0 votes
3 answers
498 views

Optimal method of storing image thumbnails

I'm working on an application with a database containing many recipes. The API is written in Django (with Django REST Framework) and frontend in React.Each recipe is assigned a high-quality image. In ...
gandalf113's user avatar
0 votes
2 answers
582 views

API Design. Should i use one update route or multiple for each business logic functionality

We are developping an app and I am not really pro at rest API etc. We decided that a maximum of business logic should be in the backend and started to do "business" route. But sometime I ...
dufaux's user avatar
  • 109
0 votes
3 answers
417 views

REST API design: how to represent users joining and leaving groups?

I'm designing a REST API in which users create groups that other users join and leave. A user creates a group by making a request like this: POST /groups Request body: { "name": "...
Matt's user avatar
  • 13

1
2 3 4 5
31