Questions tagged [web-api]

Specific APIs that communicate over web protocols, such as ASP.net Web API, as well as APIs that are exposed to web pages for network communication or apps for device communication

Filter by
Sorted by
Tagged with
0 votes
1 answer
61 views

Should I create access control as a microservice or keep the access control logic as part of the specific microservice?

I was wondering if I have a microservice called, for example, Weather, and only certain people can update certain properties around the weather such as Temperature, Precipitation, and Wind. These ...
David King's user avatar
1 vote
1 answer
182 views

Aggregating responses from several services with reversed proxy (API gateway): where to place code?

We have a system with a few microservices and multiple clients (Web, mobile). Currently, only one microservice (let's call it "Master MS") exposes a public API, which is used by all clients. ...
Maxim Zabolotskikh's user avatar
0 votes
3 answers
119 views

Is it a bad practice to include fields on DELETE requests that will enforce them, but only in on certain environments? [closed]

I've seen similar questions but in this case the code deployed to all stages (local, dev, staging, prod) will be the same. The idea is to have a special field on one particular request, something like ...
fedest's user avatar
  • 119
2 votes
2 answers
195 views

Improve performance for HTTP Request with huge body

I'm struggling to understand how to improve the performance for an HTTP Request that comes with a huge body. Now, let me explain better what I mean with performance! Imagine I have a DB with the table ...
Jolly's user avatar
  • 123
3 votes
1 answer
640 views

Should web API controller actions that perform no async work always be declared as async?

I have been going over our app web api and making sure all async work is async all the way - and no artificial asynchronicity is enforced. Say I have the following web api controller: [HttpGet] ...
Veverke's user avatar
  • 361
0 votes
2 answers
50 views

Specifications to build a API context data

I was developing a new API, and some doubts appears about context of payload data. Example: { "transaction_id": 123, "transaction_date": "2022-12-25", "user_id&...
Marcelo de Andrade's user avatar
1 vote
1 answer
459 views

onion architecture - calling external APIs

Umbrella Question In an onion architecture, where do all the components needed to consume an external API fit in? The following is the architecture I have so far, based off an example found here: ...
dot's user avatar
  • 511
4 votes
2 answers
1k views

Difference between API and protocol?

What's the difference between an API and a protocol? To use a specific example: Is Coinbase's choice to refer to its WebSocket client specification as an "API" appropriate? It seems that ...
Katie's user avatar
  • 219
4 votes
3 answers
199 views

Designing an API for international markets

I am working on a REST API for a company that, until recently, has been focused on the Australian market. The result of this is that the API has resources and fields which model the Australian market, ...
David Keaveny's user avatar
0 votes
1 answer
128 views

Is there a best practice for storing multiple pages of JSON responses from an API?

Scenario: An API that responds to a request with multiple JSON objects contained in an array. The responses are paginated such that each page returns an array of JSON objects. I deserialize the JSON ...
chrisxfire's user avatar
1 vote
0 answers
483 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
-1 votes
1 answer
48 views

Dashboard based on 3rd party application - duplicate data to local db or should I view the third party as my database?

I am currently building a web based solution based on an application used in my organization. The application have an integration (SOAP-based API). To keep things simple, I want to build a analytics ...
oliverbj's user avatar
0 votes
2 answers
260 views

REST Api - deleting a resource based on either ID, or its OwnerID

I have this list of Notes: public static List<Note> _notes = new List<Note> { new Note { Id = new Guid("00000000-0000-0000-0000-000000000001"), CategoryId = "1", ...
Octavian Niculescu's user avatar
1 vote
1 answer
308 views

Testing API with Auth0-enabled user authentication and authorization

I have a REST API and a SPA application, with Auth0 server issuing access tokens and enabling end users to login with their social identity provider. The API expects to receive a JWT access token with ...
0lt's user avatar
  • 113
0 votes
0 answers
260 views

.Net Core Api - multiple Dto’s for single entity

I want to know the best Practice is about having multiple dto’s for different use cases. Let’s say we have an api with a set of controllers to handle requests coming from a administration backend and ...
Martin C's user avatar
-2 votes
1 answer
197 views

How often should I request a token when communicating with a third-party API?

I have an ASP.net web API. I would like to call another API that has an authentication token inside my API. The code flow is as follows: My API is called → Get authentication token from 3rd party API →...
raysefo's user avatar
0 votes
1 answer
182 views

How to Properly Design an API Prefetch System

I'm creating an API for a web service. There are a couple of endpoints in this API that require some time (lets say +5min) to compute, so I'm creating a prefetch system that will call in the ...
Stack's user avatar
  • 141
0 votes
3 answers
410 views

Should I unit test functions internally used by API I expose?

I'm writing a CRUD app in Python that exposes web API. At first I wrote functions for communicating with DB and wrote tests for these functions. def crud(): # do something with db def test_crud(): ...
CommanderPrice's user avatar
1 vote
2 answers
368 views

What Is the Industry Standard of Specifying APIs for Frontend-Backend Handshake?

I am somewhat new to web development and maybe this question belongs to stackoverflow, but there is a human-interaction component here. Here is the scenario. I am serving some neural network models ...
Della's user avatar
  • 119
0 votes
1 answer
75 views

Best mapping practices in an enterprise application

This question might seem like a trivial question. But here it goes. Currently, I'm working with this .NET Core application, an N-tier application consisting of a Vue frontend, business logic layer, ...
XRaycat's user avatar
  • 131
0 votes
1 answer
1k views

RESTful web APIs using MVVM architecture

As the title implies, I would like to know if it is possible to create RESTful web APIs using MVVM architecture? Or we can use just MVC pattern to create web APIs?
Commander's user avatar
  • 103
0 votes
0 answers
56 views

What would be the best way to queue asynchronous calls received simultaneously by a web service cluster?

I have an API where every time is called there are multiple calls to multiple webservices in the background, sometimes it takes up to 20 seconds to process the request calling up to 10 different web ...
Mario Arturo's user avatar
1 vote
0 answers
87 views

What is the benefit of performing authn/authz at the API gateway instead of at the service?

I want to know is if we should perform authentication at the API gateway, at the individual service, or both. Let's frame this question and descussion in the context of new development. Specifically, ...
Mike G's user avatar
  • 239
1 vote
3 answers
379 views

Is the "archetype controller" really complies with REST architectural style

I've read the Fielding's thesis that defines the REST architectural style and noticed that the defined style appears to significantly conflicts with the so called "archetype controller", ...
Danilo Mendes's user avatar
2 votes
1 answer
168 views

Best practice for designing a WebAPI for exposing data in a SQL database interacting with C++ and C# applications

I am looking for general guidance or any relevant links for a complex project. We are a small business that sells a construction materials testing software. The client is a Windows application with ...
Hottemax's user avatar
0 votes
0 answers
622 views

add web api endpoint, which return html from view

I have ASP.NET 5 Web Api and need to do the following task: Add endpoint, which get cshtml page and return generated html, so it should do the same what is does razor view engine. What is better way ...
Alexan's user avatar
  • 249
0 votes
1 answer
478 views

Should integration tests cover calls from web app to API?

My solution consists of an API for data access and a web application that calls it. I have integration tests set up for the API. However, the actual Web application that calls the API is not a part of ...
Peter's user avatar
  • 111
0 votes
2 answers
770 views

JWT logout: Sharing blacklisted invalid token among services

I am working on a microservices project involving 4 services - Auth Service, Service-A, Service-B and Service-C. All the services are implemented using Spring Boot. The Auth Service is responsible for ...
user14132461's user avatar
0 votes
1 answer
2k views

Blacklist JWT tokens or whitelist JWT tokens

I am working on a Spring Boot web application. The REST APIs are secured by JWT tokens. Currently I have only access token generated (not implemented refresh token concept). My question is related to ...
user14132461's user avatar
6 votes
3 answers
1k views

GET vs POST when exposing machine learning model predictions using a REST API

So the recommendations for using GET vs POST in a REST API that I've read on stack overflow are geared almost exclusively toward CRUD operations involving a database. However if you are simply writing ...
erotavlas's user avatar
  • 267
2 votes
7 answers
897 views

Representing a large list of complex objects in JSON

I am currently developing an API that returns JSON structures. One of the domain objects returned is a time series, which is a potentially large list (many thousands of elements) of complex objects. ...
Felk's user avatar
  • 184
1 vote
0 answers
33 views

Two step provisioning using OIDC and AD?

A client requested that we implement the following authentication/authorisation flow: User authenticates using OIDC via a IAM (Salesforce in this case). If user is an external user, then a flag is ...
dd_dent's user avatar
  • 33
6 votes
2 answers
4k views

What layer do third party API request/response models go in and what do you call them?

I have a RESTful API service that has three layers: Application/Domain, Infrastructure, and Presentation. Application/Domain contain my interfaces and models. I currently have three different types of ...
brandon d tran's user avatar
0 votes
0 answers
57 views

Repository Pattern to support Bounded Context

I am building a REST Api from scratch so i am overthinking and revisiting various approaches and best practices. I have a Materials repository that serve all the sub-domains of our logic. Also i have ...
e4rthdog's user avatar
  • 267
3 votes
2 answers
2k views

Should I return always a JSON for only one value in a REST API or is it ok to return just the value?

For example, I create an API endpoint that provides the next available label for creating some items, so I call it like this: GET /api/v1/get-next-label/ Is it ok to return just: LBL-000001 Or is it ...
nck's user avatar
  • 139
0 votes
1 answer
151 views

How to architect a collaborative web application for live updates?

When using collaborative applications like issue trackers, planning tools, etc. it can be very frustrating to have to keep hitting refresh to make sure you're viewing the same state as your colleagues....
Salvatore Shiggerino's user avatar
3 votes
1 answer
2k views

REST: How to "upsert" a resource without an specific resource URL

I'm trying to create a REST API that allows the user to: create a resource if it doesn't exist. update a resource if it exists. with the same request. Given an example: I have a company that has ...
Danilo Mendes's user avatar
-3 votes
1 answer
205 views

Should I restrict my api with CORS?

Should I restrict my backend API (api.cool-domain.com) to be only accessible by my frontend (cool-domain.com)? Seems like it will provide some amount of additional security, I am just asking is it ...
Ruslan Plastun's user avatar
4 votes
2 answers
4k views

REST API: POST and PUT for nested resources

I am wondering how to deal with nested resources in a REST API. I've seen other questions on the subject here, but I didn't find one that answered my question. More specifically, should POSTing/...
samdouble's user avatar
  • 225
0 votes
1 answer
148 views

How would one go about connecting API routes from one GitHub repository to another?

This may be a basic question, but I'm having some difficulty finding an answer online. My project is a MERN application that draws from an existing open-source API. This API utilizes a database that I'...
Serendipital's user avatar
0 votes
0 answers
227 views

How to change data after success URLs sent to partner API's if they can only be GET requests?

A lot of times there's a parameter in a partner API endpoint like success_url where you provide the partner API with an endpoint on your internal API to redirect the client. For example, on Stripe you ...
Dashiell Rose Bark-Huss's user avatar
-1 votes
2 answers
208 views

How to test a web service / API?

Our product is a C++ server component implementing a REST API. We have automatic tests that check whether the responses are byte-identical to the reference. The new requirement that came in is that ...
marczellm's user avatar
  • 355
-1 votes
1 answer
314 views

Can I call a WCF endpoint from ASP.Net Web API?

I have a web api with controller methods that use rest http(post/get calls). Clients consume this API with normal httpclient calls and I pass an http response back. My use case is I have a legacy ...
Terrance Jackson's user avatar
1 vote
1 answer
99 views

Designing an API without knowing most of the requirements

Say we have a company that provides services and they would like to build a new API to sell to clients who will use it for their websites. Some things to consider: The company has an old API that the ...
rhoward's user avatar
  • 27
-1 votes
1 answer
161 views

ASP.NET Web API - what is the design pattern?

In Visual Studio, ASP.NET MVC project template is designed for MVC pattern, but what about ASP.NET Web API project template? I know that we can create API from MVC project, also we can build MVC app ...
veryfreaky's user avatar
0 votes
1 answer
256 views

Is this the right way to call async and await

Hi I am new to async/await in C# . I have created a controller which is accessing result from HttpClient injected through HttpFactory. Here is my working example class MyController { private ...
Rohit's user avatar
  • 109
1 vote
0 answers
95 views

How can I improve this API solution

Intro I'm creating an app and I'm not sure if the structure of the solution is correct. I have a BaseController that uses generics. This controller is inherited by others that do not have to ...
Emily's user avatar
  • 19
0 votes
4 answers
437 views

What problems could be caused by inserting into a database on an HTTP GET?

I have code that checks if the scanned qr code exist in the database and if it exist it will insert data into another table but I did it in the HTTP GET request, is this alright to do it this way or ...
James Ariel Indo Pates's user avatar
8 votes
5 answers
561 views

How to map "mv" operation to HTTP verbs?

In designing a RESTful api the problem arises as to how best to allow resources to be moved between collections. Renaming a resource could be done by using PATCH but this is not the same thing as ...
Jon Guiton's user avatar
-1 votes
1 answer
254 views

Best practices for data manipulation to use in admin dashboard application?

I am trying to create admin dashboard to track sales and inventory. Using React front end and Django rest backend API. Right now I am pulling sales and would like to make some charts. What's the ...
user1079002's user avatar

1
2 3 4 5
8