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
2
votes
1answer
56 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 ...
-1
votes
0answers
30 views

Configuring request to third-party API, so the return stream bypasses the backend

My web app provides features on top of IBM Watson's text-to-speech service. Using this service involves using an API key and so the requests have to be sent from the backend. However, if I receive the ...
0
votes
0answers
38 views

and 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 ...
0
votes
1answer
43 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 ...
0
votes
2answers
78 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 ...
0
votes
1answer
108 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 ...
2
votes
3answers
107 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 ...
2
votes
7answers
240 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. ...
1
vote
0answers
30 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 ...
0
votes
2answers
89 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 ...
0
votes
0answers
48 views

Fetching data in separate servers

I have a monolithic REST API and a separate WebSocket server that’s used for real-time updates. They're both separate so that I can scale them independently. The API fetches data from the database and ...
0
votes
0answers
17 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 ...
2
votes
2answers
160 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 ...
0
votes
1answer
67 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....
0
votes
1answer
89 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 ...
0
votes
0answers
60 views

When Receiving/Returning data in controller action - DateTime conversion between UTC and Epoch in Asp.net core WebAPI

I was wondering what would be a better approach designing a system which deals with UTC DateTime in the service and Database layer but needed to send and receive the DateTime in Epoch format from ...
-3
votes
1answer
127 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 ...
2
votes
2answers
418 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/...
0
votes
1answer
57 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
40 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
86 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
1answer
73 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 ...
1
vote
1answer
75 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
49 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 ...
0
votes
1answer
130 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
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 ...
0
votes
4answers
196 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
377 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
103 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
48 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
19 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 ...
2
votes
5answers
346 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
31 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
186 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
559 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
43 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
113 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
97 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
625 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
5k 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
198 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
91 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 ...
-4
votes
1answer
68 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
152 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
92 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
99 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 ...
6
votes
2answers
343 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
58 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
101 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 ...

1
2 3 4 5
7