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
11
votes
1answer
2k views

REST API rule about tunneling

Just read this in the REST API Rulebook: GET and POST must not be used to tunnel other request methods. Tunneling refers to any abuse of HTTP that masks or misrepresents a message’s intent and ...
-2
votes
1answer
38 views

One Super App or Many Single-Purpose Apps

While Players like Rappi/Alibaba / Wechat have gone the super app way, i.e on single app to host many unrelated services, Ecosystems like Google, Amazon etc still have multiple single purpose ...
1
vote
1answer
102 views

How to structure OOP multiple calculations?

I am working currently on a project that requires a series (almost 86) calculations to run based on a user data input. The problem is that each calculation has a series of requirements: Should be ...
0
votes
1answer
76 views

Microservice Architecture auth design

As a learning exercise I want to develop a system using microservices. I have designed my authentication/authorization architecture and would like to know if there are drawbacks to my design. It is ...
0
votes
0answers
15 views

Cart Checkout Item Check alternative

Not to sure if this is the right place to ask this. But I have more of a Theory Related question then Completely Technical I want to Propose my Issue at hand and then I'm looking for someone to give ...
-1
votes
1answer
32 views

Capture webhooks of third party service with an API

I'm building an API in .net that wil capture webhooks events of a third party service. Lots of actions on the third party service will trigger the webhooks. account.deactivated", "account....
-1
votes
2answers
650 views

How to handle many-to-many relationships with multiple incompatible relationship types in RESTful API?

Note this question is about when there are multiple relationship types. This is not the same as this question, where there is only a single member relationship. Say we have persons and organizations. ...
-1
votes
1answer
49 views

Configuring Controllers and Endpoints in a HTTP API

Let's say you need to create an API around machines, and you want to be able to query machines many different ways: Get List of all Machines Get Machine By ID Get Machines By Client Get Machines By ...
2
votes
1answer
73 views

Designing a REST API resource with a non-unique ID, but unique composite ID

Is it bad for a REST API to have non-unique ID for a child resource? For example, the endpoint is: GET /parent/:parent_name/child/:child_name The :parent_name is unique, but a :child_name is only ...
0
votes
2answers
138 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 ...
62
votes
9answers
102k views

When to use HTTP status code 404 in an API

I am working on a project and after arguing with people at work for about more than a hour. I decided to know what people on stack-exchange might say. We're writing an API for a system, there is a ...
29
votes
5answers
7k views

Is there a way to use a C++ API in C#?

I want to code a little program that takes in head tracking data and moves a 3D object accordingly on the screen. To achieve this I found a software called opentrack that has a C++ API. The problem is ...
1
vote
3answers
153 views

Securing REST API with authenticated user

I want to build a REST API but I have some holes when it comes to the security part. I would like to get my head around how to authenticate the calls to the API. Therefore, this is my first draft for ...
0
votes
1answer
51 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 ...
0
votes
0answers
45 views

Microservice with “grab bag” set of inputs, how to manage for the long term?

My team is building a tenanted primary service, with shared microservices used by that primary to separate common business tasks. We're building a new microservice that is responsible for running a ...
0
votes
1answer
25 views

Fire aws lambda at a specific time

Let's say I have a booking system where I want to fire an aws lambda function to send an email or message to users, 10 minutes before their booking starts. I have looked online and found few solutions....
-2
votes
1answer
23 views

Azure web service api usage per user insights

We have a API (written in .NET Core 3.1), published to Azure Web Services. This API talks to a database for authentication. After a succesfull authentication, the API connects to other databases, ...
49
votes
3answers
46k views

What is a proper way to do a complex RESTful search method?

Following REST principles, I would want to create a GET method for my API that make a search using some criteria and return the results to the client. The problem is that the criteria can have up to ...
0
votes
2answers
132 views

Microservices based API, how to handle long lists requests

I was planing to create an API based on microservices, I'm stuck on how to solve a specific scenario. Initial plan is, all microservices are only accessible through a REST API. Based on the next ...
-1
votes
2answers
44 views

Http status and reponse in case the API gives out partial response

I have an API whose job is to aggregate resources obtained by calling multiple other APIs and then give out the aggregated response to the client. Currently even if one or more dependent API calls ...
-1
votes
1answer
98 views

Should an API be designed so that all information needed is returned in one request?

I'm currently designing my first API and I had a question: Should an API return all information about an object and its foreign keys? To explain the above a bit better, this is a part of the ...
1
vote
1answer
49 views

What are the limitations of WinSock2 sockets within threads?

So I've run into some strange behavior on an application i'm developing in C using the windows API. Im trying to implement a closed connection server-client interface. However, for whatever reason ...
25
votes
1answer
30k views

Where to place an API key: a custom HTTP header VS the Authorization header with a custom scheme

