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
0
votes
3answers
83 views

REST API Design - Reordering Collections

Imagine that I have a system to manage sports teams. Let's not make it specific to a particular sport, but consider that each team consists of a number of players. Therefore, I might have an ...
-2
votes
0answers
33 views

Centralized REST API call management?

I was given a solution with many projects. Multiple projects call multiple REST APIs. These calls are scattered around the spaghetti code. Trying to figure out what calls are done in what sequence ...
-1
votes
2answers
32 views

How to add business customer customization in our API and

We sell a fleet management solution: it includes a mobile application, a web application and a set of APIs. Technically the APIs and the web application are developed in C # .net (asp.net mvc and asp....
1
vote
0answers
72 views

Removing duplicate code with multiple APIs

I have multiple APIs doing the same thing but the code is copied for each API. The names of fields and formats of certain fields like dates are different between the various APIs, but everything is ...
0
votes
0answers
20 views

CSRF-Token for API consumed by multiple applications

We've got an web API which is consumable by different applications we've made. Some endpoints will be used by a web application which is partially protected by using CSRF-Token which are created for ...
0
votes
0answers
28 views

Creating a webhook server / sender

I'm now working with an API project, where I'm developing new API endpoints and the final result at the end of the life cycle is as follows: a client should receive updated data out of what it sent to ...
-1
votes
0answers
38 views

REST API design - recommended response with SPA apps

consider SPA application which uses centralized store like ngxs or vuex. Are there some recommendations about response of REST API? Any specifications where I can read more about that? For instance, ...
-1
votes
3answers
146 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 ...
2
votes
2answers
185 views

Where should I catch exceptions

I'm developing an application that has a backend (Java, Spring) and a frontend (TypeScript, Angular). The backend application provides with an OpenAPI-compatible API and performs certain operations ...
-2
votes
2answers
158 views

Should you use PUT or POST when an authenticated user is trying to update their own settings?

An example of my API is mydomain.com/v1/update-profile So the user is authenticated and wants to update some stuff in their profile. Should we design the API to expect a POST or a PUT HTTP Method? ...
1
vote
2answers
115 views

Data from one microservice to another

How does one service get the data from another service? I will give few examples: 1) Let's say we have two services which need to share the data: User Service and Order Service. Order Service pretty ...
2
votes
4answers
205 views

Is having different implementations for ToString and the implicit operator bad design?

