All Questions
419
questions
-1
votes
2
answers
192
views
Idempotency for a financial transaction API
Say you have a REST API endpoint like POST /move-money which transfers money from your main account to a savings pot. There are three path parameters
accountId for the user's account
potId for the ...
0
votes
1
answer
227
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 ...
0
votes
1
answer
74
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 ...
0
votes
1
answer
148
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. /...
0
votes
1
answer
460
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 ...
-3
votes
1
answer
331
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 ...
0
votes
2
answers
1k
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 ...
-2
votes
2
answers
1k
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 ...
2
votes
2
answers
190
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?
...
2
votes
3
answers
1k
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}/...
0
votes
2
answers
307
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 ...
0
votes
1
answer
190
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 ...
1
vote
3
answers
642
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 ...
2
votes
2
answers
4k
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, ...
-1
votes
4
answers
3k
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 ...