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

learn more… | top users | synonyms

5
votes
2answers
361 views

Why does java collections not supply a function for the index of max value?

I have been using Collections.max(list) for many projects, but I occasionally want to find the index of that maximum element. I feel silly writing a function to do this for myself in every program I ...
1
vote
1answer
190 views

Merge two different API calls into One

I have two different apps in my django project. One is "comment" and an other one is "files". A comment might save some file attached to it. The current way of creating a comment with attachments is ...
4
votes
1answer
230 views

What is the evidence that an API has exceeded its orthogonality in the context of types?

Wikipedia defines software orthogonality as: orthogonality in a programming language means that a relatively small set of primitive constructs can be combined in a relatively small number of ways ...
-1
votes
0answers
34 views

Clearly defining an Implementation detail

In what way could I, when designing my API, framework or whatever decide what is and what is not an implementation detail? What questions do I ask in order to correctly answer: "Is that something my ...
2
votes
1answer
85 views

What's the best way of building an administrative UI for an existing SPA application?

I’m working on an application where the client-side interface and backend server are completely separate applications. The backend is written in Ruby and only serves JSON via HTTP. The client is a ...
-4
votes
0answers
36 views

Using PHP to access a catalog [closed]

The site I am building is built on Wordpress and I was curious if anyone knows of a way to access the information on the site below with php: ...
-7
votes
1answer
36 views

How to disable some windows 7 abilities using WinAPI? [closed]

For example,windows 7 has taskbar,many icons in it,icons can be moved to other side of taskbar.So,how can this ability of moving be disabled using winapi? does windows have any winapi function about ...
1
vote
1answer
92 views

Implicit OAuth2 endpoint vs. cookies

I currently have an app which basically runs two halves of an API - a restful API for the web app, and a synchronisation API for the native clients (all over SSL). The web app is completely ...
3
votes
4answers
396 views

When is an API considered to be an embedded DSL?

What is the difference between an API and an embedded Domain Specific Language (DSL)? Is it just syntax? Consider an API like OpenGL. How is that different from a graphics DSL? In other words, if ...
0
votes
1answer
105 views

Reflective discovery of an inner class in an API

Let me ask you, as this bothers me for quite a while but appears to be subjectively the best solution for my problem, if reflective discovery of an inner class for API purposes is that bad idea? ...
0
votes
1answer
42 views

Real time middleware system: Direct DB access vs REST API access

I'm developing a complex environment which involves a web application, a mobile app and a real time middleware system which accesses the DB for on-site tag readings. Currently, the web application ...
8
votes
5answers
2k views

REST API concepts

I have three questions about REST API design that I'm hoping someone can shed some light on. I've searched relentlessly for many hours but haven't found answers to my questions anywhere (maybe I just ...
0
votes
1answer
130 views

REST and RPC in multi-tier API

My team is developing a multi-tier API with scalability and modularity in mind. The public access point of the API is fully REST. However, we are splitting the data access layer as another tier in our ...
2
votes
2answers
3k views

Is it safe to transmit access tokens via HTTP headers?

It's the first RESTful web service and I am concerned about security issues. Is it safe to transmit my access token via HTTP headers? For example: POST /v1/i/resource HTTP/1.1 Content-Type: ...
1
vote
2answers
226 views

How to present a stable data model in a public API that allows internal data structures to be changed without breaking the public view of the data?

I am in the process of developing an application that allows users to write C# scripts. These scripts allow users to call selected methods and to access and manipulate data in a document. This works ...
1
vote
1answer
99 views

How do newly-created programming languages use Windows API features?

WinAPI is focused primarily on the C family, but how do new programming languages use those features without creating their own runtime/interpreter type thing? Do they hook directly into the DLL ...
10
votes
1answer
2k views

What ever happened to the Google AJAX Search API

I am looking to query the main Google search however all references including stackoveflow point to the Google AJAX Search API. The odd thing is that it does not seem to exist any more not even a ...
73
votes
13answers
15k views

What's the difference between an API and an SDK?

I was looking through various APIs and SDKs, when I realized that I couldn't really tell the difference between something called an API and something called an SDK. Both of them are, conceptually, a ...
4
votes
3answers
260 views

How to handle business rules with a REST API?

I have a REST API to manage a booking system I'm searching how to manage this situation : A customer can book a time slot : A TimeSlot resource is created and linked to a Person resource. In order to ...
2
votes
3answers
120 views

Best way to indicate more results available

We have a service to return messages. We want to limit the number returned, either allowing the caller to specify the max number to return, or else to use an internal hard limit. We also have thought ...
0
votes
1answer
146 views

API always returns JSONObject or JSONArray Best practices

I'm making an API that will return data in JSON. I also wanted on client side to make an utility class to call this API. Something like : JSONObject sendGetRequest(Url url); JSONObject ...
2
votes
1answer
106 views

How is the correct way of writing TDD for a void API?

Ok so my scenario is this: I have a third party component that offers an API for communicating with an external system. The method calls for commanding the external system to do stuff, all return ...
44
votes
2answers
2k views

Why have hardware-accelerated vector graphics not taken off?

I'm working on an app that involves real-time manipulation of vector paths at 60fps, and I'm very surprised by how little information there is on the subject. At first, I tried to implement my idea ...
9
votes
4answers
511 views

Should I parse XML on the server or provide a proxy and let the browser parse it?

I need to interface with a 3rd party API. With this API I make a GET request from within the end user's browser and receive an XML response. This data is to be used in a browser based application ...
0
votes
1answer
191 views

Best practice for storing information from a php script for future use

My employer uses forms to help people search for products. The product lists can change from time to time and the forms need to be updated again. The product information can be accessed through a ...
1
vote
0answers
92 views

