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

learn more… | top users | synonyms

21
votes
7answers
1k views

How do I manage a very large set of rules and magic numbers in my program?

I'm somewhat new to programming (I'm a mechanical engineer by trade), and I'm developing a small program during my downtime that generates a (solidworks) part based on input from various people from ...
0
votes
1answer
110 views

Use global variables or methods in an API's frontend

I am currently designing a graphics library in Java and now it's come to making the frontend I am curious why I have never seen libraries using global variables for their settings/properties - in-fact ...
4
votes
3answers
194 views

Establishing an API to provide end-user apps/scripts access to multiple types of databases

Question and Context I am currently working on a project where the main question is, how do we insert an API between the database and end-users who may develop applications/scripts of their own that ...
0
votes
3answers
56 views

Three approaches for obtaining different sized versions of an image from the server

My android app needs different sized versions of images for different purpose and bandwidth preservation. Approach one: when the user uploads their avatar or another image, my php script creates 4 ...
0
votes
0answers
189 views

Rest Api Client response handler

I have two instances of Laravel: Rest Server API and Rest Client. Let's say I want to display list of positions on the front page. I'm making request to my Server API from my client controller: ...
6
votes
2answers
1k views

Best way to hide API key in source code

I need some ideas on how to protect a private API key in an application, specifically in a c# .NET application. Firstly, I understand that it is theoretically impossible to hide anything in the ...
20
votes
4answers
15k views

Web api authentication techniques