I'm designing a REST API using authorization/authentication via an API Key. I tried to figure out what is the best place for it and found out that many people suggest using a custom HTTP header such ...
10
votes
3answers
436 views

API endpoint POST vs GET

Help me settle an internal question. We have an endpoint which we all agree should be a GET, because all it's doing is calling a stored proc and returning a set of data. However, there is a set of ...
0
votes
0answers
21 views

Proper way to use oauth with external auth server and an api

I have an api server that relies on an auth server (both owned by the same company). Once the client gets a grant from the auth server, it is no longer needed, because the only information I need from ...
0
votes
1answer
91 views

Where is the distinction between a web application and an API?

This question is highly related to this over question. I'm asking another question between I still am a bit confused on the topic. The Issue I Ran Into I currently have a Django web application ...
1
vote
1answer
60 views

REST: Seperate API endpoints for user images and all images?

I'm designing an API for a website where users can share images and all other users can see these images. The current idea is to have a path /user/name/images/xyz to GET a user's image and then a ...
-2
votes
1answer
118 views

How should I design my API responses?

I'm working in a rest API for a turned based game from scratch, and I'm having some troubles figuring out the best architecture to do it. I need to explain how the game works and what is my ...
2
votes
2answers
132 views

Combining PUT and POST on the same resource

I have the resource OrderRequest which I guess can be qualified as process. The OrderRequest can be create of update. The create should be idempotent, because creating the same order request 2 times ...
0
votes
1answer
54 views

Updating last resource access time when clients perform a GET

We have many clients which, upon start up, request a specific resource on the server using an HTTP API (not RESTful). This resource is - currently, identical for all clients. Naturally, since the ...
1
vote
1answer
39 views

Determining the service calls within the API based on the each consumer request

Currently, I have a rest API service which serves to many different consumers. One of the endpoints of API is for retrieving an order. Inside a single application, I am making 5 different service ...
2
votes
3answers
104 views

How should an API handle timezone related data?

I have data in my database in UTC time format in this format (pseudo): [ { "date": "Date: 2020-02-12T08:00:00+0000" "productsSold": { 0: 122, 1: 130, 2: 90, ......
1
vote
1answer
19 views

Identity Server 4 Authentication - Security questions around using the same API for internal application and third parties

So, I have an API that authenticates with Identity Server OAuth2 and gives our user a JWT token when logging in through a front end application, this is a token that has access to everything. The API ...
1
vote
1answer
91 views

Mocking APIs: Keeping mock data up to date?

I'm setting up a development environment for my application. As such, to run it locally, the API dependencies need to be mocked, to keep it as lightweight as possible. The problem however is keeping ...
1
vote
0answers
31 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
2answers
88 views

JSON:API - I don't think I have an `id` or `type` to return

I'm building a Restful API and trying to use JSON:API format for my response. Looking at https://jsonapi.org/format/, it states: A resource object MUST contain at least the following top-level ...
0
votes
3answers
168 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
135 views

Should an API return calculated values that the consumer can calculate themselves?

Say an API returns the following pieces of data: daily_price number_of_days total_price Assume that the API will always have the number_of_days and at least daily_price or total_price. In cases ...
0
votes
1answer
62 views

GET Parameters in Restful API

I'm in the starting phases of designing an API. I'd like it to be Restful and comply with what's commonly considered best practices. One of my resources need to accept several query string parameters....
1
vote
1answer
456 views

Microservices and 3rd party APIs

I recently joined a team who is trying to use "microservice" pattern for their new application. They've already started to implement API's. In the end it should be an API for both mobile and web UI. I ...
1
vote
1answer
59 views

Should a REST API be used when a websocket is already open?

Background: I was working on a web-socket application integrated into a more conventional http request based website that uses REST APIs. Task: I need to retrieve user history from the database for ...
0
votes
2answers
205 views

What HTTP action and return value should be used on resource's action

I have a question about how I should implement a new action for a resource on my API layer. I have a Timesheet which is used by people to let us know how many hours they worked on a job. This ...
4
votes
1answer
1k views

Best way to build a JSON API coupled with HTML views in a Rails project

I've got a Rails eCommerce project communicating with an iOS app. The iOS app receives JSON data from the Rails back-end, but there's also HTML rendering when a user comes to the project from his ...
1
vote
5answers
205 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
1answer
76 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 ...
34
votes
7answers
8k views

Do RESTful APIs tend to encourage anemic domain models?

I'm working on a project in which we are trying to apply both domain-driven design and REST to a service-oriented architecture. We aren't worrying about 100% REST compliance; it would probably be ...
4
votes
2answers
824 views

Tracking online users with a stateless architecture

I own a stateless architecture, exchanging a JWT token between client and server at authentication time. I want to store in database (once per day) a timestamp related to the user access. Indeed, I ...
-2
votes
2answers
37 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
78 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
32 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 ...

1
2 3 4 5
21