How to make sure media are used only on authorised sites?

I have a video library that I need to publish for my clients. The clients need to be able to embed a player to their sites and play the videos. I need to restrict access to my clients only so that ...
0
votes
3answers
97 views

Is it actually worth unit-testing an API client?

This is something that's been troubling me for a while now. Is it actually worth unit-testing an API client? Let's say you're creating a small class to abstract-away the calls to a petshop REST API. ...
4
votes
3answers
1k views

What can REST API do that a API using HTTP URL query strings cannot do?

I'm learning about REST and had the chance to build a basic REST API. After doing so, most of the material I read was internalized and I now have a better understanding of it. However, I do not ...
5
votes
4answers
539 views

Is it a good idea to merge multiple HTTP requests to save bandwidth?

I am preparing a single page application that would be sometimes used over slow mobile connection. Some of its part are quite heavy in terms of API requests (fetching ten different resources for a new ...
3
votes
1answer
79 views

Should I add a key to the items of my REST API response?

I have an REST API endpoint which the JSON response looks like: { "products": [ {"id": 1040, "price": 2.95, ...} {"id": 4545, "price": 3.95, ...} ] } One of my colleagues ...
2
votes
2answers
212 views

Best pratice for return json in a REST application?

I'm starting now with REST (using Laravel 4.2) and Mobile (Android, iOS, SP, etc.) applications. Initially I'm checking if the request is ajax/json and then return a json response. But this ...
0
votes
0answers
31 views

Error messages from Web API, should I use error codes? [duplicate]

I'm developing a Web API. Error messages that are returned from my controllers are currently being displayed directly by the consumer applications. I want to change it so that the consumer is ...
1
vote
1answer
87 views

REST API Structure

I have a REST API that looks something like the below where a person can belong to an organisation (but doesn't have to) and a person has many items. The items may also belong to the organisation ...
1
vote
0answers
31 views

API Server Client Setup

Suppose you have a setup where there is an API Server and all interaction revolve around the API. There is the admin, public and third party components that interact with the API server. Suppose we ...
4
votes
5answers
884 views

Paranoid Encryption

Call me paranoid, but I really like to keep my stuff secret, but readily available on the cloud. So, asking this question. How safe and reliable is encryption software (e.g., truecrypt)? The reason ...
6
votes
3answers
595 views

Deprecate a web API: Best Practices?

Eventually you need to depreciate parts of your public web API. However I'm confused on what would be the best way to do it. If you have a large 3rd party app base just yanking old versions of the API ...
2
votes
3answers
270 views

In Java, what are some good ways to separate APIs from implementation of *entire projects*?

Imagine you have a software module, which is a plugin to some program (similar to Eclipse) and you want it to have an API which other plugins can call. Your plugin is not freely available, so you want ...
2
votes
2answers
260 views

What is a good C++ API Design for HW registers?

I am designing an API for a driver that manipulates HW. I have done the following: namespace HWRegister { //private: namespace Data { //accessible only within this namespace ...
2
votes
3answers
595 views

design practice for business layer when supporting API versioning

Is there any design pattern or practice recommended for business layer when dealing with multiple API version. For example, I have something like this. http://site.com/blogs/v1/?count=10 which ...
0
votes
2answers
159 views

Good architecture for passing data to multiple APIs

I have a hypothetical scenario where I need to pass data to APIs from multiple different providers, depending on the 'vendor identity' provided by one of the pieces of data. If I have the data as ...
1
vote
1answer
158 views

Architecture of large-scale API (User Management)

We are currently designing an API that will hide different services (Product, Content, User etc) that will be used by our own website, our own apps etc. It is not a public API. We are looking into ...
0
votes
3answers
293 views

Why do APIs generally consist of interfaces? [duplicate]

I am starting out in Java API design and in reading existing code bases, I have found that most APIs consist of interfaces only with their implementations bundled in a different package. Having read ...
0
votes
0answers
28 views

API providing function to be run in a thread vs. thread that runs this function

I'm writing a Python library which exposes a certain event listener interface. The user can register callbacks to handle different types of events. There is also a function which handles the actual ...
1
vote
1answer
67 views

What is the argument for singular nouns in RESTful API resource naming?

I understand that when naming RESTful URI's it is commonly accepted to use plurals to represent collections of resources. I am curious as to the argument for using singular nouns instead.
1
vote
1answer
91 views

Software development based on a reference implementation [closed]

Lets say I have library "A2" as a dependency in a project. Library "A2" is derived from library "A1"(A2 is a fork of A1 with some modifications to the original source code) where someone has done few ...
20
votes
2answers
2k views

Should one always know what an API is doing just by looking at the code?

Recently I have been developing my own API and with that invested interest in API design I have been keenly interested how I can improve my API design. One aspect that has come up a couple times is ...
1
vote
1answer
47 views

Is it RESTful to resume terminated POST operation on a GET request?

I have a RESTful API, one of the resource has a state that is determined collectively by multiple servers, not all of them belong to us. One of the operation on this resource will have to modify the ...
0
votes
1answer
83 views

Which approach would lead to an API that is easier to use?

I'm writing a JavaScript API and for a particular case, I'm wondering which approach is the sexiest. Let's take an example: writing a VideoPlayer, I add a getCurrentTime method which gives the elapsed ...
0
votes
1answer
211 views

Should I use my own public API on my site (via JS)?

First of all, this question is far more different other 'public api questions' like this: Should a website use its own public API?, second, sorry for my English. You can find the question summarized ...
2
votes
1answer
143 views

Website as an API client vs using the API only when needed?

I'm developing a website (using Django) which will depend on an API for it's main functionality which is create/update/delete objects. But the API also provides: User sign up and login User ...