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

learn more… | top users | synonyms

1
vote
1answer
29 views

Is hiding complexity from API clients by merging resources a correct practice?

So let's say we have three simple resources: Groups, Users, and GroupUsers. Groups - Represent interest groups which can be subscribed by users. { name: 'Colorado Mountain Biking Group' ...
-2
votes
0answers
19 views

R Twitter API - twitteR - Larger Radius Results in Less Tweets

I am trying to use the twitteR package to gather tweets from the Twitter API. However, it seems that the radius parameter for the geocode setting is behaving oddly. I would like to ultimately gather ...
0
votes
1answer
35 views

API authentication with a single ID

A typical API authentication usually rely on a pair of API ID + SECRET, my question is: if the API ID is unique and randomly generated and is considered strong enough (e.g. SHA512), why a SECRET is ...
6
votes
3answers
83 views

REST API design: POST (implicit userId) vs PUT (explicit userId)

For some routes on an API, like GET /news, one would asume the user only wants news that pertains to them, so the userId is implicitly taken from authentication info. However, some of the routes on ...
4
votes
5answers
489 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 ...
0
votes
1answer
36 views

Making API calls with celery

I'm designing a system for a client where the requirements are: they upload a JSON file (one object/line) make a call to an API with the JSON object as the payload record the state (success/failure) ...
2
votes
2answers
144 views

REST API Structure to request multiple items

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
1answer
173 views

Manage the persistence of entities on iOS in several places: CoreData on the device, iCloud and on a REST API

For the needs of a project, I would persist the datas contained in Core Data in several places depending on the state of the user. If the user is logged to my API -> Persist the datas on my API. ...
0
votes
1answer
49 views

API design for modular apps

Let's assume a web app made of independent modules: example.com/accounting example.com/employees example.com/admin Next step is adding an API which normally might end like this: ...
-2
votes
1answer
22 views

Fetch average likes per picture with instagram API [closed]

I would like to know if the Instagram API allow to fetch the "Average likes per pictures" on a specific profile so I can define the engagement rate of an instagram profile. If yes, Do the user have ...
2
votes
1answer
73 views

How can I stop echo feedback when making a streaming microphone device? [closed]

I am developing a microphone device of sorts that streams audio to a receiver device with speakers. A person speaks into the device, and the audio data is played on the speaker. Since the person is in ...
1
vote
1answer
44 views

Design consideration on JSON schema for an API

I have an API endpoint that retrieve data from 3 SQL tables on the server-side. At the moment, I do a SELECT with joins, consolidate/reorganize the selected data based on a JSON schema, and then send ...
1
vote
1answer
32 views

Documenting MVC JSON API

I've got an MVC5 application that we're using an a JSON API for various clients (mobile apps, other web applications, etc.) as well as a traditional web application. Controller actions that return ...
6
votes
5answers
737 views

Should functions of a C library always expect a string's length?

I'm currently working on a library written in C. Many functions of this library expect a string as char* or const char* in their arguments. I started out with those functions always expecting the ...
56
votes
5answers
4k views

Why were Java collections implemented with “optional methods” in the interface?

During my first implementation extending the Java collection framework, I was quite surprised to see that the collection interface contains methods declared as optional. The implementer is expected ...
3
votes
3answers
108 views

Is it better to make database calls or external API calls first in the context of a single Web request?

Say you have a Web app that uses data from both a database and an external API, and for certain pieces of functionality, you need to call in to both in order to read/write the necessary data. Is it ...
5
votes
2answers
228 views

Grouping and nesting of REST APIs

My question is around best practice of aggregating or grouping REST APIs. I have a scenario where there are many different vendors, data sources, etc. and I think grouping REST APIs would make a lot ...
23
votes
4answers
895 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 ...
2
votes
2answers
132 views

Technique to synchronize error codes in a same-project-API

In the project I am working right now, we have some python and some C# code. At some point, I call from python a subprocess which starts a C# executable. This C# code returns an error code, which has ...
10
votes
1answer
228 views

API key - in content or header

Working on an API at the moment and just wanted to gather opinions on where the best place to transmit the API key should be. I know that is shouldn't go in the URL, this leaves the request header or ...
2
votes
1answer
293 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 ...
8
votes
4answers
2k views

What is the need for 'discoverability' in a REST API when the clients are not advanced enough to make use of it anyway?

The various talks I have watched and tutorials I scanned on REST seem to stress something called 'discoverability'. To my limited understanding, the term seems to mean that a client should be able to ...
3
votes
2answers
157 views

Is embedding URLs as query parameters in URLs an acceptable REST API design pattern? [closed]

We are designing some resource oriented web services. Service B needs to be able to make calls to Service A passing in a reference to a resource in service B that service A will use when formulating ...
2
votes
1answer
137 views

How to use own REST API in web front end?

I have implemented a JSON-based REST API for a simple blog. The API allows for the creation, viewing, deletion and modification of user info, blogs, blog posts, comments, 'likes', etc. Some of these ...
46
votes
2answers
3k views

Why have hardware-accelerated vector graphics not taken off?

I'm working on an app that involves real-time manipulation of vector paths at 60fps, and I'm very surprised by how little information there is on the subject. At first, I tried to implement my idea ...
-1
votes
1answer
43 views

