Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [api]

An application programming interface (API) is the specification for which software is meant to be used by other software.

-5
votes
0answers
13 views

Récupération fichier JSON sous Andoid

I do not often ask for help but here I am stuck. I need to access my remote database from an Android application. For that I chose a MySQL database and a PHP script. PHP code <?php $servername = "...
1
vote
8answers
607 views

Is there a way to prevent developers leaking data while they are developing?

I am working with a startup company for a while now. They have been affected by some reckless developers in the past. One area they want a real and immediate improvement is when they assign a task to ...
0
votes
0answers
16 views

Creating and Approving OAuth2 clients using Laravel Passport

As I understand with laravel passport, in order for a third party application to consume my api they need to register their application with mine by creating a client. The passport:client artisan ...
0
votes
0answers
17 views

Modelling Azure Consumption API Tags in SQL server

After getting some data from the azure consumption api, there is a field called 'tags' which contains some predefined tags and their values. I am trying to come up with a way to model these in a SQL ...
0
votes
1answer
34 views

How to deal with non-existing parent resources in url?

I've microservice, let's name it Employee. It only has employee logic, but there's a "foreign key" to the (not really) related company. There's no company resource and no company logic in this ...
1
vote
1answer
33 views

Client-side XHR request, which IP does the endpoint read?

Assume a Javascript plugin, for a developer, that's included on their website. <script src="https://external.com/plugin.js"></script> The plugin makes a XHR request to a 3rd party ...
0
votes
0answers
25 views

Data Mapper or Adapter when consuming 3rd party APIs

I consume 3rd party APIs which their format doesn't match my domain models. Is it okay to use the adapter design pattern to convert data to match or better to create a data mapper to convert 3rd party ...
0
votes
2answers
54 views

What to test when testing an API? [closed]

When testing an API (with, for example, Java), what parts should I actually be testing when calling methods of my Controller class (e.g. a Spring RestController)? For example, lets say I've got a ...
-3
votes
1answer
40 views

Design Restful API Get manipulated data from resource [closed]

I am new to rest, I have an entity called availableJobPositions. I want to get most Interesting job by sending a person skills. which url is good in restful: api/positions/skill/most-intersting?...
0
votes
0answers
14 views

W3C Reporting API - Mitigate spam/forged reports

I'm looking into the W3C Reporting API, which enables websites to instruct the client (browser) to send reports about: browser crashes, network errors, browser interventions etc. ouside the JS ...
3
votes
1answer
133 views

REST API Authentication: Cookie vs Web Storage

