Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
1answer
40 views

Best route naming convention when a RESTful GET needs to be a POST

I have a REST API that has been built on top (in front of) a legacy system, to allow 3rd parties of various platforms to interact with the system. Most of the time, I can define a resource and create ...
0
votes
0answers
16 views

Service Design - Data-orientation vs. Role/Goal-orientation

For a simple web application, I am designing web services to expose the application functionality (mostly data storage / retrieval, but also data processing). As the application is not too complex, I ...
3
votes
1answer
120 views

Best practice for REST result payload when field may have single or multiple values

I Have a REST API endpoint where the caller can supply some optional filters for the results. GET api/inventory For example, an object member of a GET request may look like the following { "...
-3
votes
0answers
28 views

Design Pattern for Material Feasibility Check service as described below

We have MaterialTemplate, Material as below MaterialTemplate{ MaterialType materialType, int length, int width, int complexity } Material{ MaterialType materialType, int ...
0
votes
1answer
81 views

How to Redesign and scale legacy MVC application

I’m working with legacy web app for managing an animal shelter which need to be rearchitected/redesign, so it can scale and be possible to deploy in a central location. Currently it's physically ...
-1
votes
4answers
117 views

When streaming JSON to end users, should each buffer be standalone JSON?

If you were streaming JSON to the end user, and every "buffer" of response was in the format of, for instance... { "something": "here", "other": 1} You'd be in a spot where the entire stream ...
0
votes
0answers
32 views

Choice between PUT and a separate request for each change for CRUD-based UI

I'm making an HTTP API for ASP.NET Core Identity. Basically what I want is a remote version of this: https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.usermanager-1?view=...
1
vote
1answer
46 views

Repository pattern, call another API that updates a SOR's from service or repository class?

We are working on API's that call other API's that will inevitably retrieves/update a system of record like an SQL, MySQL or other database. Sometimes we'll have 3/4 layers of API's before the SOR is ...
-1
votes
1answer
34 views

Creating a mobile app based on the ASP.NET Core website

Coming from Desktop development, I'm in the middle of my very first web project (as a small side/learning-project). I'm using ASP.NET Core 2. I'm already thinking about going mobile too. What are my ...
0
votes
1answer
97 views

Time-based Task scheduler engine

I am working on an enterprise level application. I have an event table in the database. I need to update my events' states in the database on a precise date and time. There may be 200 milliseconds ...
26
votes
5answers
7k views

Should I check if something exists in the db and fail fast or wait for db exception

Having two classes: public class Parent { public int Id { get; set; } public int ChildId { get; set; } } public class Child { ... } When assigning ChildId to Parent should I check first if ...
3
votes
2answers
106 views

How to safeguard a COTS REST API with on-premise servers for approved client apps only?

Goal: Prevent unauthorized 'clone' apps from using REST API-based solutions where the customers manage their own servers and services instead of the vendor doing so (database, resource, and identity). ...
-2
votes
1answer
41 views

Should API also authenticate users from front end app?

I am building an API using Laravel and am looking at using Laravel/Passport for authentication - but I am struggling with a design decision. The API will be consumed by multiple other applications / ...
-1
votes
1answer
39 views

Updating entity with REST

I'm looking for the "Holy Grail" (best practise) of how to update an entity with REST? There are three main approaches I've found so far: Always send full entity, regardless what has been changed ...
4
votes
3answers
524 views

Mapping API models(DTOs) to rich domain models

How to implement HTTP's PUT that works with child collections when using DDD's rich domain models? Let's say we've got an aggregate root with a nicely encapsulated collection of items: (I omitted ...
0
votes
1answer
76 views

Dealing with child collections updates in Web API

Let's take some classic enterprise example: Order and OrderItem public class Order { public Guid Id { get; set; } public ICollection<OrderItem> Items { get; set; } } public class ...
4
votes
2answers
469 views

Best practice for REST API call with many parameters

I have a REST API with GETs operations which receive a (long) list of parameters (8 parameters, for example). The aim of this operation is to search and filter elements. Which is the best practice to ...
1
vote
3answers
184 views

Designing a REST API with resource relationships?

I'm working to design a REST API to be consumed by a React SPA. The client-side of the SPA queries data about a relationship between two entities: Team and Player where Teams have many Players and ...
2
votes
1answer
107 views

Web application with relational database - best practice?

I am currently designing a web application which is pretty similar to Twitter but with some unique features for my company. Technologies are Vue2, Spark framework and PostgreSQL. I am trying to ...
0
votes
1answer
41 views

Strategy for ensuring consistency when integrating using an API?

How do I ensure consistency between two separate systems which store and maintain the same set of data, when the method of communication between them is REST APIs and webhooks? Is it possible? I find ...
0
votes
0answers
235 views

Decoupling logic and data access from service layer

I would appreciate some feedback on the following design choices, also whether the IDisposable pattern I'm using is good in this case. I've tried to follow what Microsoft suggests when implementing ...
1
vote
2answers
478 views

Stateful authentication in REST API using tokens

I have recently started on a project involving a REST API. The API requires authentication with requirements for administrators to be able to view logged in users and to be able to revoke specific ...
0
votes
0answers
37 views

Are REST Resources and GraphQL Object Types conceptually equal?

I'm in the process of outlining the intended business logic of a web service. At this point, I'm not too concerned with implementation details. On the contrary, I'm looking for ways to abstract them ...
2
votes
1answer
89 views

Web API: REST-ish pattern for flexible querying of time-series data

I'm working on a product that exposes a RESTful API to interact with system entities (the usual CRUD), which works very well. In addition to CRUD, we've recently encountered a need to expose the ...
1
vote
2answers
209 views

What happen if we never dispose HttpClient, .Net C#?

I'm working on a windows service. Code of windows service is very simple but it has a strange manner! In windows service I should call a WebApi each 20 seconds and save the result in a SQL Database I'...
0
votes
1answer
50 views

Reasons why the ASP.NET Web API Controller cache ignores dynamic assemblies

I've been reading about how ASP.NET Web API looks up the locations of controllers in assemblies, and ways to dynamically add a new assembly to look in. So far this has all been fine, except I've ...
-1
votes
1answer
105 views

API gateway for web-fronted applications, is it worth it?

So am in the process of developing a new application and am welling to adopt a micro-services based architecture (am new to that). The problem is that the application will be exposed to the final ...
-1
votes
1answer
39 views

Advice on accessing an API Service

I have a requirement to validate a data field (a reference number for payments) in our finance system by connecting to one of our vendor's API services. The finance system does not have the ...
-3
votes
1answer
85 views

ASP.Net WebAPI or Node JS?

I wish to write RESTful web services which can be consumed from a Web Application and a mobile application. The database is designed in SQL Server 2012. I estimate that there won't be more than 1000 ...
-1
votes
2answers
55 views

What should be the REST API (URL) for a user to be assigned to multiple territories

In our application we have a user who can be assigned multiple territories. What is the best way to expose the REST API? Should it be as : [POST] www.xyz.com/Territory/User OR [POST] www.xyz.com/...
0
votes
2answers
86 views

Handling a limited resource in rest WEB API 2

I have developed a restful WEB API 2 (C#, .NET 4.7) for an internal integration project. In my API's backend, I need to use a vendor's dll in order to process the provided input. The vendor's dll is ...
1
vote
3answers
111 views

How use a REST interaface for implementing tasks commands on my Web API?

I'm creating a Web API with a lot of REST Resources. My service also have some tasks which should be started on demand. for instance "Start sending emails". For now I do have a specific URL which I ...
0
votes
2answers
578 views

RESTful API Relationships

Lets say we are making an API with two resources: Author and Book where books can have many authors and authors can have many books. So we design the REST api like so: /books /books/:id /books/:id/...
-2
votes
1answer
88 views

When to use a proper API and when to use session state?

I was looking at this documentation. https://laravel.com/docs/5.6/passport it is quite long and I asked myself, why would one use this, over just a normal login where you store necessary information ...
2
votes
2answers
96 views

Should a POST endpoint in a REST API allow the inclusion of related resources?

Given the following REST endpoints: (GET, POST) /api/v2/employer (GET) /api/v2/employer/{id} (GET, POST) /api/v2/employer/{id}/employees Should a consumer of this API have the ability to ...
0
votes
2answers
282 views

Single page apps and backend APIs

When creating single page apps that communicate with a backend API via ajax, what is common (best?) practice regarding updating different server side database objects as a result of one client side ...
1
vote
2answers
200 views

Consume own API or make independant website

The PHP framework Laravel allows to make an API and a website on the same application. As both of them will communicate with the same database, I was asking myself what is better between consuming my ...
2
votes
1answer
94 views

How to create a cache-preventing link? Using random number? Unix time? or other better options?

For example, sometimes I need to generate a link, but I don't want someone cache the context by url of the same link (e.g.:I don't want Facebook feed dialog to cache the page context), so I need ...
23
votes
6answers
4k views

Is it ok to have validation layer before access control layer

I am creating an API strcutured web application and in this application we have different layers which are doing their own job. First layer is Validation layer which validate user input and if it ...
-1
votes
1answer
69 views

How to architect a comunication of objects between 2 softwares (B2B, so called, communication)?

There's a 1st sofwtare (s1) that generates data and then there's one or more software's (s2, s3) that will receive that data(objects), based on pre configured actions that define the type of data to ...
0
votes
0answers
61 views

How do I arrange an ASP.NET Web API with authentication that is hosted on another subdomain?

Suppose I am designing a web application and also building a Web API with authentication via Kerberos/NTLM. The Web API is first for my app, but I imagine I want to make it general-purpose. My ...
0
votes
1answer
394 views

Controller and API DTO Architecture and class organization in .net core with microservices

We are developing a system with coarse microservice architecture. We have an API that uses controllers and back-end logic with Entity-Framework repository, and several types of clients that use this ...
1
vote
0answers
72 views

What is the best way to implement an HTTP endpoint with different return types?

I need to make an HTTP endpoint with different return types based on query params. There are several options to do that: Return an object with one property set and the rest equal to null: public ...
1
vote
0answers
322 views

Angular + WebAPI: DTO shapings Client vs Server

I'm currently creating a small single page app for myself. I'm using Angular and ASP.Net Core 2 Web API. On the server side, I'm also using the DDD approach (just for learning purposes, the app isn't ...
1
vote
1answer
446 views

Manually disposing Entity Framework Context while using Ninject InRequestScope();

Spending some time sifting through documentation, I'm trying to figure out the best software architecture with or without the dispose pattern. I've built the Repository pattern many time over the ...
2
votes
3answers
186 views

What are the “best practice” to manage related resource when designing REST API?

When designing REST API I generally start by identifying the resource of my system, to give an example let's say that we manage multiple blogs, each one with multiple posts, each one with multiple ...
1
vote
2answers
885 views

Web API - strong classes or dynamic?

My web api method should return some structured data about my profile. To do it I created the following POCO classes: public class ProfileInfo { public string FirstName { get; set; } public ...
0
votes
1answer
74 views

RESTful API get requests by “modified” condition from mobile app

Currently I have following scenario. I have two projects: ASP.NET Core Web API and Xamarin.Forms app. General idea is to have consumer (Xamarin.Forms app) which is getting data from server (Web API)....
0
votes
1answer
301 views

Web API Response, Error Code Convention [duplicate]

Imagine that you are developing a front end client that will consume an API. You're working on the login page and want to display errors to users below each field, in this case you want password ...
1
vote
2answers
409 views

Architecture for Queuing based technology in a Micro-Service, Multi-Tenant Environment

Hopefully the title is not painfully obscure, but as it indicates, I'm really looking for advice on my architecture proposal, as the current architecture is subject to concurrency issues, performance ...