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
0
votes
1answer
5 views

How to write unit tests for REST API that are atomic?

I am writing a REST API for use by the front-end web and mobile frameworks. Naturally, I write unit tests for each endpoint, which makes developing, evolving, and maintaining the API easier. However, ...
0
votes
3answers
63 views

Using (Collections of) Tuples as Class Properties in a Public API

I have a parameter object that represents a single match in a competition, and one of its properties needs to contain that match's game scores for both players. For example, in a match determined by a ...
2
votes
1answer
79 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
34 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
34 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 ...
-2
votes
1answer
122 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
19 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 ...
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 ...
-2
votes
3answers
326 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
0answers
26 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 ...
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
135 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 ...
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'...
-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 ...
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
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 ...
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 ...
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-...
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 ...
-4
votes
1answer
57 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 ...
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 ...
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. ...
-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, ...
2
votes
1answer
92 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 ...
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 ...
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 ...
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) ...
-5
votes
1answer
77 views

Giving a fixed project price when REST is involved

Whenever I am asked to give a quote for a project that involves a remote REST API, I become very cautious. Most of the REST API's I worked with had a documentation, but it usually turned out to be ...
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> &...
1
vote
1answer
87 views

What are ways to manage secrets in a big organisation?

Many articles on the internet focus on methods to keep secrets outside public-access (like mobile apps, website frontend etc). But let's take the example of a really big organisation. It has secrets ...
0
votes
0answers
40 views

Paging changing list of API results

Problem I'm currently building a service (think of it like Reddit) which allows users to post and comment. It's possible to search for posts within a given radius of your location (e.g. 10km). When ...
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
votes
3answers
146 views

Open-sourcing applications with API keys

Consider a desktop application that interacts with a web API, for which it needs a key. How should API keys be handled? Configuration files come to mind, however it doesn't seem that simple when terms ...
0
votes
0answers
20 views

Apache Spark as web api

I try to validate an arhitecture like below, but I'm not sure if is the right way. What I have here: A web application which have an Excel Module (import/export files, csv, xlsx) and display them in ...
0
votes
0answers
24 views

How to structure/design a webapp using a large number of APIs

I am writing a webapp that aggregates a multitude of different APIs to gather data related to astronomy, and then returns the aggregated data in a single API endpoint. There are 7 API's being used, ...
1
vote
0answers
62 views

Asynchronous communication with legacy system

Background My task is to create new system (X) for realtime work tracking for internal use. You should think it like an app that you have opened on a separate monitor/ on phone all day and you are ...
-3
votes
2answers
49 views

How should I handle a scalability problem during routing my requests from server?

I have faced a problem with the initial design of my system where sensitive information was being sent to the front-end and front-end was responsible for calling 3rd party APIs. As you have probably ...
-4
votes
1answer
64 views

Which API building practice is better?

Im working on a ERP product, In which backend logics are to be APIs. Right now I have around 80 Tables. Proposal 1: Creating CRUD APIs for all tables and manipulation of data to be handled in front ...
1
vote
2answers
74 views

Authenticating requests from third party users to our APIs

We have a web app which has certain APIs. Users of our webapp will use these APIs when they login to our webapp (like how many records me as a user do I own, user specific, etc). We are creating ...
0
votes
2answers
152 views

Is it okay to keep open the MySQL database connection open through out the Application or open and close connection query-wise?

I'm developing a REST API using Nodejs along with MySQL as the database.Is it okay to keep open the MySQL database connection open through out the Application or open and close connection query-wise ? ...
0
votes
1answer
56 views

RESTful Response when the POST request results in the creation of different kind of resources?

I have been working on designing an API that lets client create a product (think of product as something like website domain, something that comes into existence when client makes order for it to the ...
1
vote
0answers
19 views

Design REST API for Mobile Apps with Unregister Users

I'd like to know some best practices on how to build rest API for a backend which shall communicate with a mobile app by anonymous users. This is the scenario with details: I'm building a demo library ...

1
2 3 4 5
22