Application Programming Interface (API) Design discusses best practises for creating libraries intended for general purpose or public use.

learn more… | top users | synonyms

4
votes
1answer
348 views

Data service API design

We're designing a data service that will store a large number of statistics about stocks, including historical data. The client will be a web application, which will need to pull various bits of data ...
7
votes
1answer
426 views

How To Handle Login For An Unofficial API?

I am building a tool to access some data on a site (Fitocracy) and I would like to turn it into an unofficial partial API, as no official API exists. If you are not logged in, you cannot get access ...
2
votes
1answer
1k views

HTTP PHP Authentication and Android

I am working on a website for which I hope to have an application for as well. Because of this, I am creating PHP API's which will go into my Database and serve specific data based on the ...
5
votes
3answers
310 views

How do I assess tradeoff between robustness and “lazy” code in API design?

Postel's law: Be conservative in what you do, be liberal in what you accept from others. "Lazy" code (per The Pragmatic Programmer): Be strict in what you will accept before you begin, and ...
2
votes
3answers
721 views

One or many RESTful APIs for large company?

I work for a large company which has several non-RESTful APIs. I am tasked with building a web application to interact with these APIs. Each API handles and provides very different business processes ...
2
votes
4answers
527 views

Should an API platform enforce only receiving JSON requests?

I am building an API platform. I have already ensured that the platform always returns JSON responses. My question is Should my API platform enforce the rule that all requests must be JSON? What ...
1
vote
2answers
192 views

What's the term for re-implementing an old API in terms of a newer API

The reason for doing it is to solve the case when a newer API is no longer backwards compatible with an older API. To explain, just say that there is an old API v1.0. The maker of this API decides it ...
1
vote
1answer
514 views

Securing Back End API for Mobile Applications

I have an application that I am writing for both iOS and Android; this application will be served by a ReSTFUL API running on a cluster of servers on "the internets". I am curious how the rest of the ...
1
vote
1answer
631 views

Designing A 2-Way SSL RESTful API

I am starting to develop a WCF API, which should serve some specific clients. We don't know which devices will be using the API so I thought that using a RESTful API will be the most flexible choice. ...
0
votes
3answers
1k views

Web API design best practices - having many (similar) operations

I have a web service (axis2) and the server performs 4 primary operations: createX, removeX, getX and updateX Where X is represented by a combination of 4 values: id1, id2, id3 and id4 So, to ...
3
votes
1answer
172 views

What are some good Photo and Artwork APIs?

We had an idea for starting a ecards service and were looking into the possibility of populating our site using photo/artwork APIs. Due to legal reasons, Flikr probably won't work, although I've ...
33
votes
3answers
6k views

What's so bad about the DOM?

I keep hearing people (Crockford in particular) saying the DOM is a terrible API, but not really justifying this statement. Apart from cross-browser inconsistencies, what are some reasons why the DOM ...
5
votes
9answers
405 views

Populate fields or return object

What is better to do in this type of scenario: populate fields or return an object? The situation is like this: I'm doing calculations to find the prices (inc tax, ex tax, discounted etc) of a ...
1
vote
1answer
318 views

Request / Reply , how should one initiate the actual sending of the transmission?

I'm working on Language level interfaces to web API's. These libraries are of course built around existing HTTP Request/Reply interfaces. I see myself as having a few options submit method on the ...
3
votes
2answers
570 views

“Invalid operation” status code in a HATEOAS REST API

In a HATEOAS API links are returned which represent possible state transitions. A conforming client should just be retrieving and following those links, but if a non-conforming client is constructing ...
10
votes
2answers
315 views

Is the 'Law of Demeter' applicable to public/API method signatures?

Given that changes to the API/public method signature should be minimal to prevent breaking those client codes that use these methods, I was wondering if the Law of Demeter is less applicable to ...
3
votes
3answers
411 views

API method placement guidelines?

Are there any guidelines for placing methods in API when the placement isn't obvious? Example: I have classes A and B and a method X. The work being carried out can be phrased in two ways: A does X ...
3
votes
7answers
364 views

Better name for existsByUserNameAndPassword()

I wonder if there is a better name for a DB API function called existsByUserNameAndPassword() which returns boolean. There are more function called like this: existsByOldId()... It sounds a little bit ...
3
votes
1answer
121 views

How should I deal with external data sinks?

I recently took on a contract job that will largely involve generating data feeds from my client's data and sending it to external partners, via feeds and API invocations. I've always found this ...
5
votes
1answer
830 views

Sending a collection of data to an API. Multiple small calls vs one big call

I am currently creating an API and implemented a few basic REST actions such as get, update, search etc. Another program that collects data needs to synchronize these to this API. My current thought ...
2
votes
2answers
99 views

How should XML subtree manipulation be handled in a public API?

I'm working on an API whereby a specific call would replace a subtree of an XML document—rooted at some element—with another subtree. The two options I'm considering for a response to this call are: ...
5
votes
3answers
324 views

Should I provide synonyms in an API?

I'm designing a small library and there is a strong temptation to provide synonyms to some of the exported functions. var foldl = function(){ ... }; var reduce = foldl; //reduce is a synonym for ...
4
votes
1answer
776 views

Mask oAuth API key and token for pure client-side technologies

If I were to build a Twitter or Facebook application using pure client-side technologies like HTML and javascript, how would I mask/hide my API keys? For example, for Twitter I have consumer key and ...
4
votes
3answers
259 views

Creating a webservice API - how much “credit” should I give the client/developer

When creating a web service API, how much should I count on the developer to act by my rules? We are really aimed on creating an API so the developers shouldn't develop client side logic too much... ...
13
votes
3answers
6k views

Is there a list of common usernames to reserve in a new system?

I need to reserve usernames in my new website. These generally fall into three categories 1) usernames no-one should have (eg: admin, user, service, help, root, etc) 2) names of super famous people ...
2
votes
3answers
466 views

Creating public API definition for existing application

Let's say there's a successful open source application (written in PHP if it matters), which provides its users with multiple ways to extend it (think about something like Drupal or Wordpress, lots of ...
1
vote
1answer
172 views

How do you deal with errors in enumeration / list processing (lowish-level API)

Ive struggled with variants of this problem many times, experimenting with different solutions, happy with none. Abstract: Enumerating a list of items, an error for one item does not affect the ...
0
votes
3answers
1k views

API design pitfalls in C

What are some flaws that drive you nuts in C APIs (including standard libraries, third party libraries, and headers inside of a project) ? The goal is to identify API design pitfalls in C, so people ...
1
vote
4answers
220 views

API naming and namespacing

Is it right or more beautiful to name the functions with an prefix, like in Qt? Or using "many" namespaces, but 'normal' names for functions? For example, slOpenFile(); //"sl" means "some lib" vs ...
3
votes
2answers
420 views

Strategy for designing a plugin API

I am working on an application for which a rich plugin API is crucial. What is the best process for creating an API that is intuitive and easy to learn?
16
votes
4answers
438 views

Database abstraction — is it being overdone?

After being exposed to numerous database abstraction layers, I'm starting to wonder what the point is of every library inventing their own different paradigm to access data. Picking up a new DAL feels ...
5
votes
1answer
498 views

Application internal API

I am currently building a small python CLI (Command Line Interface) application with ambition. In the first development phase I would concentrate on making it work through the CLI interface only, but ...
3
votes
5answers
185 views

Consistency vs. Usability?

When designing an API, consistency often aids usability. However, sometimes they conflict where an extra API feature can be added to streamline a common case. It seems like there's somewhat of a ...