Tagged Questions

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

learn more… | top users | synonyms

2
votes
2answers
48 views

RESTful key-value collection

I am creating a HTTP REST API. I have a large collection of key-value pairs, at /base-url. I need to provide the ability to get and set values for a key. My first attempt: GET /base-url/{key} PUT ...
3
votes
1answer
83 views

the better url for a API: /api or api [on hold]

when you make a API, what is a better practice ? http://webapp/api or http://api.webapp/ why ? I started with the API in http://webapp/api and the description of the service in http://webapp. ...
-1
votes
0answers
12 views

need UI and Service both [closed]

We need to create website UI and also expose service for some parts of project which is to be consumed by other clients . For website UI we are using MVC . Website will need service for its UI and ...
2
votes
3answers
172 views

Is a bad choice to consume the REST API also from the back-end?

Using a REST API for front-end code is a desiderable and quite common practice. However, I was wondering if using it also for the back-end could be a good choice. What I mean is leaving the burden of ...
-2
votes
1answer
95 views

Using a REST API for both mobile and web [closed]

I've always only used REST to build web services for mobile apps, for example i use Django to build the website using templates, and build a REST API using django framework, but would it be a good ...
-2
votes
0answers
22 views

What is the difference between SDK and API [duplicate]

Few things I know: SDK stands for Software Development Kit and API stands for Application Programming Interface. If you want to develop an application or software you need SDK because it contains ...
0
votes
1answer
61 views

how will my api interact with Ejabberd?

I am working on backend of chat application that provides services to Android,iOS and Web application. To keep everything central,I have created web services which allows apps to read and write data. ...
2
votes
3answers
163 views

How was the system clock first used in early computers?

This question is about the clock that keeps current time, not about the signal that sequences the circuitry (the wall clock, not the metronome). First computers were pure calculators, just very ...
0
votes
1answer
31 views

Plugins and exporting an API between python scripts

I've got a python script, which should read a subdirectory and make all the scripts within it callable like this: python mainscript.py subscript arguments I've figured out most of the details but ...
-1
votes
2answers
120 views

What was used to consume api's before webservices? [closed]

Most of the companies that offer public api these days do it through a web service. What was used before web services were popular? For example, if a company wanted to release a c# public api would it ...
2
votes
2answers
118 views

Designing an API with access tokens, how to handle GET requests?

I am building an API that will utilize access tokens so that I can track usage among various departments and for access control. My plan is to utilize the HTTP verbs appropriately - GET will retrieve ...
4
votes
2answers
147 views

How to prevent third party misuse of what is intended to be a private api (avoiding what happened to Snapchat)?

I have never used Snapchat and do not intend to but I have been reading up about what happened to them with respect to the recent media coverage about pictures being leaked especially because I am ...
0
votes
0answers
21 views

Add new/modify existing callback to/in API

I am working on a common API for a user interface. My colleagues use this framework in all their projects, but the UI is not our main aspect here, so the knowledge of the UI framework is somewhat ...
1
vote
1answer
96 views

Server side or client side mvc: which approach imposes less load on the server?

Which is the best approach when developing a dynamic web app with multiple views and dynamic content. regarding server load and responce times: use a server side mvc (such as Sailsjs or ASP.NET MVC) ...
0
votes
0answers
79 views

REST API + “Micrososervices” boundaries

I have a REST API. The fundamentals of the API takes care of two things. Authentication Routes Let's say I was about to do a small service (microservice whatever...) next to the API and have it ...
0
votes
1answer
53 views

How to host a web service with dependencies on many APIs/SDKs which expose methods in different languages

A project I'm working on currently depends on several SDKs and APIs that perform identical tasks, but for different external products. For example, in an Internet of Things world we have a common ...
2
votes
2answers
60 views

API to get data, caller may not know how much? How to allocate buffer size

I am writing a C API for retrieving data from a hardware device. The data will be returned as a string with approximately 30 bytes of text per item. The problem is there may any number of items. ...
0
votes
0answers
50 views

How to scrub Twitter and Facebook posts for many users

I'm making an Rails app that in theory should scrub new posts from the users facebook and twitter accounts and put them in a timeline for an analyst to analyze and determine if they are good or bad ...
5
votes
2answers
441 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 ...
2
votes
1answer
157 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 ...
0
votes
1answer
80 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 ...
1
vote
1answer
103 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 ...
0
votes
1answer
270 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
112 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 ...
0
votes
1answer
128 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
3answers
123 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. ...
9
votes
4answers
557 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 ...
1
vote
0answers
93 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 ...
5
votes
4answers
574 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
4answers
406 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 ...
3
votes
1answer
84 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
251 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
33 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 ...
2
votes
0answers
33 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 ...
5
votes
3answers
319 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
436 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 ...
0
votes
2answers
165 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
181 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 ...
1
vote
1answer
90 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 ...
0
votes
3answers
306 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 ...
2
votes
2answers
262 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 ...
0
votes
0answers
29 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
90 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
94 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 ...
1
vote
2answers
296 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 ...
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
50 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 ...
4
votes
1answer
243 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 ...
0
votes
1answer
84 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
225 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 ...