I am currently developing a wrapper API for a translation service that should provide multiple methods for translating strings, Task<string> ITranslator.TranslateAsync(string phrase, Language ...
3
votes
4answers
141 views

How to model correctly a non persistent action via REST API

Hi I have a Order this order needs to be sent to an order system. There are several oprations that can be performed. Create Modify Check-Modification (this happens on existing order) Simulate ...
0
votes
1answer
23 views

API Request/Response Model for showing differences in JSON objects

I am writing an API to merge two different JSON Objects. Both of these objects can have same as well different number of properties. Object 1 : { "name": "Sam", "lastName": "Hanks", "...
0
votes
1answer
87 views

Should REST API rate limiting specifics be told to the caller?

I have an REST API, which has a rate limit of 1 query per IP per 5 seconds. When the user tries to call the API too often, I respond with the HTTP status code 429 Too Many Requests and a JSON message. ...
-3
votes
1answer
83 views

Backend with many services

I'm mostly a Front-end Developer. One day I heard about such a thing at work like "authentication service", "registration service" and it turned out our product's backend has many services running ...
-3
votes
4answers
72 views

Should Product Requirements reflect vendors' APIs capabilities and limitations?

I have a question about the responsibilities of the Scrum Product Owner and the Scrum Engineer/Architect. It is said that in Scrum the Product Requirements (PRD) specify the "what", but not the "how"....
2
votes
3answers
99 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 ...
1
vote
0answers
30 views

Angular integration with back-end

We're developing a big project for our company, and they asked us to use Angular even though none of the devs have any considerable experience with it. The back-end is C#/.NET Core with ABP. My ...
1
vote
1answer
67 views

C# class design for clear API wrapper

We are creating an office application in C#. Originally, the persistent data like customer details, orders, agenda, statistics, etc. were stored in a local SqlServer database on a server. The ...
0
votes
2answers
108 views

Call API endpoint from API itself

I'm creating an .NET Core 3 API with Entity Framework. The data is from an existing database. Now I've the following situation: /persons -- get all the persons /companies -- get all the companies /...
0
votes
1answer
42 views

Is it permissible to have relationships to parents of parents for JSON:API resources?

I have the following hierarchy: venue -> concert -> booking And within booking I have a relationship for the concert. But should the booking also have a relationship to the venue? Or is it bad ...
3
votes
3answers
163 views

How do I write user stories for system internal requirements?

Some requirements of a system are for the system itself, or for the developers, how do I write user stories for this? For example, there are requirements for a system to: provide APIs so that ...
0
votes
1answer
34 views

Appropriates names for Api implementation and Api Client Library

Suppose I have a big project, called Northwind. It's a website in front of a database. Now management want me to create a public API for this. I create a new ASP.NET Core project called Northwind.Api ...
1
vote
2answers
71 views

Which REST API url structure should I take?

I am wondering which API url scheme should I use. I am designing multi-site project so that the URL can looks like: [GET] /website/1 [GET] /website/1/category [GET] /website/1/product Which is life ...
1
vote
0answers
11 views

Hypertext Application Language grouping items in a collection

For the purposes of this question I can use an example document straight from the HAL spec, since my problem is very similar: { "_links": { "self": { "href": "/orders" }, "next": { ...
0
votes
0answers
28 views

Real-time ASR with Google API

I have a general question about the implementation of the ASR (automatic speech recognition) API of Google or a similar company. We need to create clients (desktop applications) that send the ...
0
votes
0answers
23 views

Error code handling between Oracle Database and Microservice API

I'm using Oracle Database and .Net Core API for my project. What is the best way / best practice of handling errors between Database and API? What I'm thinking is, I'll return only custom error ...
1
vote
4answers
99 views

REST API include permissions into resource

We currently have REST API, where you have a set of different resources, like: GET /cats GET /cats/{catId} GET /dogs Clients decide whether they can perform an action based on resource permissions. ...
0
votes
1answer
64 views

Should List(Get) and Search be the same endpoint API (method)?

Here are two endpoints (or methods): ListResources(user_id) - Fetch the resources based on the given user id. SearchResources(query_options) - Fetch the resources with specified conditions. The ...
-3
votes
1answer
240 views

How do I overcome the limit of 4000 results returned from the REST API?

I have an application which records the company man hours of employees and other related details. Because it gets updated everyday or when a new employee is added, it tends to lead to a very large ...
2
votes
4answers
154 views

Alternatives to polling an API

Assume we have a desktop application (probably WinForms) that acts as a client to some API for an app with a messaging function. This API has endpoints that return a JSON of messages, and who sent ...
1
vote
1answer
111 views

Terminology - Changing the behaviour of a function but not it's name [closed]

Consider this situation: there is a method getFoo(). It now becomes appearent that the method as-is is not useful or even encourages faulty code to be written upon it. A breaking change (e.g. ...
2
votes
2answers
93 views

How to combine session-based authentication and stateless REST API

What is the proper way of combining session-based authentication with stateless, token-based authentication for a REST API? Use case: User logs-in in the standard, traditional, session-based way. ...
-2
votes
1answer
118 views

Where to conform the API? [closed]

I have a software accepting a HTTP request like this (and I'm happy with that): /products?page=2 /products?category=123&page=1 /product?id=123 /cart?show=table Now there is a consumer third-...
1
vote
2answers
168 views

Direct Service Calls vs API Gateway For Microservice Communication

I've such microservice architecture as below. I want execution service to get some information from storage and assignment services. I want to use MVC App like an API Gateway and handle all ...
1
vote
1answer
90 views

How should REST resources relate to the server database schema?

I am trying to understand whether resources in a RESTFUL API should directly represent the underlying database or not. In particular, a problem that I have is that I usually use highly normalized ...
2
votes
1answer
124 views

How to avoid duplicated logic on frontend SPA and backend API

Every time I'm working on an SPA with an API backend I always find myself wondering the best way to do this. The current example I'm running into is as follows: When a User has their account created ...
-4
votes
3answers
74 views

REST API design: Best practice for POST to create an object to a list

I have an API that return list of Employee. This API will have an offset and limit for pagination purpose. On the frontend, I use Single-Page Framework (Vue/Angular/React..). This SPA have a Employee ...
0
votes
2answers
88 views

Http Status Code When Downstream Validation Fails

I have an API that charges for an order. It accepts the orderId and the amount as inputs. Then it makes a '/charge' call to the downstream, which returns a 202. Immediately after this call, it calls a ...
3
votes
3answers
237 views

Should a transformation function take a nullable and return a nullable or should the caller handle nullability

Often I need to transform a type to another, such as a networking model to a data model, or a data model to a binary representation. Should these transformation functions take an Optional/nullable ...
2
votes
6answers
458 views

Is building REST API compatible with Agile approach?

I believe I understand what REST is and what Agile is. Our company has some APIs that we maintained, usually we only needed to tweak some requests or responses to fit new requirements. Recently, we ...
0
votes
1answer
38 views

How to design a repository when datasource differs based on DML/READ operations?

We are starting our new application in which we using MS SQL DB for all our insert/update/delete/select ie. both SELECT and DML operations. But, soon we will have two different sources. SQL Server ...
1
vote
4answers
702 views

Is creating ViewModels in Web API a bad practice?

So, somebody at work who is twice as experienced than I am, told us that we must not create ViewModel classes within Web API. (We are using Angular for UI) In his opinion ViewModel is ASP.NET MVC ...
2
votes
2answers
99 views

Separating namespaces from files in Python

I'm writing a Python library in which various objects are represented as Python classes. However, the user is not supposed to create instances of those classes directly. Instead, there are a set of ...
-4
votes
1answer
28 views

extending an MVC site to support a new controller, via adding a v2 area <- good idea? need help with routing

I want to extend our api to a (better) v2 version. I came up with the plan of adding a "v2" area and under that, cloning each controller into it. (basically v1 sometimes returns json, sometimes text, ...
2
votes
5answers
424 views

Is it acceptable to accept multiple results in a unit test?

I've noticed this while implementing a Rest-API today. We first define interfaces for each API method and the api contract for one endpoint allows (amongst others) two status codes: 200 and 204. Both ...
0
votes
0answers
49 views

Ist good practice adding Converter Between api and client

I just want to curious about adding a converter is a good practice or not. I have multiple API and I always convert API return fields to my client fields. Like=> function ConvertFromAPI(apidata){ ...
1
vote
4answers
451 views

Cron Job Microservice

I'm implementing an application that's made of bunch of microservices. Each of them is fairly simple, focusing on its own task. Let's call two of them Service A and Service B. They are both ...
0
votes
1answer
130 views

API that isn’t web service

It’s a bit hard for me to wrap my head around an API that isn’t a web service. I am sure they exist, because even as I use my phone, I’m sure the developers didn’t need to specify how to use the ...