We have a asp.net MVC web service framework for serving out xml/json for peoples Get requests but are struggling to figure out the best way (fast, easy, trivial for users coding with javascript or OO ...
1
vote
2answers
117 views

Maintaining independence between modules

I am reading Algorithms 4th Edition by Robert Sedgewick and in chapter 1.2 it discusses API design. It says: "The key to success in modular programming is to maintain independence between modules. ...
0
votes
2answers
88 views

How to manage potentially outdated data from WikiMedia API

I am writing a web application that pulls small parts of articles from Wikipedia and presents them to users. I do not wish to delete entries of the articles because I do not want to be sending a ...
0
votes
0answers
34 views

I have URL and ID pairings, and I send the URLs to an API which it returns in no specific order. How should I pair them back up?

This is a programming problem that I haven't came across yet and I want to make sure I'm tackling it in an efficient manner. I have an array of dictionaries, with each dictionary consisting of a ...
3
votes
3answers
750 views

How to optimize calls to multiple APIs at once and return as one set?

I have a web app that searches across 2 APIs right now. I have my own Restful web service that I call, and it does all the work on the backend to asynchronously call the 2 APIs and concatenate them ...
0
votes
1answer
277 views

Is api user authentication with oauth possible for both email/pw and 3rd party services

I have an api only application (rails-api) and I'm looking to authorize a user on both email/password or 3rd party services like facebook or twitter etc, so I know I will have to use Oauth at some ...
2
votes
2answers
192 views

Are the IETF BCP 47 language tags defined as enums anywhere in JDK?

Are the IETF BCP 47 language tags defined as enums anywhere in JDK? For Locale.forLanguageTag() we pass values like fr-FR, jp-JP etc. Are there any enums already provided by JDK for it? Or should ...
1
vote
1answer
230 views

Who is responsible for updating the Java API and how can other individuals contribute?

I made a search on google to find out who are the people in Oracle responsible for updating the Java API in other words who are those responsible for adding new classes and methods to the API and ...
1
vote
2answers
70 views

Auto Transaction Failsafe's, Third Party API's, Coldfusion Schedule Files

I have an automated invoicing web app and I'm trying to build in some failsafes and a structure that will, under no circumstance, allow an invoice to be double charged. All things working perfectly, ...
2
votes
1answer
95 views

What is the most elegant way to handle a loop between two systems integrated remotely by webhook events?

So I'm developing this small engine that does a remote integration between two systems in order to sync data, both systems have webhooks for create & update events, and both have APIs (one is REST ...
2
votes
3answers
467 views

Payment Gateways and RESTful API

I have a RESTful API that offers eCommerce functionality. One area I'm struggling to decide on the correct implementation is how to process payments. Lets say I have the following URI GET ...
1
vote
1answer
521 views

Return values for CRUD methods?

I'm writing a basic web API in Java that does what almost all others do: take input, validate it, then do CRUD operations on the DB. I've written several APIs before, and I've pretty much already ...
4
votes
3answers
411 views

Which is better API: table.add_row() or table.rows.add()?

I'm writing a library to create and manipulate Word .docx files in Python. In general, I take a lot of influence from the Microsoft VBA/C# API for Word in designing the API, figuring they've given it ...
10
votes
1answer
470 views

How discrete should a RESTful API be?

I've never built a RESTful API before and I am wondering how discrete should it be? For example lets say I have a customer which has a name, address, phone number, email address, language, etc. Does ...
0
votes
3answers
165 views

Is it OK to use email as an identifier in a RESTful URI?

I'm working with a team building a RESTful web service, and our current implementation utilizes the user's email as a unique identifier for the user resource, yielding URIs like the following: ...
3
votes
2answers
671 views

Should I return Collection or ImmutableCollection from a method?

When writing an API in Java, returning an immutable collection of some sort, I've got the option of returning Collection (or List, Map, etc) from the method, or guava's ImmutableCollection (or ...
22
votes
4answers
842 views

Prefer examples over documentation. Is it a behavioral problem?

Whenever I come across a new API or programming language or even simple Linux man pages, I always (ever since I remember) avoided them and instead lazily relied on examples for gaining understanding ...
1
vote
3answers
287 views

is using a PUT with side affects acceptable (REST)

I want to create an undo history whenever the user updates a form. Because it's an update, I want to use a PUT request. However, I read that PUT needs to have no side effects. Is it acceptable to ...
83
votes
10answers
6k views

Strategy for keeping secret info such as API keys out of source control?

I'm working on a website that will allow users to log in using OAuth credentials from the likes of Twitter, Google, etc. To do this, I have to register with these various providers and get a ...
1
vote
4answers
315 views

Should timeout be a public static property or a parameter to every function?

TLDR: Should TIMEOUT be a public property on my static class, or a parameter to every function? Background: I am releasing a c# client-api library that facilitates communicating with our REST api. ...
8
votes
2answers
259 views

event listener pattern in api - what should adding the same listener twice do?

In designing an API that provides an event listening interface, it seems there are two conflicting ways of treating calls to add/remove listeners: Multiple calls to addListener will only add a ...
2
votes
1answer
275 views

HG: fork web app project to separate API code from app code [closed]

I have a web app thats been in active development for about 8 months now and its becoming apparent that the project has a need to maintain a separation between app specific code and our OO Javascript ...
2
votes
2answers
368 views

How to organize methods that check username/email availability in a REST API?

I am developing a RESTful API in my project, but I do not have experience on that. To fill these gaps I've been watching some videos, mainly from Apigee, which are great. One situation brings a lot of ...
5
votes
3answers
355 views

How to represent (enum) types in a public API

I am working on a simple API that I want to use for my own client, and to open to the public in the future. I have "Item" objects which can have different "types". The type is a C "typedef enum", for ...
0
votes
1answer
115 views

Technique to deal with occasionally blocking json api?

I have a web app that occasionally (after some idleness) will block a very simple request for small chunks of data (30~50 kb) up to 20 or so seconds. Assuming I can't refactor or modify the API, is ...
7
votes
5answers
5k views

How best do you represent a bi-directional sync in a REST api?

Assuming a system where there's a Web Application with a resource, and a reference to a remote application with another similar resource, how do you represent a bi-directional sync action which ...
0
votes
2answers
577 views

How my website should use its own API?

Im building small web-service which will provide my users with data through API. Also, some data will be available right on my website. The question is about how to use my own API? Should my website ...
3
votes
4answers
787 views

PHP - Internal APIs/Libraries - What makes sense?

I've been having a discussion lately with some colleagues about the best way to approach a new project, and thought it'd be interesting to get some external thoughts thrown into the mix. Basically, ...
-1
votes
1answer
159 views

A good way to learn a language and fully understand its features and classes is to try all methods in the API [closed]

I have an idea that to learn a language (i.e. Java)I need to try all methods from language's API; i want to try to use methods from its API. is this a good idea? there are 10 000 methods in Java API. ...
0
votes
0answers
38 views

Which timeout should I set to an external service?

This service is a remote session pool. I need to ask for a session to work with other services. In most cases, this pool will have a session available, so in 15ms I will have a response. But ...
1
vote
2answers
136 views

Where in computer science education does “reuse and integration” find comprehensive coverage?

This intro is only my naive attempt at a mile-high snapshot helping me to position my question. Any user trying to answer my question, that tries to nail down one aspect of programming, will have to ...
3
votes
1answer
145 views

What are the best practices and pitfalls of doing a JS app powered purely by RESTful API? [closed]

We are starting to build a new app and I would like to explore the idea of doing a thick JS client (backbone / angular) with only RESTful API exposed by our application layer. What are some of the ...
3
votes
2answers
764 views

Guidance for Web XML Api's

I have to create an API for our application that is accessible over HTTP. I envision the API's responses to be simple XML documents. It won't be a REST API (not in the strict sense of REST). I am ...
-1
votes
2answers
545 views

SQL API instead of a REST API? [closed]

What are the pros and cons of exposing an SQL API instead of a REST API? Let's assume that this would be a private API – the API developer and user are on the same team. Probably the biggest problem ...
22
votes
10answers
2k views

API design: concrete vs. abstract approach - best practices?

When discussing APIs between systems (on the business level) there are often two different point of views in our team: some people prefer a more - lets say - generic abstract approach, other a ...
1
vote
0answers
163 views

How to bypass Oauth2 authentication when the client and resource owner is the same entity?

We are currently working on using an API provided by Mercado Libre which is a maket place for selling various goods. Their APIs use OAuth 2.0 for authentication. The problem is that OAuth 2.0 as ...
2
votes
3answers
168 views

Is it good practice to not filter values according to nullability?

Sometimes when I create an API that should enable getting a single value or all values I use the following pattern (passing NULL to the API, means get all rows): @Usernames - comma separeted list of ...
3
votes
2answers
296 views

Should a RESTful API provide data for an entire form?

Let's say I have a JavaScript web application which entirely uses a RESTful API for data. Let's say this application has a data form, and let's say I'm editing a record at /product/12345. When ...
31
votes
8answers
3k views

How can I write a set of functions that can be invoked from (almost) any programming language?

I'd like to find a way to write an API that can be accessed from any other programming language via language bindings (or some other framework). Is it possible to do this? If so, which programming ...
13
votes
3answers
14k views

How do web APIs work? [closed]

I have heard of many web APIs like that of Facebook, Twitter, etc., which helps third party access data and manipulate it. I would like to know how a web API works. What are the basics of a web API? ...
5
votes
2answers
333 views

Exposing domain models over API

I'm building a simple RESTful API for a web-based application I'm working on, and I'm wondering about the best way to go about exposing my domain models. Let's say I have a User class and I want to ...
76
votes
14answers
68k views

Why aren't more desktop apps written with Qt? [closed]

As far as I know and have understood in my experience with Qt, it's a very good and easy to learn library. It has a very well designed API and is cross-platform, and these are just two of the many ...
10
votes
1answer
1k views

Generate commercial license key for web service

Background I have a business question regarding web-based software licensing. A number of web sites offer software as a service for various APIs. A good example is Google's Custom Search API. The ...
1
vote
2answers
204 views

In my permissions API, how do I handle objects that don't exist?

Elgg is designing a permissions API loosely around the Activity Streams model. The user API could look (roughly) like: function elgg_can($capability, $subject = null, $object = null, $target = null) ...