Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [api]

An application programming interface (API) is the specification for which software is meant to be used by other software.

Filter by
Sorted by
Tagged with
1 vote
3 answers
126 views

Who should build the RESTful client between two applications which both offer APIs?

Application A creates Widgets. Managers have decided that information regarding these Widgets is needed in Application B. Application A has a RESTful API that allows client applications to pull data ...
Jarret Gibson's user avatar
1 vote
2 answers
172 views

CQRS: Multiple entry points for a single command

I’m trying to follow the Clean Architecture and CQRS within an application that, let’s say, create a product. To achieve this, the application has 3 adapters, one for reading a file, another for ...
Vithor Escames's user avatar
-1 votes
2 answers
150 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 ...
MZokov's user avatar
  • 101
0 votes
1 answer
70 views

Authorization business logic on claims or on app database?

Context: I have an API (using DDD) with an entity lets call it "Content" that only can be update by certain users. For example Content with Id = 1, can only be modified by User Id = 1, ...
Danielbahe's user avatar
0 votes
1 answer
139 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
4 answers
180 views

How to eliminate repetition in three subclasses: each defines an identical method that does almost the same thing, but with a different return type

TLDR: I have three subclasses, each inherits from the same parent class, each defines an identical method that does almost the same thing, except that each of these methods has a different return type....
thatUserHOverThere's user avatar
9 votes
3 answers
6k views

How should source code unit tests affect semantic versioning?

I recently started using Semantic Versioning. Due to conflicts with my previous versioning convention (which I created myself), I am very confused about versioning unit tests as part of the public API....
KhodeNima's user avatar
  • 225
-2 votes
1 answer
107 views

Are there some best practices how to build a client library for an API?

I was tasked to create an API client library for our already existing API. I tried to research some ways how to approach this but couldn't find anything. Are there some best practices how to build ...
user3630290'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 votes
1 answer
82 views

Is there any benefit/viability to sharing models across API versions that have differing schemas

I have been asked to get involved with a Team that is currently having delivery issues for various reasons. During my review I came across an acceptance criteria on a user story; If you call v1 of ...
Kinexus's user avatar
  • 303
2 votes
3 answers
339 views

Does it make sense for an API with 1 daily job to do to be asynchronous?

This is a conceptual question about whether my specific use-case warrants the use of an asynchronous API. Language: Python 3.11 Framework: FastAPI (ASGI) I believe I am confused about what an ...
nonohat's user avatar
  • 53
1 vote
1 answer
90 views

Reserving Unique, Sequential Group Numbers in ASP.NET Core with EF Core and GraphQL

I am developing an API backend using ASP.NET Core Minimal API (.NET 7) with Entity Framework Core, HotChocolate (for GraphQL), and a Microsoft SQL Server database. I've encountered a specific ...
bealtis's user avatar
  • 11
1 vote
1 answer
97 views

Persisting data in a mobile app backed by a rest API back-end, advices [closed]

So I am working on this mobile application using MAUI, which is backed by a Rest API in ASP.NET Core. I want to be able to use the app offline, and the user can create/edit some data. This data is ...
Toto's user avatar
  • 155
0 votes
1 answer
30 views

Is using an Azure Function to forward a message to my App Service the best idea for handling a Twilio Web Hook?

I have an Azure App Service running a .NET (Core) API for an inhouse application, which I'm integrating with Twilio to handle Whatsapp communication. To handle the web hook responsible for receiving a ...
jarodsmk's user avatar
  • 141
0 votes
0 answers
44 views

Package by feature for APIs that are exporting or / and importing data

We are generally following the package-by-feature approach, which is great. However, one specific case is constantly causing confusion and inconsistencies, and I'd like to know your approaches in this ...
Marian Klühspies's user avatar
2 votes
0 answers
189 views

Managing environments in a FastAPI app using Docker

Bit of context: I'm an Economics major that somehow ended up developing an API that's becoming a whole software project, so please bear with me. So, after I got asked to add logs I noticed I should ...
Juan C's user avatar
  • 121
0 votes
2 answers
145 views

API - What are some good strategies to limit hitting database on query-based searches?

I'm building an API that allows people to search for books (just for simplicity). There is an endpoint that takes a query string and returns the top 10 matched results. For example: /api/v1/book/find?...
Richard H. Nguyen's user avatar
0 votes
1 answer
46 views

What are standard ways to pass the event signal over fixed level only connection?

I need to pass exactly event (not a lasting state) over communication connection that can provide boolean or integer value, possible to set, clear and observe by both sides. It is OPC UA framework but ...
h22's user avatar
  • 937
0 votes
1 answer
146 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
0 votes
0 answers
60 views

Securely Handling Session Keys in Excel for API Authentication

I'm working on an Excel tool that needs to synchronize with a CRM via its API. The CRM's API authentication process involves logging in with a username and password, after which a session key is ...
Alon Cohen's user avatar
0 votes
0 answers
19 views

Use of extra claims in a token for authorization checking purposes

Currently we are moving to an API driven architecture using SPAs and WebAPIs. We are also moving from SAML2 to OAuth 2.0 and if it is appropriate, OIDC. We have a couple of APIs and one of the APIs ...
Wilko van der Veen's user avatar
0 votes
1 answer
312 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
0 votes
0 answers
59 views

How to provide user id to proxied services in an API gateway pattern?

I'm making code examples of how to start a modern microservices web architecture from scratch, and I only recently learned about API gateway pattern. So far, the authentication methods I used for ...
Diane M's user avatar
  • 2,076
