Stack Exchange Network

Stack Exchange network consists of 175 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 [api]

An application programming interface (API) is the specification for which software is meant to be used by other software.

0
votes
1answer
21 views

Handling Authentication with both Web App and API

Not sure how to handle this. Our current app (.Net MVC) is accessed via companyname.appname.com, authentication is handled via forms (cookie) authentication. Within the app there is a global search ...
0
votes
1answer
54 views

How to properly version an API?

I'm designing an API for our web application, that will be consumed by mobile developers that will create our mobile app. I chose to document it using Swagger / OpenAPI 3.0.0. I'm surprised that ...
1
vote
1answer
65 views

Data is in database or get from API, where should API request code goes?

For me, the data I want to retrieve may be in database for which I can use properties of model and also relationships, but if the record is not a property and no relationship exists for that ...
2
votes
4answers
112 views

Proper HTTP method for triggering a process [duplicate]

I have a question regarding HTTP methods and what would be most proper in terms of conforming to REST principles. I have two services, A and B. When new data is added, or old data is updated at ...
1
vote
0answers
43 views

Third-party API wrapper in Java: how to design

Suppose, there's a site that provides an API, such as this: Users post questions, answers on that site You can make GET and POST calls There are two types of authentication: weak (only gives read ...
1
vote
0answers
11 views

different data connectors for different objects and users

I have an application which needs to store different objects in different data stores based on the user's authorization credentials. I.E. the user may need to save object 1 to their BI postgres ...
2
votes
1answer
81 views

Trying to figure out how to make the syntaxes of 2 different API's the same

I'm doing research to a problem occurred in our company. We have a front-end web portal which communicates by API with a back-end in a same syntax, for example: "www.123.com/api/v1/getCustomers". ...
1
vote
1answer
33 views

Batching CRUD of individual models that need to be linked

I have a few models which need to be linked together during a workflow on my webapp and I'm having trouble thinking of a nice abstraction for the api. They are represented as individual constructs on ...
8
votes
5answers
442 views

Consequences of not doing a REST API the “right” way?

I'll ask this question this way - what are the software engineering concerns for not implementing my REST API the "right" way? What do you mean the "right" way? Well, allow me to explain my ...
1
vote
1answer
63 views

Good practice for writing API's serving paid features

I'm building a paid feature for my application & the clients who haven't enabled it won't have access to it While building all the API's around it, I see that I'm doing a lot of permission checks ...
1
vote
1answer
61 views

Check if object exists before updating/deleting

In an application that doesn't use an ORM, is it good practice to check whether an object exists before attempting to update/delete it? For example: @Route(method="DELETE", path="/posts/\d+") ...
0
votes
0answers
92 views

Where should the API reside?

I have a microservice(opsApiServ) which hosts API to do operations(ops). /ops - POST, GET /ops-item - GET ops-item is just a single unit of operation, and ops is collection of operations (ops-item). ...
0
votes
1answer
66 views

Synchronize multiples REST api, centralized into 1 web application

I am developing a web application for a client, connected to 4 differents sources : E-commerce website CRM Emailing platform Surveys platform All the sources have REST Api's. The web application ...
0
votes
1answer
57 views

Microservice on top of an API

