Questions tagged [api-design]
Application Programming Interface (API) Design discusses best practises for creating libraries intended for general purpose or public use.
111
questions with no upvoted or accepted answers
5
votes
1
answer
188
views
Dependency management for facades/adapters to cloud services (SemVer?)
Suppose I have a library, that basically works as a facade to some cloud service (e.g. JavaScript API that wraps around network calls to some RESTfull service). And once that service introduces a ...
5
votes
3
answers
726
views
Designing a flexible search API response
Quick Summary
I'm building a search micro-service that will allow searching across different types of resources in a particular system (e.g. blog posts, users etc.). The API that will be exposed will ...
4
votes
0
answers
174
views
Should custom Django Admin be separate from client endpoints?
I am currently in the process of creating a Django REST framework project for a client server web app. I would like to ask the following:
Should I write a custom admin if I want my app to be ...
3
votes
0
answers
162
views
API Gateway Design Pattern - Backends for Frontends
I am contemplating the use of the design pattern API Gateway, specifically the Backends for Frontends derivative.
We have a number of 3rd party software packages that expose an API. Over the course of ...
3
votes
1
answer
311
views
What are some design ideas for a data mapping and transformation application?
Here is a high level outline of the project:
We frequently need to convert data from a new incoming system to our in house system (sort of a basic ETL process)
We would prefer to do this dynamically, ...
3
votes
0
answers
82
views
API Cilent - global request method or one method per request?
I am designing a 3rd-party library for developers to retrieve data from various endpoints of another system which itself has multiple APIs. Each of those APIs may contain the same type of request but ...
2
votes
1
answer
104
views
web-dev: how to restrict access to costly backend API to authenticated clients only
I've created a small prototype browser plugin and am now thinking about making it accessible to the public. This brings up an important question about gatekeeping API access and the right way to ...
2
votes
1
answer
187
views
Should I put API gateway behind load balancer or vice versa
I am currently learning system design. I wonder if I should put load balancer in front of multiple instances of API gateway or put an API gateway in front of single load balancer. which one is valid ...
2
votes
0
answers
193
views
Drawing the boundary between high level API and low level API
Assume that were developing a cross platform graphics engine. Now we have quite a lot of low level APIs to choose from (OpenGL, Vulkan, DirectX 11, DirectX 12, ...). Now because of this, we are gonna ...
2
votes
0
answers
211
views
Reading (GET) Facebook Ads From Ad Library and Reading (GET) Personal Ad Account Billing Data in my Android Application
I'm trying to create an android application for personal use to do the following:
Get ads from the Facebook ad library (commercial ones) not the ones with politics topics etc. and then insert them ...
2
votes
1
answer
542
views
Neo4j graph performance: should I cache slow queries in a separate database?
Setup/Intro
I have 10k+ nodes in my Neo4j graph in which I need to display a sub-graph (100-500 nodes) between 2 start/end nodes on the frontend app along with info about the critical path and all ...
2
votes
0
answers
101
views
How to design job-handling for API
I am not sure if this is the correct place to ask, please direct me to the correct place if this is not it.
Context
I have written a do-all, keep-all, serve-all API (it started small, then grew out ...
2
votes
0
answers
74
views
API Architecture Decision on Authorization & Validation levels
We are designing an authorization mechanism for a Product API where users have their own claims.
The api has a patch request like this:
PATCH https://product-fcd.com/api/product -d {"Products": []} -...
2
votes
0
answers
495
views
How to side-load data using web api and entity framework?
I am working on a web api c# project using onion architecture and repository pattern and entity framework among other things. Doing some research I discovered a technique called side-loading
https://...
2
votes
0
answers
601
views
Is it OK to use mongodb's query object format as a parameter for my api?
I am designing an api that can give developers read-only access to a large dataset. The data is stored in a mongodb database.
All the results of the api, will basically either be a count of matches ...
2
votes
1
answer
279
views
Wrapping a legacy C++ codebase with a C API
I have inherited a large C++ codebase implementing various Windows desktop applications, services and libraries using Windows MFC. There are no automated tests. We need to decouple the UI and retain a ...
1
vote
0
answers
87
views
Limiting exposed interface for state transitions
Scenario: Given a class with some internal state and methods to manipulate this state, I want to limit the exposed methods that are available to potential clients/users of my API.
TLDR: In the ...
1
vote
0
answers
547
views
How to handle relationships between resources in Restful API
Problem
Hi, we have an API that it's pretty similar to a standard CRM. That is, we have a really big amount of resources (even our own customers can define new resources). All of these resources share ...
1
vote
1
answer
355
views
MVC-like architecture: Model-Controller communication of results/status
I'm struggling on designing a solid architecture for my project.
In particular, I don't know how to handle the communication between the models and the controllers.
My goals are:
Following the ...
1
vote
0
answers
84
views
Request and response validation
I am currently working on a project using Flask to make REST apis, blablabla. But, working with request validation tools that we use, I am thinking of whether it would be necessary to validate the ...
1
vote
1
answer
732
views
Securing API with JWT and elevated access using MFA
At my company we have a central auth server running IdentityServer. There are a number of applications providing some API to client applications. API requests are authenticated with JWT tokens issued ...
1
vote
0
answers
117
views
Correct usage of ETags?
Currently my code makes a series of updates to some resource via a REST API but I also have some "rollback" logic that basically updates the resource to its original state before my updates ...
1
vote
0
answers
162
views
Socket.io behind api gateway
So the architecture I am currently working with, we have an api-gateway that gets all the requests and publishes them to our Eventsystem/ or directly to our essential services(auth, etc). Now we want ...
1
vote
0
answers
118
views
API Design (RPC - RESTful)
I'm new to API design. I've been reading numerous threads RESTful vs RPC patterns for API design, but I feel like none directly addressed my exact use case, so I just wanted to get a second opinion.
...
1
vote
0
answers
69
views
How can I decouple my wrapper API from its underlying SOAP implementation?
In our current architecture, a user has multiple ways they can change an address (as an example). They can do it through an online portal, through our core processor directly, or via a number of apps ...
1
vote
0
answers
36
views
Standard way to bulk crud image with caption in an API?
I am trying to build a API for doing CRUD on images with their caption. So far I can think of
option1: sending the images in form-data as list of images and their corresponding captions in another ...
1
vote
0
answers
175
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 ...
1
vote
0
answers
134
views
What's the most intuitive way to organize a set of endpoints to fetch users and their roles in groups?
What's the most intuitive way to organize a set of endpoints to fetch users and their roles in groups? i.e.
Users and their roles in a specified group.
Groups a user is in, and their role in each ...
1
vote
2
answers
341
views
Error Codes with Properties Files or Database
I'm about to implement Error codes for my company API, so, based on rfc7807 I will include a type which is an error type which is basically an error category, and inside those categories we have a ...
1
vote
0
answers
85
views
Assigning default filtering values for complex API request model before passing it to business domain?
I am writing an API (web-service) for my customers and there is an endpoint which allows to search for the documents in my storage (files, folders) by applyingg complex filters.
Initially, client ...
1
vote
0
answers
33
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
0
answers
78
views
Spring Boot and Mustache app separation of concerns
I am wondering how best to slice up a Java Mustache web app which has:
Data layer (JPA, Repos, Entities, etc)
Service layer getting data from other company web services outside the package
Web/...
1
vote
0
answers
215
views
Storing laravel API tokens from one API in another APIs env file
Last year my company started using Laravel to build APIs, and we created two separate repositories - one for a primary API and then a second for a secure API that would only accept requests from the ...
1
vote
0
answers
855
views
How can I represent my graph schema in a REST interface?
Abstract
I'm working on a REST interface to a graph database (Titan/Gremlin-Server, but this shouldn't matter) that has a strong sense of type for vertices and edges. I'd like to design a REST API ...
1
vote
0
answers
486
views
RestAPI design for exposing RabbitMQ
I'm creating an API to publish and consume message from RabbitMQ. In my current design, the publisher is going to make a POST request. My API will route the POST request to the exchange. In this way, ...
1
vote
0
answers
77
views
How do I write an API that makes use of many smaller APIs?
I have a solid set of classes that do the following
build tables from data and templates
advanced form serialization
build forms from data and templates
launch overlays with forms/wizards
short poll ...
1
vote
0
answers
86
views
Design API for placing orders with differing parameters
Our customer wants to unify his ordering system, so that all of his end-customers can use one single website to place orders. The planned site will use web services to place the order in one of ...
1
vote
0
answers
133
views
Relying on file hash for data synchronisation across mobile and server
Imagine a client-server app that lets user upload images/documents etc. to server and then lets users who have access, retrieve and view them later on their
respective mobile devices.
So the flow is ...
1
vote
0
answers
82
views
Alternatives to setting up an API system
I want to launch a service that could support integration by third-parties. Unfortunately it’s way out of hand to build an entire API by now. Here’s my question: Would there be any possible solution ...
1
vote
0
answers
134
views
How to design an interface for two similar but distinct objects
I'm designing an API for a JavaFX control to be submitted to the ControlsFX library. This control is called the ViewManager, and its purpose is to hold a collection of View instances, all of which ...
1
vote
0
answers
61
views
Posting different-shaped json documents to the same resource in an API
Is it a good idea to create an API in such a way that clients can post different shaped JSON documents to the same Resource? Let me give you an example and and explanation to why I am asking this.
I ...
1
vote
0
answers
49
views
Online error reporting without network access
I have developed an application for android requiring no permissions, but the biggest downside of this is that I don't have error reporting. So, I was playing around for the past week with any ...
1
vote
1
answer
110
views
JSON APIs in PHP, across the internet
I am building a proof of concept for data processing web service, that allows users to get data cleaned, homogenized or otherwise manipulated.
Often users send different types of data in the same ...
0
votes
0
answers
11
views
Feedback on API design of a HalfEdge Data structure
Background
Sometimes also referred to as doubly connected edge list, the HalfEdge data structure allows programmers to efficiently and easily modify topological and geometric properties of a mesh. ...
0
votes
0
answers
24
views
Update notification through api end point to SignalR hub or directly in SignalR hub
For updates on a dashboard, I need to decide to make an extra api end point which creates a message in SignalR or let some kind of message broker (filewatcher1) do that. What would be good ...
0
votes
0
answers
38
views
How to Handle Undocumented Fields in OpenAPI Schema?
I'm working with an API that uses OpenAPI for its schema documentation. However, there are certain fields in the request body that shouldn't be visible to all consumers, for example, internalProperty: ...
0
votes
0
answers
38
views
Creating a generic service comprising another service
Currently I have an existing API for my AI Engine, and a python wrapper to interact with the API. So this wrapper acts like a helper class to help format and automate some of the process that is ...
0
votes
0
answers
46
views
JWT Cookie and API Gateway
Background
I have an authentication microservice that handles the user authentication and returns 2 JWT cookies (access_token and refresh_token).
I want to incorporate an API gateway that does the JWS ...
0
votes
0
answers
49
views
Translation Server-side vs. Client-side when having the same locales files
I'm currently working on a Turborepo project (monorepo architecture) and I have managed t share my locales files to both back-end and front-end parts.
This means I share the exact same keys across ...
0
votes
0
answers
73
views
Improve return type for CRUD GET list or details objects
When creating the crud GET methods to get a list of items, or the details, what should I return? The whole object properties for both cases? Or just the properties that are necessary? I'm asking this ...