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
1
vote
2answers
116 views

Rest API relationship design

I have a question in regards to designing relationships in REST API's. Imagine I have a relationship like in this diagram Now, should I show the relationship in the team endpoint like this? /v1/...
2
votes
1answer
70 views

API development - Exposing new version VS updating current version

Context There is a back end and a front end team. Back end exposes an endpoint to the front end app: PATCH car/{carID}/tire Problem I want to update the aforementioned PATCH request functionality ...
0
votes
1answer
24 views

Design a correct microservices architecture with data relations

I just started thinking about building a microservices architecture for learning purposes. I understood that microservices are split, and they should be independent, even when storing data, but what ...
-3
votes
3answers
103 views

Which approach is the most RESTful

As a team we are preparing a REST API for handling chargers' operations. Let's say we have a part of the code that is responsible for starting charging and for stopping charging. We want to provide ...
-1
votes
1answer
33 views

Opinions on using standardized J2EE APIs over specific over vendor APIs

I have always advocated the use of standardized api, and currently use it on my code. However i always get very strong resistance when it comes to code review, even on projects i have designed and ...
0
votes
0answers
32 views

WebApp architecture with multiple client

I'm investigating how I could achieve a project I've been thinking of for a while. Let me explain the project (I will not go into too much details, but I think what I'll write will be enough). So, I ...
0
votes
1answer
33 views

Google Analytics API Key Security

When dealing with an API key (in this case a JSON file used to connect to the Google Analytics API), what is the appropriate way to securely store the keyfile? "Your new public/private key pair ...
9
votes
6answers
4k 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 ...
-2
votes
3answers
325 views

RESTful API User Accounts

I'm trying to expose RESTful API endpoints for creating user accounts to access my API. So, this would be one of the first things my consumers would use. I'm trying to figure out if this is how I ...
-2
votes
1answer
120 views

When writing code to consume an external API, should you default to production or testing?

I'm currently writing some code to interact with an API that doesn't have any official libraries. The provider has given me two sets of credentials - one for testing and one for production. I'm ...
-5
votes
0answers
18 views

NUXT caching API requests

Im developing a project using Nuxt and I need to update the data 15 in 15 seconds, the api is a third party api and has a 100 api calls limit per day. I need to be able to make only 1 api call every ...
-1
votes
0answers
25 views

Grouping the APIs based on the resources or access levels (public, authorized)?

We are designing our APIs and are struggling to come up with how to group them We have following types of resources Public (access from any domain) Public but with CORS Authenticated with role based ...
1
vote
1answer
69 views

How to manage huge chunks of validation data inside a REST API

TL;DR What are common practices to separate validation logic inside a rest API & thereby keep the code clean and straight forward? (code example) Context & Example Let's say I'm developing a ...
0
votes
1answer
78 views

Should an http API client hide the http response object?

I'm using a client library for an HTTP API. The client exposes objects and methods matching the domain, e.g. Api::Document.download, but the return value is just the http response from the API. As the ...
3
votes
2answers
357 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 ...
1
vote
2answers
862 views

Multiple API calls potentially spawning multiple Websockets - Threading vs Async

I am designing a program with the flow as outlined below. Note, these are all network calls, there is no system I/O (hard drive). Initially, multiple independent API calls need to happen - they don'...
2
votes
0answers
25 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 ...
3
votes
2answers
982 views

Why do we must declare a public API when using semantic versionning?

from semver.org: Software using Semantic Versioning MUST declare a public API. This API could be declared in the code itself or exist strictly in documentation. However it is done, it should be ...
3
votes
3answers
13k views

What is the difference between an API and a library? [closed]

I have a created a Java project. My project is a collection of classes that allow a programmer to manage local networks (create network, delete network-access to device, get information of SSID) and ...
1
vote
1answer
39 views

Best way to renew OAuth token before expiry

I am building a simple application built in Rails that allows the client to connect to a third party api to sync customer data. The customer inputs their username and password and my application ...
1
vote
2answers
134 views

Single item endpoint responses: List vs. object

So I'm currently working on building a restful API. Let's keep it simple and say I have two endpoints, both GET: /products /products/{productId} The first returns a list of all products, the second ...
0
votes
1answer
94 views

Is it an anti-pattern on React to search for children with a specific element type?

Context When designing the API of a React component, you may decide to receive props in a more semantical way. Here's a simple example <Modal headerTitle="foo" /> vs <Modal> &...
2
votes
1answer
97 views

What are the different messaging patterns for multiple producers to single consumer through a distributed queue?

We have multiple producers that publish messages to the same SQS queue. We have a single consumer that processes the messages. The producers do not care about the response. It is more like a broadcast ...
1
vote
1answer
65 views

Consuming complex JSON service that does not have schema

Hi I have this weird situation where I have a JSON producing service that represents a very complex object graph and this bject graph does not have a JSON schema that it is based on. The reason for ...
-4
votes
1answer
92 views

What to concern when publish code with an API call on GitHub? [closed]

I'm learning the way to use API right now. Since I want to publish the code on GitHub, I have some question about it. 1. I will use public API, however, there are APIs with authorization and those don'...
-1
votes
1answer
57 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 ...
-4
votes
1answer
67 views

How to create an Event-Driven Architecture with many external sources

I work for this Accounting company - as a Product Owner - that uses several external services (one for Contract management, another one for Accounting Demands management, a third one for Financial ...
2
votes
2answers
135 views

API architecture design for fast reads of text file with 150m unique labels

Assume a text file with 150m unique records. Each record has two columns: (1) string and (2) integer. The string is a unique label, and the integer is the label's value. The only query will return the ...
0
votes
0answers
34 views

How to create input data for unit tests for an API client?

I am building the initial set of unit tests for my team's legacy API client system. We have been writing integration tests, but have no unit tests. It's a Sinatra server that accepts requests from our ...
0
votes
2answers
65 views

Structuring optional REST resource hierarchy

I am designing a REST service with multiple end points which will be servicing the following hierarchy: Department has many Category Groups Category Group has many Category(-ies) Category has many Sub-...
0
votes
2answers
53 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....
3
votes
1answer
135 views

What do you call the interface design error that consists in splitting two public methods that should be called toghether?

Consider a poorly-designed interface in which there are two functions (say foo() and bar()) that can be called independently, but in order to get some expected behavior (or in order to keep the object ...
2
votes
1answer
217 views

Which setup is more REST abiding?

I want to create an endpoint for "logging out". Logging out in my case is basically removing an access token from the database. Therefore DELETE verb makes sense here, something like this: DELETE URL/...
21
votes
9answers
6k views

Declaring that a function never returns

If I have a function that never returns (it contains an infinite loop) how do I declare/communicate that it will never return to the user of the function? The user does not see the source code, only ...
-1
votes
2answers
162 views

Achieving server-side rendering of data coming from a PHP API

I have been working on a blog application with Codeigniter 3.1.8 and AngularJS v1.7.8. It is intended to be versatile and easy to use. The Dashboard of the application is "pure" Codeigniter, ...
-4
votes
1answer
56 views

Secure way to send API key

I am developing an SDK which users would use to access my service The authorization is done using an API key, which is unique to each user. SDK makes API calls to my server using the provided API Key ...
0
votes
0answers
28 views

Multiple external API calls and only one valid response depends on the parameters value

In my microservice I need to call several external API. The problem is that I do not know which of them to call to get a proper response, but I am sure that one of them return a successful response. I ...
-1
votes
1answer
70 views

Is Web Scraping Viable When Information Needs to Be Formatted and Displayed

I'm working on a project where I want to display a list of wedding venues within X miles of a users location. My first thought is that I will use some type of web scraper to pull in a list of venues. ...
0
votes
1answer
279 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
65 views

Maintaining Objects Across API Deployment Instances

I am working on a web application as a hobby and trying to learn some concepts related to cloud development and distributed applications. I am currently targeting an AWS EC2 instance as a deployment ...
2
votes
1answer
91 views

What do you call the combination of endpoint and HTTP method in a REST API?

Let's use the Twitter API as an example. My understanding is that we refer to /statuses/update as an endpoint and we refer to POST as a HTTP method. So what would term do you use to refer to the pair ...
0
votes
1answer
99 views

What would be a good way to obtain route-specific CSRF tokens for an API?

Recently I have started rewriting my Rails app to Roda, and encountered a hiccup. While Rails uses a single CSRF token for the entire application (and stores it in a meta tag), Roda recommends using ...
2
votes
1answer
184 views

How to handle API token(s) that expires after time

I'm currently building a facade that's supposed to be in front of a system we are currently using. This system has its own API, but we have decided to simplfy things, and therefore the facade. ...
4
votes
4answers
214 views

How to describe a function argument that is used as a hint/best-effort?

Say I have a server exposing an api that let me retrieve 'things', there are a lot of things, and as such retrieving all things at once could take down the server, hence the exposed API returns ...
1
vote
2answers
95 views

Is it reasonable to ask API consumer (client) to provide sync response to notification/callback?

We have an API platform which allows user to create and manage a certain type resource. Client is expected to provide a callback url where our server will send notification to when the resource is ...
46
votes
4answers
11k views

What's so bad about the DOM?

I keep hearing people (Crockford in particular) saying the DOM is a terrible API, but not really justifying this statement. Apart from cross-browser inconsistencies, what are some reasons why the DOM ...
3
votes
3answers
277 views

Why not use SQL to query an API instead of GraphQL?

nalzok posted an interesting question over a year ago: "Why not use SQL instead of GraphQL?". Respondents seem to suggest three main problems: One should not directly expose one's database ...
39
votes
1answer
3k views

How to design a REST API that can “prompt” the client about long-running operations?

Say you were to develop a REST API that provides access to a set of complex, long-running, operations. The typical paradigm for an API like this (as I understand it) usually involves (the client) ...
0
votes
1answer
45 views

Using external APIs to build a dashboard

I have a website that is based around some external APIs related to a certain theme. It combines data of responses from multiple APIs before returning to the frontend. With that said, my server side ...
0
votes
1answer
46 views

How to design a topped-up internal balance for a replicated API?

My product is an API which charges an amount of USD every N requests. I would like to allow my users to top-up their internal balances through PayPal, then decrease their balances when they use the ...

1
2 3 4 5
22