Questions tagged [api-design]

API design is the process of determining and exposing a set of consistent method signatures, return values, and documentation intended for use by other developers to allow programmatic access to data.

An API (Application Programming Interface) is what developers use to work with a specific software or platform. API design refers to those practices that lead to developing a good API. A good API design helps developers leverage the full power of your platform while being easy to use. A bad API design can hinder developers from utilizing the full power of your platform and in the worst case can drive developers away from your platform because of its difficulty.

API design shares many concepts with normal programming best practices. A few of these are separation of concerns and prevention of abstraction leakage.

References

2220 questions
0
votes
0 answers

C# .NET Core 3 API Model Validation ignores property

Seem to be getting inconsistent returns in my model validation. The main issue that occurs is that whenever a date is invalid/malformed it will stop on all other validations besides date validations. How is it possible that the first request does…
Paaz
  • 133
  • 7
0
votes
1 answer

Add a Cancel REST API function to existing API

I am working on an existing REST API that has the following APIS for getting the status of certain tasks: GET /Status <-- Returns json array of status of all running tasks GET /Status/{TaskID} <-- Returns json Status="blah" item of…
Harry Boy
  • 4,159
  • 17
  • 71
  • 122
0
votes
1 answer

API Goverment rules in WSO2

I would like to implement automatic rules of API Goverment in a WSO2 API Manager platform like, for example, validating context with a regular expresion, or version numbering or API name or API resources endpoint naming or parameters, etc. I checked…
Burillodev
  • 322
  • 1
  • 3
  • 14
0
votes
1 answer

GraphQL: Modeling evolving types / state transitions

This is an issue we have ran into multiple times now... very much looking forward to others' opinions! Scenario Description (for illustration purposes): Somebody visits our website, perhaps they fill out some forms, whatever. To us, this person is…
Ryan
  • 729
  • 1
  • 10
  • 25
0
votes
1 answer

How to write a GET api that calls a function to insert data into the db before running the actual select by Id statement?

I wrote a scanMetadata function that takes the id passed in the url, does some computation and inserts data into the file metadata table. The api I'm creating is get_metadata, which has to run this function first before it runs Filemetadata.findById…
Sook Lim
  • 541
  • 6
  • 28
0
votes
2 answers

Multiple ways to identify a single resource in a RESTful API

Imagine an HTTP REST API for retrieving the list of commits for a Git repository: /:repository/:branch/commits I would like to extend the API to allow to get information about a single commit, either by its identifier (SHA) or by some other…
raindev
  • 1,017
  • 1
  • 12
  • 25
0
votes
1 answer

REST API Design and framing the URL

I need to come up with best practices for API development where we have more than 100 endpoints to be developed and each endpoint need to have below mentioned properties which are common to be passed as request to the server Every request must have…
0
votes
1 answer

Pluralized Rest Resources

I want to create a new rest resources that searches an entity in database. I have to make the request as POST since there is a complex criteria passed in a request body. I created my resource endpoint as /search, however, I learned that resources…
Skanda
  • 835
  • 1
  • 15
  • 32
0
votes
0 answers

API Design that notifies Calling module and continues execution

I am designing a python API which takes some parameters. My primary requirement for this API is that calling module should be notified in case of some event X and it should also wait for the execution to complete. I have already thought of passing a…
Deepanshu Arora
  • 375
  • 1
  • 5
  • 21
0
votes
1 answer

Application route serve html only? Should application route update state?

I am wondering what the best practice is for scenerios like serving a signup page to create new users. There are two separate things going on here.. 1) application must forward a user creation html page and 2) user creation forum must be passed to…
nnkparikh
  • 313
  • 2
  • 7
0
votes
1 answer

Why do we need NoOp types?

Note: This is not a Swift-only question, it's related in every language with Optional type. I see some Swift projects doing that: var foo: Foo = NoOpFoo() AFAIK this basically means "this foo does nothing" and can be also expressed as var foo: Foo?…
Mert Buran
  • 2,989
  • 2
  • 22
  • 34
0
votes
0 answers

UI for generated OpenAPI

I am new to OpenAPIs and want to find out the best way to deal with my situation. I'll describe the situation and what I want to achieve, hope someone can help me find out something good for my case. My Situation: I have a program in Microservices.…
0
votes
1 answer

JSON-API - use custom HTTP header or meta information for 'product-code'

The company I work for has several products that consume shared APIs. Previously we've passed the 'product-code' as a custom HTTP header. It's generally only used for things like determining a product-specific API key, or included in certain log…
Ryan.Bartsch
  • 3,698
  • 1
  • 26
  • 52
0
votes
2 answers

Why does the GitHub API use a PUT request for starring a repository?

I am developing my own REST API and was looking for other well-established APIs to see what they do when they have a need to expose some sort of action that can be made on a resource. One that came up was the ability to star and unstar a…
Timothy Fisher
  • 1,001
  • 10
  • 27
0
votes
2 answers

Batch Updating in Rest API

I have a curious question regarding REST API design! There is a resource called users and there are different user-types Say if I want to delete a user by Rest design I would have an endpoint like DELETE /users/id But now I want to delete all users…
Raghav Raman
  • 134
  • 2
  • 9