Note: This question might sound like a duplicate, but all other similar questions did not take into account (mobile apps, iot's, web, 3rd party usage). Specifically, in dealing with the clients ...
-1
votes
3answers
324 views

Why those famous open source tools don't make them also a good-designed library? [closed]

There are a lot of famous open source tools, for example: gcc, git, mercurial and etc. However, they don't provide a nice API for developer. Someone will say, they are command-line tools instead of ...
15
votes
4answers
2k views

Why not use SQL instead of GraphQL?

Recently I learned about GraphQL which claims to be superior to RESTful. However, I started wondering why don't we simply put SQL statements into an HTTP GET request. For example, in GraphQL I would ...
1
vote
2answers
51 views

API Microservices bundle multiple services as one deployment Vs separate deployable for each service

So I am going to be developing atleast 5-6 Res end points . ( all distinct and stateless ) Now I am debating on the following: Should they be combined as single war / ear or deploy each service ...
0
votes
2answers
134 views

How to describe an API-like request that is browser-to-browser?

I'm building a web application that has a feature which allows visitors to directly access resources using URL patterns, for example: www.site.com/client/[clientID]/orders www.site.com/client/[...
2
votes
1answer
107 views

Microservices design: Sharing and populating data

I'm developing a microservices based application and having trouble to understand how api calls should be organized between microservices ... Suppose my application is a products management ...
1
vote
2answers
136 views

How to structure files for API versioning?

My first time trying to implement API versioning here, and I need some guidelines on how to do it... I know there are many ways of doing API versioning. I'm already decided on doing it by uri (i.e, ...
1
vote
1answer
128 views

Best Practice: Third party API on client (Desktop) or Server

I have a small Desktop application (Windows+Mac) that uses third-party API calls (RESTful) to collect some data and present results to users. At this moment, the API calls (open and free APIs) are ...
0
votes
4answers
437 views

Is it possible to infer the the generic type from a generic method?

I'm making an HTTP API client class. I want a Perform() method which takes a request object and returns an obejct that is expected from the API. So a PostRequest object will describe how to get a ...
0
votes
1answer
57 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 ...
4
votes
1answer
236 views

How to properly version an API?

I'm designing an API for our web application, that will be consumed by mobile developers that will create our mobile app. I chose to document it using Swagger / OpenAPI 3.0.0. I'm surprised that ...
1
vote
1answer
73 views

Data is in database or get from API, where should API request code goes?

For me, the data I want to retrieve may be in database for which I can use properties of model and also relationships, but if the record is not a property and no relationship exists for that ...
2
votes
4answers
128 views

Proper HTTP method for triggering a process [duplicate]

I have a question regarding HTTP methods and what would be most proper in terms of conforming to REST principles. I have two services, A and B. When new data is added, or old data is updated at ...
1
vote
0answers
58 views

Third-party API wrapper in Java: how to design

Suppose, there's a site that provides an API, such as this: Users post questions, answers on that site You can make GET and POST calls There are two types of authentication: weak (only gives read ...
1
vote
1answer
53 views

different data connectors for different objects and users

I have an application which needs to store different objects in different data stores based on the user's authorization credentials. I.E. the user may need to save object 1 to their BI postgres ...
2
votes
1answer
86 views

Trying to figure out how to make the syntaxes of 2 different API's the same

I'm doing research to a problem occurred in our company. We have a front-end web portal which communicates by API with a back-end in a same syntax, for example: "www.123.com/api/v1/getCustomers". ...
1
vote
1answer
61 views

Batching CRUD of individual models that need to be linked

I have a few models which need to be linked together during a workflow on my webapp and I'm having trouble thinking of a nice abstraction for the api. They are represented as individual constructs on ...
8
votes
5answers
487 views

Consequences of not doing a REST API the “right” way?

I'll ask this question this way - what are the software engineering concerns for not implementing my REST API the "right" way? What do you mean the "right" way? Well, allow me to explain my ...
1
vote
1answer
64 views

Good practice for writing API's serving paid features

I'm building a paid feature for my application & the clients who haven't enabled it won't have access to it While building all the API's around it, I see that I'm doing a lot of permission checks ...
1
vote
1answer
64 views

Check if object exists before updating/deleting

In an application that doesn't use an ORM, is it good practice to check whether an object exists before attempting to update/delete it? For example: @Route(method="DELETE", path="/posts/\d+") ...
0
votes
0answers
96 views

Where should the API reside?

I have a microservice(opsApiServ) which hosts API to do operations(ops). /ops - POST, GET /ops-item - GET ops-item is just a single unit of operation, and ops is collection of operations (ops-item). ...
0
votes
1answer
95 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 ...
0
votes
1answer
64 views

Microservice on top of an API

I have an Odata API server that I can't change only access it, I can do CRUD operations on it. However I'd like to authenticate users, that are stored on this server. I can retrieve a user (his email, ...
0
votes
2answers
99 views

API and motherboard

I'm new on API and still undergoing some research to gain knowledge for my presentations for next few days. Different motherboard have different CPU socket. So I was just wondering, do API affect ...
0
votes
1answer
63 views

Use same API for both website and other clients or not?

Lets say I am building some large application ( multi-page app ) using Laravel. And laravel will allow me to make an API and a website on the same application. Since the website and the API ...
-2
votes
1answer
70 views

Is it a good idea to ask for requestId in each API call?

I see some services which takes a requestId from client as the mandatory attribute while some services doesn't. I feel it is a good idea to have a request Id from the clients because it helps in ...
0
votes
1answer
84 views

API User identification

I'm designing an API, and I need to authenticate each request with a user. The simplest way to do that is to provide an API key to each user on their "My account" page, that they could regenerate at ...
0
votes
1answer
44 views

Name for a library that provides an API for other libraries

I've been working on a library at work which provides a simplified API for a few underlying libraries (face recognition, text to speech, etc.). My boss asked me the best way to describe this concept ...
0
votes
1answer
139 views

Check if user is logged in when using JWT

I have an app that uses JWT tokens for user authorization. Now, I need to be capable of deactivating users (users won't be allowed to use the system but still exist in the database), but as a ...
0
votes
1answer
66 views

Avoid numerous dynamic_cast_ptr in the API design of polymorphic types

I am trying to design a geometric intersection API. Below is the code to represent geometric elements. #include <iostream> #include <memory> // Since I did not write the Shape class I ...
2
votes
1answer
37 views

Creating backend system, over API

I recently came across a demand to create a web system (which will be done in PHP, but is for any language), to have the same functionalities of a mobile application already ready. This app has a ...
2
votes
2answers
116 views

Should REST API return escaped user generated content

We have a REST API that returns user generated content from a database. Before inserting the data into the database the data is sanitized. But when returning the data we do not escape / decode the ...
1
vote
1answer
145 views

Breaking 3-tier architecture into multi-tier architecture

Recently I have been working on a rather large system with Vue.js for a single page app (SPA) and an API for the backend. The customer is concerned with the security, performance and maintainability. ...
1
vote
1answer
43 views

Multiple app authentication, universal user login, best practice

Please see the below diagram. There are two apps that each have a different set of functions, User A is a user of App1 and User B is a user of App2. They should not be able to log in directly to the ...
1
vote
1answer
53 views

Using frameworks that map database to RESTful APIs?

While researching RESTful API frameworks I've come across (generally speaking) two types of frameworks: The first type will (more or less) directly (or nearly directly) map an ORM/ODM scheme of your ...
0
votes
1answer
88 views

Is It good practice on API design to use different object model for getting object and creating

While mostly every company got it's standard on APIs, the question just came out after that one of my colleagues stated we must use different object models for creating and getting objects from API. ...
50
votes
9answers
11k views

Should you guard against unexpected values from external APIs?

Lets say you are coding a function that takes input from an external API MyAPI. That external API MyAPI has a contract that states it will return a string or a number. Is it recommended to guard ...
2
votes
3answers
98 views

Permissive vs. Strict API Message validation

We had a interesting debate today over what our REST API should default to doing when validating a request body where unexpected fields are present. I think we ended the conversation in a good place, ...
1
vote
0answers
31 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
1answer
101 views

Methods to Securing APIKeys

I have read on several methods to securing an API key like gitignore or placing in another file if using an application, but at some point if taken the time, anyone can get the key, even when apikey ...