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

learn more… | top users | synonyms

3
votes
1answer
648 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 ...
2
votes
1answer
191 views

Is there a design pattern to handle construction of complex objects with a [1 → 1..*] multiplicity relationship?

I have two classes (A and B) that are both complex to construct, with multiple properties that must be validated at construction time. I want to use the Builder pattern to construct these objects, but ...
1
vote
1answer
78 views

Polymorphic constants in Java

I am designing some polymorphic code to perform mathematical operations. The idea is to abstract out the underlying representation of the data, as different use cases require different representations....
1
vote
1answer
47 views

Class access modifiers on tested implementations

Suppose you're writing an interface that's suppose to be your public API, let's call it Session. It's implementation is called SessionImpl and it's going to be injected by your DI framework. I'm ...
1
vote
0answers
17 views

Storing OAuth2 data in Mongo?

Our system has users but we want to perhaps allow some users to be able to use our API service. I'm looking at using OAuth2 for authorization. As it's going to be (trusted) machine-to-machine access I ...
1
vote
0answers
63 views

How do I write an API that makes use of many smaller APIs?

I have a solid set of classes that do the following build tables from data and templates advanced form serialization build forms from data and templates launch overlays with forms/wizards short poll ...
1
vote
0answers
48 views

Why Does JavaFX's GridPane Attach Properties of the Layout to the Components?

I am currently learning JavaFX and I came across a very strange API for laying out GUI components. It is perhaps best explained by it's javadoc: To use the GridPane, an application needs to set ...
1
vote
0answers
40 views

Should I use RFC 2119 in interface documentation?

RFC 2119 defines several terms, including MUST, SHOULD, and MAY, for use in standards documents, particularly those relating to networking protocols such as IP and HTTP. These terms are widely used ...
1
vote
0answers
50 views

Design API for placing orders with differing parameters

Our customer wants to unify his ordering system, so that all of his end-customers can use one single website to place orders. The planned site will use web services to place the order in one of ...
1
vote
0answers
63 views

Is it OK to use mongodb's query object format as a parameter for my api?

I am designing an api that can give developers read-only access to a large dataset. The data is stored in a mongodb database. All the results of the api, will basically either be a count of matches ...
1
vote
0answers
68 views

Alternatives to setting up an API system

I want to launch a service that could support integration by third-parties. Unfortunately it’s way out of hand to build an entire API by now. Here’s my question: Would there be any possible solution ...
1
vote
0answers
157 views

Securing a private API used by an iOS App

I have an app that uses an API server and I do not want to have anything other than it to be able to use that API. I know this isn't totally possible, but I want to do what I can. I don't think my ...
1
vote
0answers
79 views

How to design an interface for two similar but distinct objects

I'm designing an API for a JavaFX control to be submitted to the ControlsFX library. This control is called the ViewManager, and its purpose is to hold a collection of View instances, all of which ...
1
vote
0answers
62 views

Django API design

I recently followed the Django API tutorial. http://www.django-rest-framework.org/tutorial/6-viewsets-and-routers/ When I initiate a POST request my intent is that after inserting the record into ...
1
vote
0answers
57 views

Individual methods or parameters for Google Analytics abstraction on Android

A coworker and I are having a discussion around the best way to build our abstraction on top of Google Analytics for an Android application. A couple of data points. We have auto-tracking enabled ...
1
vote
0answers
283 views

How can I use protected Tastypie resources within Angular?

I have a working Django 1.7 project with an API (Tastypie) made available for mobile clients (ApiKeyAuthentication). I am using Angular with Chart.js, and so I need to GET some queryset using $http....
1
vote
0answers
38 views

Posting different-shaped json documents to the same resource in an API

Is it a good idea to create an API in such a way that clients can post different shaped JSON documents to the same Resource? Let me give you an example and and explanation to why I am asking this. I ...
1
vote
0answers
43 views

Online error reporting without network access

I have developed an application for android requiring no permissions, but the biggest downside of this is that I don't have error reporting. So, I was playing around for the past week with any ...
0
votes
0answers
17 views

Volley with AsyncTask

I'm developing an Android library so that other apps would use, which is a kind of an API 'driver', to be used with an external services API and contains also UI components. On most of the requests ...
0
votes
0answers
15 views

Using JWT over Oauth2.0

I am creating an API that will communicate with a ReactJS app. I am in two minds whether to go through with the implementation of OAuth2.0. The question is why should I use OAuth2.0 implicit grant ...
0
votes
0answers
91 views

How to limit api calls

I have following APIs in Node and I use Angular to consume the API. Each user is restricted to 100 news item. GET /news --> Get all the news GET /news/:id --> Get news with the id POST /news --&...
0
votes
0answers
35 views

How to manage Permissions for an api

I have a question about permissions and roles in an application. Let's assume app.get("/users",hasPermission("user:read"),...) and I have a lot of these calls and then a lot of permissions. How do I ...
0
votes
0answers
52 views

Looking for pros/cons on using OWIN vs. a simple hand-rolled token based auth

We are wanting to implement an API to be used internally and externally and add it to our solutions. Some environment notes: We are currently using VS2013, .Net 4.5, EF5, SQL2008, MVC4, C#, and asp....
0
votes
0answers
22 views

Relying on file hash for data synchronisation across mobile and server

Imagine a client-server app that lets user upload images/documents etc. to server and then lets users who have access, retrieve and view them later on their respective mobile devices. So the flow is ...
0
votes
0answers
27 views

Should an API specification include roles?

I'm considering options for specifying an API in a code library (e.g., XML or JSON) that can be consumed by various clients. In addition to the standard kinds of input/output specifications, I'm ...
0
votes
0answers
148 views

Qt / C++ internal API design for slightly similar web services

in my application I provide a Qt/C++ wrapper to certain web services based on the Danbooru software. Basically the API wraps a series of REST calls and produces / parses the JSON responses to display ...
0
votes
0answers
135 views

Design pattern - update join table through REST API

I'm struggling with a REST API design concept. I have these classes: user: - first_name - last_name metadata_fields: - field_name user_metadata: - user_id - field_id - value - unique ...
0
votes
0answers
77 views

API Design when modifying resource data based on user roles (access levels)

I'm trying to figure out the best (and most RESTful) way to handle user roles in regards to the data returned. For example, for a resource named user, we only show obfuscated_id to regular users and ...