6 votes
3 answers
2k views

Best design practice when one python method passes most of its arguments to another method

My code has 2 python methods defined, m1 and m2. m1 receives 6 arguments - p1,p2,p3...p6. It uses p1 in its own code, but passes p2-p6 to m2. Is there a recommended programming style here to prevent ...
str31's user avatar
  • 71
-3 votes
1 answer
295 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
780 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
-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 ...
CrumpledMemories's user avatar
2 votes
2 answers
178 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
1 answer
195 views

What is the responsibility of a typed HttpClient in .NET?

Say I have a simple layered .NET application, with three layers: API Adapters Application The application layer needs to use some typed http clients to communicate with external APIs. This means ...
Jakob Busk Sørensen's user avatar
3 votes
3 answers
621 views

What exactly is a REST API in reference to Docker?

AFAIK, APIs are a means by which two computers communicate with each other. What exactly is REST API? My confusion arises from this figure where a docker cli which is on the same host as the docker ...
zeeshanseikh's user avatar
1 vote
0 answers
81 views

Designing an API adapter with multiple authentication types

I'm building an HTTP API database adapter that has an authentication component. Users can authenticate using password, federated login such as OAUTH, and JWT. My initial design is something like the ...
seve's user avatar
  • 19
2 votes
3 answers
768 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
0 votes
2 answers
112 views

Do I use a model or controller in an existing MVC application for implementing an integration that makes API calls?

I have an existing application using Codeigniter Framework (MVC). I need to implement an integration in the software with the external cash register (e.g., making REST API calls). I need to either ...
objecttothis's user avatar
2 votes
1 answer
1k views

Clean architecture - how to manage use cases that depends on external apis

How to apply clean architecture concepts in a software that depends on External APIs. Example: A business that offers some kind of subscription to its users. Its convinient to store some subscription ...
Rafael Alencar's user avatar
0 votes
1 answer
769 views

Single api gateway or one for each microservice

We are going to have multiple microservices and decided to use api gateway. What we couldn't decide is if we should go for a single gateway for all of them or one for each. The reason why one for each ...
dstr's user avatar
  • 239
0 votes
0 answers
86 views

Translation Server-side vs. Client-side when having the same locales files

I'm currently working on a Turborepo project (monorepo architecture) and I have managed t share my locales files to both back-end and front-end parts. This means I share the exact same keys across ...
Jolan B.'s user avatar
0 votes
0 answers
210 views

Improve return type for CRUD GET list or details objects

When creating the crud GET methods to get a list of items, or the details, what should I return? The whole object properties for both cases? Or just the properties that are necessary? I'm asking this ...
celsomtrindade's user avatar
0 votes
2 answers
303 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
0 votes
2 answers
295 views

How to keep OpenAPI specification up-to-date and compliant without using code generators?

In our company, there is no standard for how to document APIs. Missing API documentation slows down the development process. Therefore, we want to introduce OpenAPI. We want to use code generators to ...
Harold L. Brown's user avatar
3 votes
2 answers
253 views

Abstracting constrained strings in serializer. Good or bad practice?

I'm using FastAPI and in my schemas (that is, serializers) I have something like this: from pydantic import StrictStr, BaseModel class Str255(StrictStr): max_length = 255 # my schemas: class ...
PythonForEver's user avatar
0 votes
1 answer
151 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
2 answers
207 views

How to best protect a public API from unwanted requests

I’ll try my best to explain, but for the closest context I could think of, imagine that I am building an analytics platform that allows paying users to sign up, place a tracking script on their ...
user8758206's user avatar
0 votes
2 answers
161 views

The best way of preventing unauthorised API use and reducing costs of declining API requests

To best explain my context, imagine that I’m creating an alternative piece of software to google analytics (since my personal project’s principle is similar). Each unique user creates an account and ...
user8758206's user avatar
1 vote
3 answers
520 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
240 views

Middleware responsibilities and usage: checking preconditions for business logic

I am developing an API backend in NestJS, now for some specific routes (or controllers) I am loading in a configuration from the database to handle an incoming request. This fetching of the ...
Sebastiaan's user avatar
2 votes
7 answers
492 views

Is there a term that describes the property of being synchronous vs asynchronous?

Is there a term that describes the property of being synchronous vs asynchronous? The term that most naturally comes to mind is "synchronicity", however I only see this term being use in ...
Rylander's user avatar
  • 139
0 votes
3 answers
265 views

Using GitHub repository as API

I have a set of complex data, which I use on various subdomains of my project. Data are static most of the time, it changes few times per year. Currently, it's hardcoded in every project which needs ...
Pavel Štěrba's user avatar
-1 votes
1 answer
544 views

Why do we need middleware in FASTapi?

From official documentation: A "middleware" is a function that works with every request before it is processed by any specific path operation. And also with every response before returning ...
filtertips's user avatar
-1 votes
1 answer
41 views

What is the convention for deciding which resource to place an endpoint under? [closed]

I have an endpoint that teachers can use to invite students to a virtual classroom by providing their emails in a list format. Let's call it POST invite-students. I have these four resources: api/v1/...
oamandawi's user avatar
  • 101
0 votes
1 answer
126 views

Return type abstraction of a service layer that calls an API

I'm trying to find the best solution to abstract the return type of the service layer. I have a controller that calls a service to create a user. The service calls a REST API and receives an HTTP ...
Achref RIAHI's user avatar

1
2 3 4 5
27