Questions tagged [api]

DO NOT USE. Use specific tags like [google-cloud-platform], [facebook], [amazon-web-services] instead or [api-design] where applicable. Questions asking to recommend or find an API are off-topic.

Application Programming Interface (API) is a source code based specification intended to be used as an interface by software components to communicate with each other. A good API makes it easier to develop a program by providing all the building blocks. A programmer then puts the blocks together. An API may include specifications for routines, data structures, object classes and variables.

An API specification can take many forms, including:

  • an International Standard such as POSIX,
  • vendor documentation such as the Microsoft Windows API,
  • the libraries of a programming language - e.g. Standard Template Library in C++ or Java API.

An API differs from an ABI (Application Binary Interface) in that the former is source code based while the latter is a binary interface. For instance POSIX is an API, while the Linux Standard Base is an ABI.

Source: Wikipedia (Application Programming Interface)


Questions asking us to recommend or find an API, documentation or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam.

Link to the API Burninate Request

107148 questions
12
votes
2 answers

How to replace obsolete WebClient with HttpClient in .NET 6

Since WebClient is deprecated in .NET 6, I want to convert the following code using WebClient with an equivalent code using HttpClient for calling a REST Web API: using WebClient client = new(); client.Encoding =…
Fabius
  • 147
  • 1
  • 1
  • 4
12
votes
6 answers

Error HH604: Error running JSON-RPC server: error:0308010C:digital envelope routines::unsupported

I am setting up hardhat in Linux. I have set up the react app first using these commands. npx create-react-app react-dapp cd react-dapp Then I have installed some hardhat dependencies using this command. npm install ethers hardhat…
enstazao
  • 121
  • 1
  • 8
12
votes
3 answers

Laravel 8 misbehaves on trailing slash

There is a problem occurring while using APIs with trailing slash. Route Route::post('user/register','UserController@register'); It's working fine when I called this route POST from the postman/website, but I called this route from mobile with a…
Muhammad Shareyar
  • 772
  • 2
  • 7
  • 21
12
votes
2 answers

Programmatically posting Facebook comments

My application has obtained publish_stream permissions for a Facebook user. I'd like to allow the user to post comments for a target URL directly from my mobile application, rather than opening up an embedded browser that then shows the Comment Box…
kbs
  • 505
  • 5
  • 8
12
votes
2 answers

How can I access my laptop's built-in infrared webcam using python?

I'm trying to access my laptop's built-in infrared webcam (intended for windows hello) in a python project. I can access the normal RGB camera quite easily using the VideoCapture class from OpenCV, however can't find a way to access the infrared…
Mohamad Zeina
  • 404
  • 3
  • 20
12
votes
3 answers

CSRF Double Submit Cookie is basically "not Secure"

From OWASP page : A CSRF attack works because browser requests automatically include all cookies including session cookies. To prevent it, we can use double-submit cookie hash. In some sample codes I found, basically this algorithm is found. Victim…
Timothy
  • 855
  • 1
  • 13
  • 29
12
votes
3 answers

How to get ALL (or multiple) pair's historical klines from Binance API in ONE request?

I have a trading bot that trades multiple pairs (30-40). It uses the previous 5m candle for the price input. Therefore, I get 5m history for ALL pairs one by one. Currently, the full cycle takes about 10 minutes, so the 5m candles get updated once…
sellthehype
  • 123
  • 1
  • 1
  • 6
12
votes
4 answers

How to get a list of *new* followers using the twitter API

I need to periodically return a list of all new followers of a twitter account (i.e. since the last time the list of followers was retrieved), but the Twitter API only seems to provide functionality for getting a list of all current followers of the…
Mark Perkins
  • 260
  • 2
  • 10
12
votes
3 answers

Share content of a webpage to Instagram story

I am working on a web app in which some content is generated in the form of text (and will soon include images as well). I want to add a share button which will allow the user to add this content to their Instagram story. So the flow of this is…
RishiC
  • 768
  • 1
  • 10
  • 34
12
votes
12 answers

How to get rid of this - message:{'You are not subscribed to this API.'}.?

import React from 'react'; import './App.css'; function App() { fetch("https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/quickAnswer?q=How%20much%20vitamin%20c%20is%20in%202%20apples%253F", { "method": "GET", …
Shahriar
  • 150
  • 1
  • 2
  • 9
12
votes
1 answer

When should I throw an exception as opposed to return an error in PHP?

I'm working on an API wrapper class, which is the first I've made. For the most part it hasn't been too difficult. Getting to the point where I need to deal with the potential of errors being returned by the API, however confused as to how I should…
Relequestual
  • 11,631
  • 6
  • 47
  • 83
12
votes
3 answers

The server cannot service the request because the media type is unsupported Soap Nodejs

I've built and api in nodejs with the library "soap" that consumes a wsdl project. Im trying to do a post and in the response body im getting this error: The server cannot service the request because the media type is unsupported ; also in the…
Eleazar
  • 335
  • 1
  • 3
  • 10
12
votes
3 answers

Cypress: Re-use auth token across multiple API tests

I have a Rest API which generates a token. This session token is used across multiple REST API's as an authorization Bearer token. I used this as reference:…
ebanster
  • 886
  • 1
  • 12
  • 29
12
votes
3 answers

Is it possible to have an API working with both REST and gRPC?

My goal is to try to put both to work as part of the incremental migration from a REST API to gRPC. We are going to start using gRPC as the way of communication between our services in our microservice architecture. The problem is that whenever I…
Nez
  • 121
  • 1
  • 4
12
votes
4 answers

Validation does not work with Partial - NestJS

I want to apply server-side validation on my CRUD API. The entity in question is called Employee. I am using an employee.dto (shown below) for the create and update endpoints. The class-validator package works fine on the create method but ignores…