I have an Odata API server that I can't change only access it, I can do CRUD operations on it. However I'd like to authenticate users, that are stored on this server. I can retrieve a user (his email, ...
0
votes
2answers
95 views

API and motherboard

I'm new on API and still undergoing some research to gain knowledge for my presentations for next few days. Different motherboard have different CPU socket. So I was just wondering, do API affect ...
0
votes
1answer
59 views

Use same API for both website and other clients or not?

Lets say I am building some large application ( multi-page app ) using Laravel. And laravel will allow me to make an API and a website on the same application. Since the website and the API ...
-2
votes
1answer
67 views

Is it a good idea to ask for requestId in each API call?

I see some services which takes a requestId from client as the mandatory attribute while some services doesn't. I feel it is a good idea to have a request Id from the clients because it helps in ...
0
votes
1answer
83 views

API User identification

I'm designing an API, and I need to authenticate each request with a user. The simplest way to do that is to provide an API key to each user on their "My account" page, that they could regenerate at ...
0
votes
1answer
44 views

Name for a library that provides an API for other libraries

I've been working on a library at work which provides a simplified API for a few underlying libraries (face recognition, text to speech, etc.). My boss asked me the best way to describe this concept ...
0
votes
1answer
107 views

Check if user is logged in when using JWT

I have an app that uses JWT tokens for user authorization. Now, I need to be capable of deactivating users (users won't be allowed to use the system but still exist in the database), but as a ...
0
votes
1answer
62 views

Avoid numerous dynamic_cast_ptr in the API design of polymorphic types

I am trying to design a geometric intersection API. Below is the code to represent geometric elements. #include <iostream> #include <memory> // Since I did not write the Shape class I ...
2
votes
1answer
37 views

Creating backend system, over API

I recently came across a demand to create a web system (which will be done in PHP, but is for any language), to have the same functionalities of a mobile application already ready. This app has a ...
2
votes
2answers
108 views

Should REST API return escaped user generated content

We have a REST API that returns user generated content from a database. Before inserting the data into the database the data is sanitized. But when returning the data we do not escape / decode the ...
1
vote
1answer
94 views

Breaking 3-tier architecture into multi-tier architecture

Recently I have been working on a rather large system with Vue.js for a single page app (SPA) and an API for the backend. The customer is concerned with the security, performance and maintainability. ...
1
vote
1answer
41 views

Multiple app authentication, universal user login, best practice

Please see the below diagram. There are two apps that each have a different set of functions, User A is a user of App1 and User B is a user of App2. They should not be able to log in directly to the ...
1
vote
1answer
49 views

Using frameworks that map database to RESTful APIs?

While researching RESTful API frameworks I've come across (generally speaking) two types of frameworks: The first type will (more or less) directly (or nearly directly) map an ORM/ODM scheme of your ...
0
votes
1answer
81 views

Is It good practice on API design to use different object model for getting object and creating

While mostly every company got it's standard on APIs, the question just came out after that one of my colleagues stated we must use different object models for creating and getting objects from API. ...
50
votes
9answers
11k views

Should you guard against unexpected values from external APIs?

Lets say you are coding a function that takes input from an external API MyAPI. That external API MyAPI has a contract that states it will return a string or a number. Is it recommended to guard ...
2
votes
3answers
85 views

Permissive vs. Strict API Message validation

We had a interesting debate today over what our REST API should default to doing when validating a request body where unexpected fields are present. I think we ended the conversation in a good place, ...
1
vote
0answers
31 views

API as system controller

I'm developing a system, and I've had a question that might help other people. The system would be written in PHP, with a lot of chance of turning a mobile app later, too. Normally, I would create it ...
1
vote
1answer
92 views

Methods to Securing APIKeys

I have read on several methods to securing an API key like gitignore or placing in another file if using an application, but at some point if taken the time, anyone can get the key, even when apikey ...
1
vote
1answer
79 views

Am I making API creation difficult when it comes to authentication?

I know the sites are not geared for recommendations so I am hoping to pose this question in a way that doesn't ask for recommendations. Questions comments are welcome. I am just getting involved in ...
0
votes
1answer
44 views

how to build a stable API product and allow specification per project? [closed]

I am in search of information on how I to manage code in git flow and methodology to test and work with it : I have an API in place to build and manage a product catalog and it was designed around ...
6
votes
3answers
306 views

Should a high-performance API expose low-performance utility functions?

Context: I'm working on an open source project to solve a problem that comes up in ad-tech and social media data mining: indexing boolean expression trees, and matching them against incoming documents....
0
votes
1answer
69 views

How to test an API that can change the response during time?

I currently use the Google trends API and I implemented a class to integrate with its services. As you probably know, Google trends tracks statistics which will change over time. So, when I write ...
2
votes
6answers
226 views

Difference between REST & HTTP REST implementations

REST principles are described here: https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_2 https://en.wikipedia.org/wiki/Representational_state_transfer#...
1
vote
1answer
86 views

Is GraphQL REST compliant (almost)?

I am writing an article about traditional REST vs GraphQL. However, after doing some research about REST (not just a specific implementation of REST), I started to see that GraphQL actually abides to ...
3
votes
1answer
150 views

params T[] vs IEnumerable<T> as parameter type

I know there's a proposal for params IEnumerable<T>. When designing an API, when should we choose params T[] (params array) over IEnumerable<T>. Or should both be implemented for better ...
3
votes
3answers
226 views

Should you retry 500 API errors?

My team and I are integrating with a 3rd party company and using their API to perform different CRUD operations. Their API isn't always reliable though. Maybe 0.1% of the time an API call just fails ...
-1
votes
1answer
55 views

Method that takes array parameter [duplicate]

I want to implement two methods: AddPlayers and AddPlayer. Is it better when AddPlayers calls AddPlayer or AddPlayer calls AddPlayers with a single item array? Is there a significant difference in ...
4
votes
3answers
151 views

Is checking if something exists responsibility of a caller or an API?

Is it better for an API when it provides additional methods that check if something exists before adding? For example: if (!userManager.HasPermission(user, "somePermission") userManager....
0
votes
3answers
89 views

How to structure a set of classes that deal with external APIs for maximum testability?

I'm developing a set of classes designed to communicate with external APIs, and I'm running into trouble with how to properly structure everything for proper loose coupling and unit testing. ...
-1
votes
1answer
73 views

Any solution for scheduling a “high volume traffic” mode on API?

I have been wondering if there is any way to design and develop a mechanism for a REST API for scheduling some sort of "high volume" traffic so it does not conflict with normal rate-limiting. This ...
1
vote
2answers
79 views

API design - indicate that results were truncated

For reasons, my search endpoint returns a maximum of 50 results. I'm struggling with how best to tell the caller that their results were limited to 50. The best I've come up with is returning some ...
1
vote
0answers
17 views

Handling coherent state changes in DB through API

A simplified version of my DB: Appointment id INT PK datetime DATETIME AppointmentChangeRequest id INT PK user_id INT FK appointment_id INT FK request_datetime DATETIME ...
0
votes
1answer
95 views

Should I access the backend directly or through an API layer?

Please allow me to ask my question using an example where we have a database with flight data and I want to make a web app where users can search, select, and book a flight. I wrote some classes ...
1
vote
1answer
67 views

Separation between regular web site requests and API requests

I have a doubt about the architecture of a web app when it comes down to differentiating between regular website requests and API requests. For the purpose of explaining, suppose I am the creator of ...
0
votes
3answers
72 views

Nesting Objects without Passing Arguments?

I have a couple of classes that I've nested together (not in the sense you may think so bare with me), to create what I call a prefab object (similar to Unity's prefab system). In this particular ...
1
vote
3answers
202 views

Does providing multiple APIs reduce code re-use

Within an organisation, suppose you have an internal tool used by different teams and for different use cases. This package offers APIs in different languages. One could say that having multiple APIs ...
1
vote
0answers
60 views

Difference between API server and Gateway

I'm working on a VOIP startup currently and deciding which software stack will be best. I'm doing a lot of research of how other people do it, like Discord. It's really hard to make some of these ...