Skip to main content

Questions tagged [rest]

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

0 votes
1 answer
368 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
652 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
  • 103
1 vote
2 answers
2k 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
3k 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
132 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
1k 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
302 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
318 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
2k 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
69 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
6 votes
3 answers
2k 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
  • 173
2 votes
2 answers
248 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
  • 546
3 votes
4 answers
2k 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
169 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
313 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

15 30 50 per page
1
3 4
5
6 7
105