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
332
questions
0
votes
1answer
37 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'...
0
votes
0answers
31 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 ...
-1
votes
2answers
80 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 ...
0
votes
0answers
28 views
What is the proper way to handle Oauth Token caching in .Net Web API
When using service to api calls is it better to cache a token on the client side or server side?
So for example the client gets the token with their ID and Secret. I want to cache this token so it ...
1
vote
1answer
68 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 ...
-1
votes
1answer
40 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 ...
1
vote
1answer
116 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 ...
1
vote
0answers
93 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 ...
0
votes
4answers
179 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 ...
8
votes
5answers
369 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 ...
-1
votes
1answer
53 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 ...
-1
votes
1answer
47 views
Checking caller has access to an API resource - Design
We have a managers api (/api/managers/-/staff), which will get a list of staff that the currently logged in manager has been granted access to. It is the Managers service.
We also have a staff api (...
0
votes
0answers
18 views
How can we apply in the same time role based access to a service used by internal application, external application and others internal services?
I'm trying to figure out how to make sure that our services which are both used by internal and external applications must be secure to only allow calls from clients who are authorized and have the ...
1
vote
5answers
296 views
What http codes should i return when user request file which doesn't meet his requirements
i have a case where user can filter and download multiple pdf documents merged into single file.
The client should display an error message when no document's meets the filter, and ask for ...
1
vote
0answers
28 views
In OAuth / OpenID Connect, does the redirect url matter for server to server API calls?
In OAuth / OpenID Connect, does the redirect url matter for server to server API calls?
I'm currently setting up Azure AD to secure our API's. The first implementation will likely only be server to ...
2
votes
1answer
112 views
What do you call the combination of endpoint and HTTP method in a REST API?
Let's use the Twitter API as an example. My understanding is that we refer to /statuses/update as an endpoint and we refer to POST as a HTTP method.
So what would term do you use to refer to the pair ...
2
votes
3answers
269 views
Back-end solution for pulling from CSV files
I'm building a data visualization that displays COVID information for the United States, at the city, state, and county level.
The ultimate source of truth are three CSVs published by the New York ...
0
votes
0answers
36 views
Security and cookie practices for an API of a website
I'd like to create a web API. It would be used on my websites and potentially by others as well. I intend to use a single token to authorise users. You see, this API acts as an OAuth2 client (or ...
1
vote
1answer
89 views
Architecting multiple codebases calling our public API + private API for first-party applications
Currently, we have the issue where we have two codebases (API & Website) calling the same database (along with some duplicate business logic) and we want to streamline this so all requests are ...
1
vote
2answers
96 views
Is it reasonable to ask API consumer (client) to provide sync response to notification/callback?
We have an API platform which allows user to create and manage a certain type resource.
Client is expected to provide a callback url where our server will send notification to when the resource is ...
4
votes
1answer
338 views
Where should I place more complex business logic related to what a Web API does but consumed by a single client?
I have been debating with my colleagues about the following and we still did not reach consensus.
The architecture is as follows:
medium size monolith application for intranet usage
a small ...
40
votes
1answer
4k views
How to design a REST API that can “prompt” the client about long-running operations?
Say you were to develop a REST API that provides access to a set of complex, long-running, operations.
The typical paradigm for an API like this (as I understand it) usually involves (the client) ...
1
vote
1answer
124 views
Where to place the business logic for an external application that is tightly coupled with an internal application and how to adapt the architecture?
I and a colleague had a rather strange discussion with our boss related to the architecture of the applications we are currently developing. The C4 (second level) diagram of the existing architecture ...
0
votes
1answer
53 views
Designing asp.net core web api to add sub classes/specialized objects
I have not worked with EF for a while.
As an exercise, I am writing a core web api that allows keeping track of a user medias.
A media can be a postcard, a photo album, a recording, a book...
I would ...
0
votes
0answers
24 views
How to structure/design a webapp using a large number of APIs
I am writing a webapp that aggregates a multitude of different APIs to gather data related to astronomy, and then returns the aggregated data in a single API endpoint. There are 7 API's being used, ...
-4
votes
1answer
67 views
Which API building practice is better?
Im working on a ERP product, In which backend logics are to be APIs. Right now I have around
80 Tables.
Proposal 1: Creating CRUD APIs for all tables and manipulation of data to be handled in front ...
3
votes
2answers
151 views
API Design: Errors passed between APIs
I work as a developer on a few different APIs that make calls to each other.
Let's take two and call them API-USER and API-BUSINESS.
A user application makes calls to API-USER, which in turn makes ...
-2
votes
1answer
67 views
How to organize my controllers in projects in .Net API?
I'm working on a project that is a API with many controllers and modules. Which of the following is the best architectural practice to organizing my API controllers by dll (.NET 4.7 WebAPI)? Why?
...
-4
votes
1answer
96 views
Does it makes sense to implement a REST API for every app?
Is it mandatory to implement a REST API even if it doesn't make sense?
I have created an app consuming REST services from other apps. Now that I have the final result, I wonder if it is needed to ...
-2
votes
2answers
70 views
Signing up users who have not registered
I am building an app where you can invite your friends to join the platform and discuss various topics. (almost Reddit).
Functionality: When you create a topic you can enter the email of users you ...
3
votes
1answer
142 views
Separation of concerns and other best practices across Controllers, Services, Providers and Stores in ASP.NET when building a REST web api
I am traditionally a desktop app developer, but circumstance has thrust me into the role of doing web client and corresponding REST api logic for a project I am involved in. Unfortunately, I'm a one-...
0
votes
0answers
45 views
Should I use a Web API between a client and Entity Framework?
I am creating a database that will keep track of my company's clients, and an app that will allow users inside the company to read/update/etc. the database. I'm using code-first EF Core to manage the ...
1
vote
2answers
98 views
Web server archicture
This may seem like an odd question but it's something I've yet to find a "proper" answer for. I've tried googling but I don't get anything useful (maybe I'm looking for the wrong terms).
I'm ...
3
votes
3answers
294 views
Coworker wants to use POST to pass ID's in API routes
We've recently started working on an API, and I'm running into a philosophy issue. This is only my second API I've worked on, but the standard I've seen for retrieving a single model is always a GET, ...
1
vote
0answers
17 views
Cart Checkout Item Check alternative
Not to sure if this is the right place to ask this.
But I have more of a Theory Related question then Completely Technical
I want to Propose my Issue at hand and then I'm looking for someone to give ...
1
vote
1answer
115 views
Should I separate client-side API calls into a separate .js file and class, and reference that?
Summary
Instead of calling WebApi straight from a Web Forms User Control, I have created JS class which contains functions returning jQuery AJAX requests. The control would instantiate the class and ...
0
votes
0answers
33 views
Can reactive streams simplify API development even for low-scale applications?
The mainstream opinion about using a reactive non-blocking backend is that it increases performance for large numbers of clients but sacrifices maintainability due to increased complexity.
I am in a ...
-2
votes
1answer
313 views
What is a simple implementation of onion architecture for C# ASP.NET Core WebAPI and SQL db that is not full DDD and CQRS?
I'm a programming teacher. My students learn structured and then object oriented programming in JavaScript and C#. They learn SQL, MS SQL Server, Dapper and EntityFramework Core.
After this they ...
10
votes
3answers
505 views
API endpoint POST vs GET
Help me settle an internal question.
We have an endpoint which we all agree should be a GET, because all it's doing is calling a stored proc and returning a set of data. However, there is a set of ...
4
votes
5answers
137 views
How to designing API JSON Response with nullable fields
We were discussing how to design a API response, for simplicity, think of having to give information of all the different types of facilities available in a city:
{
"city": {
"cityName": "...
1
vote
1answer
50 views
How do I make my Browser Extension send a Selection it captured to a Database/Web App so it can be stored in the user's account?
I am building a Browser Extension that captures a Selection made by the user in any web page, and stores it in his account. I don't quite know how to proceed with this, however.
My initial thought ...
1
vote
2answers
106 views
JSON:API - I don't think I have an `id` or `type` to return
I'm building a Restful API and trying to use JSON:API format for my response. Looking at https://jsonapi.org/format/, it states:
A resource object MUST contain at least the following top-level
...
0
votes
1answer
79 views
GET Parameters in Restful API
I'm in the starting phases of designing an API. I'd like it to be Restful and comply with what's commonly considered best practices.
One of my resources need to accept several query string parameters....
0
votes
1answer
62 views
REST api - search url
I'm building a REST api and want to make sure to follow the best practices.
I need to expose a method which will return a 'Document' entity by its 'Lot' number.
It is possible that for a specific '...
0
votes
3answers
224 views
How to calculate the costs for an on-prem API request in terms of money?
My manager asked me how much it costs (in money, currency, $) to make a REST API request from our client application to one of our services. We do not use cloud, we have on-prem servers.
The payload ...
8
votes
4answers
9k views
Is it a bad idea to pass JSON objects on the query string for an API “search” operation?
I'm building an API endpoint for a UI grid to search, filter, and display a list of domain objects, let's call them "widgets." In the past, I would have built this with a list of named query string ...
0
votes
0answers
59 views
Which authentication should be used for external users (not registered with the system)
I'm working with a project that uses ASP.NET Core 2.2. The main solution contains different projects, including APIs for a mobile application, APIs to integrate the system with third parties, a web ...
0
votes
1answer
894 views
Web API layer vs Application layer
I am just wondering should the presentation layer connects to the Web API layer first then WEB API layer connects to the Application layer?
Let's say for ATM system which has Check Balance function, ...
0
votes
3answers
186 views
Which HTTP method to run an algorithm on input and return result?
I have a requirement to get input from a web app UI, send this input to the server who will run an algorithm on it. The web server will send back the output of the algorithm the the UI. Is an HTTP ...
2
votes
3answers
230 views
Rest application header based vs path based service routing
i have a rest API that is a front end to a more complex SOAP based service. The soap based service uses extended(custom) WSA-addressing headers in order to perform its routing. The extension of the ...