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
39 views

Api limit access to subscribers only

I have a vanilla php api(on a vds) and I want to make data coming from that api available to a few clients that are using a python app that's also written by me. That python app is running on my ...
0
votes
0answers
26 views

How do I assign methods if I have 100 endpoints in a RAML spec?

I'm trying to build a RAML API specification for the first time. The API will need to give users access to 100 resources (endpoints), so I'm not sure how to assign methods to them. I assume there has ...
-2
votes
2answers
122 views

Confused about how APIs are called

I'm new to APIs. Conceptually, I understand what an API is, but I get confused when it comes to the some of the technical details. All of the tutorials I've read talk about URLs and endpoints, and ...
0
votes
0answers
10 views

In search of a performant API Autorisation method for private iot app [closed]

We have developped a set of api (no api gateway yet) and a set of these apis will be consumed by an application hosted on a private IOT (by that I mean that the machine is physically protected and ...
-1
votes
0answers
17 views

Incorporating Functions Into APIs [closed]

How are functions generally incorporated into APIs. I would imagine you could just cut and paste your function in as a method of a class, but is this actually how it would be done? I'm asking this ...
1
vote
1answer
45 views

How do I create an HTTP PUT request that modifies the resource in many ways

I have a NodeJs backend that interacts with MySQL database. Let us assume that I have a schema similar to this: Book id name Author id book_id name So, I have two tables named Book and ...
0
votes
1answer
127 views

What is a good Object-Oriented design for geometry objects when building libraries dealing with geometry operations?

I am trying to design an object-oriented library to handle geometric calculations. However, I am trying to exaggerate on being "tightly" object-oriented and applying relevant "best practices". I know ...
1
vote
1answer
34 views

Micro-services architecture for Data Ingestion/Transformation pipeline project

I am working on designing a brand new Data Ingestion Pipeline with the Key highlights of the new project are as follows: Download and Update data to/from SharePoint using SharePoint APIs Download and ...
0
votes
0answers
42 views

Securing a microservice that will be accessible from frontend

I need an advice on securing interaction between an application App and a microservice RecordApp. App is the main application, where all users are registered and do some activity. RecordApp is a ...
0
votes
2answers
152 views

Rest API POST with illegal data in parameters: Bad Request or 404?

Take a hypothetical camera company providing an API to manage its users and cameras. Each user owns cameras, and every user of a camera has a role assigned (one of admin, operator, viewer - these are ...
0
votes
1answer
29 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
vote
2answers
104 views

Refactor namespaces in a library while keeping backwards-compatibility

We developed a generic .NET library for our line-of business applications. This is what our namespace/class structure looked like 5 years ago: ... AcmeCorp.Tools.ExcelWriter AcmeCorp.Tools....
0
votes
0answers
22 views

Building an API for long distance customers with IOS App, single or multiple calls?

I am in the process of building an API in Laravel and my server is currently stored in the UK. Now I have read some of the posts relating to this topic on Stack but I am still a little unsure as to ...
0
votes
0answers
38 views

How do you expose the field that caused the error?

Context: field errors Given an input in the form: { "list": [ { "username": null }, { "username": "test" }, { "username": "" } ] } Some APIs expose errors in the ...
1
vote
1answer
67 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. ...
-1
votes
1answer
16 views

Adding resources to subresource REST API

I'm trying to build an web API that closely represents a library of books. I currently have the following routes. GET /api/books GET /api/books/:bookID GET /api/libraries POST /api/libraries This ...
0
votes
0answers
25 views

Call external API during validation (Rails)

I need to validate a value with data from an external API. The easiest way would be to add a validation rule in my model, call the external API and do my check. But it feels very dirty to call an API ...
-1
votes
1answer
57 views

Resful name API for multiple key objects

We are implementing an API and we want to follow best practices for naming the endpoints. However, during the design, we have found a challenge. We have some objects where the key to the objects is a ...
0
votes
1answer
32 views

Handling different error types from diffierent libraries with express

Most of the express error handling documentation and tutorials I've read suggest using Express middleware to throw errors up to, and to handle the errors there. eg. From the Express documentation: ...
0
votes
1answer
36 views

Should i use a separate droplet(DO) for the API?

I have a little app(PHP) that uses data from a third party. That data is processed constantly and saved into a database. And now i want to create a RESTful API to allow access to that data. Should i ...
-4
votes
1answer
111 views

Is it bad to leave Azure secrets keys as plaintext in my source code if I don't release the code, only the exe? [closed]

Specifically worried that someone might be able to extract the API key in a way I am unaware of and make calls to my own Cognitive Services subscription outside of the context of my program.
0
votes
3answers
88 views

API with different kind of response for error

Let's focus on a single endpoint, which always returns an encoded JSON object with a well defined and documented structure. But when an exception is thrown, the exception itself is formatted to a ...
0
votes
3answers
106 views

Url pattern for making a 'like' with a REST API

I have an API route as so: GET /api/item/like Which makes a like object between the logged in user and item object, and it works fine. Is this the correct way to have a user 'like' an object? Or ...
2
votes
0answers
37 views

How to authenticate third-party callbacks that don't support authentication

I'm working on a project that integrates with a third-party service via API, and the third-party uses callbacks to update us on the status of the operations being performed. These callbacks can be hit ...
3
votes
2answers
167 views

How should domain services be referenced?

I'm working on a test project, with the intention of using DDD. So far I have this basic project structure: My question is: How should the Core.Domain.Services be referenced? do I create an ...
0
votes
1answer
39 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. ...
0
votes
1answer
113 views

RESTful API Endpoints - Concrete vs OO versioning

I am looking at Versioning Micro Services solutions and got a little carried away with OO design. Using WebAPI, I got to the point where I can use OO design to choose the correct version to run with ...
0
votes
1answer
118 views

REST Many To Many Design

Consider a web api exposing two kind of resources: Users and Teams with many-to-many relationship, typically a REST api will expose the following trivial endpoints to read data: GET /users GET /users/...
1
vote
8answers
656 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
30 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
18 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
35 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
35 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
45 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
65 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
43 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
15 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
219 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
328 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
69 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
135 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
120 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
270 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, ...
2
votes
1answer
201 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
699 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
119 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
242 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
74 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
168 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 ...