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

learn more… | top users | synonyms

0
votes
3answers
178 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
708 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 ...
1
vote
4answers
329 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. ...
1
vote
3answers
298 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 ...
2
votes
2answers
382 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
386 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 ...
2
votes
1answer
97 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 ...
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
1answer
160 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
1answer
495 views

API Wordpress & Inksoft

I am new to this whole website design and API bit. My husband has bought a license for the program InkSoft. Their site does not offer very much customization, so we decided to buy a Wordpress.org site ...
0
votes
1answer
118 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 ...
0
votes
0answers
39 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 ...
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
2answers
137 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
147 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 ...
1
vote
1answer
210 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 ...
-1
votes
2answers
557 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 ...
1
vote
0answers
175 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 ...
3
votes
2answers
312 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 ...
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 ...
6
votes
2answers
353 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 ...
1
vote
2answers
185 views

Returning view code in an API response

I have an API that returns a JSON formatted array of users within a given pair of lat/ long bounds. I'm using this data to plot a number of markers on a map, based on the location of each user. I ...
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 ...
2
votes
2answers
519 views

When using your own API (Dog Fooding). How do you avoid giving away the secret key?

I read this article on soundcloud's api: http://backstage.soundcloud.com/2011/08/soundcloud-mobile-proxies/ It talks about consuming your own API. What I don't understand is how they avoid giving ...
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: ...
2
votes
1answer
196 views

Is it legal to imitate how an API looks? [closed]

I want to make an open-source graph thing which looks and behaves very similarly to Google Visualization API, but it would be based on Flot. Is this legal, or must I not imitate Google Visualization ...
3
votes
2answers
221 views

What is the appropriate approach to study an api when it is not well documented and there are no good tutorials around?

I am a student and I like to develop applications at my own level. While building an application I am the only one in my team. After analyzing the application I choose a library/api to use for the ...
3
votes
1answer
117 views

Modelling REST endpoints with data that not all users have access to

I am trying to figure out the best way around a small problem i have with a design for a Hypermedia API i am currently building. I have a notion of a site, very simple doesn't have much going on and ...
9
votes
6answers
487 views

Is it better to have one method that takes a bool as a parameter or two methods with different names? [duplicate]

I'm writing a factory class for a Selenium Web Driver and I came across a choice that I couldn't figure out which is cleaner. Having two methods with the same parameter. GetWebDriver(string browser) ...
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 ...
86
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 ...
5
votes
1answer
2k views

What is the proper way of nesting resources in REST model?

I'm designing a REST API of service and got stuck on proper way to nest resources. Resources: partners, tickets, settings Connections between resources: partner has many tickets, partner has set ...
5
votes
1answer
2k views

API Authentication, One time token VS Dynamic tokens

We are working on a new project, we are two lead developers and got on a cross road on how to use a token to secure the communication between the server and the client : First Suggestion : (The one ...
4
votes
1answer
2k views

What is the general format of a Software Design Specification?

I'm trying to document a piece of software I wrote in detail. An SAS is too high level and doesn't cover the API. I found several examples of an SDS online, but I don't see a trend in their format. ...
1
vote
2answers
206 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) ...
0
votes
3answers
408 views

When there is no API

When it is necessary to integrate with a web application, and an API is unavailable, is it a viable solution to simulate a web browser interacting with the web application as a real user would ...
8
votes
5answers
3k 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 ...
4
votes
3answers
638 views

Best Practice: Should error messages be handled by the API or by the App?

I am designing an application that interacts with a RESTful API. When returning error messages like Unable to sign up user Should the error message be generated by the app? or by the API? I am ...
-3
votes
2answers
248 views

API for Hotels and Flights [closed]

I want to implement Hotels and Airlines in my web application.People will come and will search for hotels and airline's tickets and will compare result. What are the ways to get these informations? ...
7
votes
2answers
2k views

What does it mean to “expose” something?

So I am working on creating a Google App Engine Application, and I've come across the term "expose" a number of times, e.g. "your first app can expose objects using an HTTP based API" and "expose this ...
20
votes
8answers
5k views

When to use HTTP status code 404 in an API

I am working on a project and after arguing with people at work for about more than a hour. I decided to know what people on stack-exchange might say. We're writing an API for a system, there is a ...
0
votes
1answer
96 views

Implementation details of database synchronisation API

I want to achieve a database synchronisation between my server database and a client application. The server would run MySQL and the applications may run different database technologies, their ...
3
votes
3answers
249 views

RESTful applications logic and cross resource operations

I have an RESTful api that allows my users to receive enquiries about their business e.g. 'I would like to book service x on date y. Is this available?'. The api saves this information as a resource ...
1
vote
1answer
166 views

What is the process or term for viewing HTML/CSS using localhost?

I have recently used some software, which come as a regular setup file, where you install your software, and then when you run it, opens the browser, uses the localhost with some specific port number ...
7
votes
4answers
785 views

Building a web application that is almost completely rendered by Javascript, while back end only delivers Json. Do or don't?

As a programmer, and taking into account the overall "funness" of the process, I'm tempted to start a project in Sinatra where the back end's sole concern is the logic, and returning a Json API, and ...
2
votes
1answer
102 views

Should I provide client libraries in some select languages along with the APIs themselves?

Say I have created a web service based on RESTful APIs. Does it make sense to also provide users with a client library for the API in some select languages which are likely to be the most used ones? ...
0
votes
2answers
583 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 ...
13
votes
5answers
594 views

In API design, when to use/avoid ad hoc polymorphism?

Sue is designing a JavaScript library, Magician.js. Its linchpin is a function which pulls a Rabbit out of the argument passed. She knows its users may want to pull a rabbit out of a String, a ...
1
vote
3answers
693 views

How to get different resources in a single endpoint in RESTful?

I have a REST webservice that have a couple of resources, like Company and User. But now I need to make a modification to the API to return a special list combining company, user and maybe other type ...
1
vote
0answers
59 views

What are the benefits of having a remote database for your command line utility

I'm current working on a command line app that will grab resources online for you when you're setting up a new project locally. Right now all the urls for the resources I need are hardcoded into the ...