What tools are there to create/generate a full stack dev project? [closed]

I'm starting to develop a new project and I'm looking for a tool to generate all the needed layers for a full-stack dev project. I'm looking for a hello world generator that provides all the ...
0
votes
2answers
70 views

Difference between Throttling and Rate limiting in API Management [closed]

What is the difference between Throttling and Rate limiting in API Management?Suppose if we want to limit the number of requests for an API,we can choose Throttling.But why we need to go for Rate ...
0
votes
1answer
34 views

JSON schema design for variable response

I am drafting a JSON schema for an API. One of the responses aims to show all the updates to different properties of an given entity. The number of updates may vary from one response to another. For ...
5
votes
2answers
115 views

What is the correct project file structure for a versioned rest api?

Should I have resource directories inside version directory, like app/ v1/ book/ author/ v2/ author/ or version directories inside resource folder app/ book/ v1/ author/ ...
3
votes
0answers
94 views

License that encourages improvements to the original version rather than own forks? [closed]

I'm looking for a license that should encourage changes to my original open source rather than encouraging forks and uncontrolled random redistribution. This is because of the nature of the code; it's ...
1
vote
1answer
50 views

REST API, nested routes without providing identifiers at every nested level

Obviously a RESTful API could contain base routes such as: api/competitions api/competitions/{id} api/teams api/teams/{id} api/players api/players/{id} And nested routes such as: ...
0
votes
1answer
62 views

Vector API, naming for element-wise multiply [closed]

I'm helping develop a 3D Vector class, which has common operations such as: v = v1.cross(v2) v = v1 * v2 - infix multiply for dot product. v = v1 + v2 - infix addition. v = v1.slerp(v2) - spherical ...
2
votes
1answer
118 views

How do I write a REStful API's functional specifications?

I've been looking for answers about writing functional specifications for a software for a while now but I can't seem to find an answer to my specific case. I think I understand the difference ...
14
votes
6answers
1k views

What to call an HTTP API that is not RESTful? [closed]

What would you call an API that is HTTP-based, uses URI to name resources and HTTP verbs (PUT, POST, DELETE, GET...) to manipulate those resources? According to Roy Fielding's complaints it is not ...
2
votes
0answers
278 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 ...
0
votes
1answer
90 views

Can you refer to the callback function as an API?

A system design is decoupled into two layers say layer A and layer B. The interaction between layer A and layer B occurs through an interface that is exposed by layer B in form of an API. This ...
1
vote
5answers
103 views

How much data from a web service should I expose in a library?

I'm working on a personal project, a library that can access the weather forecasts and other weather related data from it. However, a lot of the returned data is sometimes quite redundant or simply ...
2
votes
2answers
96 views

Function naming design in a C Library

I'm writing a C (c99) library that operates on strings. I'm having a design problem writing functions that will perform in different modes. For example; the Find function can search for: the ...
2
votes
1answer
94 views

Is it bad to use POST only on an API?

I'm about to develop a new API for our website. Part of the design I've considered to use the POST and GET methods but after reading some security stuff I realise that GET is a bit less secure(i.e. ...
1
vote
3answers
59 views

Representing a “Belongs to” relationship in an API endpoint

Consider the following pseudo code models: class Post int Id string Title int CategoryId Category Category class Category int Id string Name Note that Post belongs to ...
0
votes
0answers
20 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 ...
1
vote
0answers
61 views

How to off load DB & API calls (PHP Heroku App) [closed]

I took over support for a PHP app that runs on Heroku. After analyzing the performance with New Relic, I'm noticing that the three bottles necks are the database and API calls to outside services. ...
1
vote
1answer
46 views

What is the idiomatic way in REST to handle field level permissions?

REST APIs conventionally expose resources addressed at the object level. While it's easy to do object level permissions using the appropriate HTTP responses, handling field level permissions is a bit ...
0
votes
2answers
444 views

Manage content for multiple websites and mobile apps

I need to manage content (pages, key/value list, assets and more) in one webbased system for multiple websites and mobile apps. My idea is to create a web api, secured with tokens for apps and sites ...
1
vote
0answers
31 views

Can a linux distribution provide an API to a proprietary codec? If so under what conditions?

As an example lets take the MPEG2 codec, let us say I am building a Linux distribution which I intend to ship in two pieces. Piece 1: (free) Core libraries and applications Piece 2: (paid) ...
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 ...
1
vote
0answers
57 views

Should all public API POCO value-type properties be nullables?

I use nullable value types a lot when designing classes that have properties which may remain null, i.e. when the object is being persisted. For example: public int? MyProperty { get; set; } My ...
0
votes
1answer
81 views

Is this pattern RESTful? Or something else?

I'm working on a new project that will create a web-based API to perform CRUD operations on a relational database. Originally, I was going to create the API as http-based, and make it RESTful so ...
1
vote
0answers
63 views

How to protect a public tracking API?

Let's say company X has websites A, B, and C. It would like to track how people are visiting them in ways that Google's Analytics and other services can't. So we company X provides a web API to track ...
2
votes
2answers
318 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 ...