An application programming interface (API) is the specification for which software is meant to be used by other software.
3
votes
2answers
115 views
How are POST/PUT/DELETE data passed to APIs?
I know that the data is passed through HTTP, but I'm not sure if I should be passing data through HTTP headers, or HTTP bodies. Which one is the convention for APIs?
Also, theoretically using PHP, ...
-3
votes
0answers
42 views
SwiftyJSON vs Alamofire vs neither - Swift - Google Places Api [closed]
I would like to develop an app using the google places API. But wondering whether I should be using SwiftyJson, Alamofire, or possibly neither to call the API and parse information.
And if one is ...
3
votes
4answers
110 views
How to prevent user from requesting API method multiple times in parallel?
Let's say we have an app where the users gain points and can exchange them for rewards. The exchange request, in pseudo-code, could look like this:
function exchangePointsForReward(userId, rewardId){
...
2
votes
2answers
65 views
How to correctly implement key=value storage REST API
I'm new to REST API, so I decided to get familiar with it by designing a small web service API. I have its design written down and would like you to review it. I feel like I have made some mistakes in ...
1
vote
1answer
71 views
Tracking online users with a stateless architecture
I own a stateless architecture, exchanging a JWT token between client and server at authentication time.
I want to store in database (once per day) a timestamp related to the user access.
Indeed, I ...
0
votes
2answers
64 views
JSON API specification : When do I need to return a 404 not found?
I'm working on a REST api following the JSON api specification and I'm struggling with the "no data" responses (described here).
A server MUST respond with 404 Not Found when processing a request ...
4
votes
1answer
99 views
Many asynchronous calls vs single call to the API
We are developing a REST API which among others is going to be consumed by an HTML5 frontend via javascript. The application is for use within the organization and usually has about 300 users, but we ...
3
votes
2answers
86 views
Change database based on request origin
I am developing a web application which will be run by multiple companies.
Each company will have its own instance of that web application and its own database. The web applications and databases ...
0
votes
2answers
103 views
What is it exactly that makes programs platform dependent when they're using cross-platform APIs?
I understand that programming languages can either be run in a VM (Java, etc) on every OS that supports the VM natively or compiled to machine code (c, etc) for each platform.
What I don't ...
3
votes
1answer
64 views
why use authentication token instead of session_id for app(android side) in REST API
in normal php web application after login we use session_id that came from web browser to check if user loged in or not.
But in REST API authentication I read some tutorials that say php should send ...
5
votes
1answer
66 views
Unit testing an API client and wrappers
I've been going round in circles trying to figure out the best way to unit test an API client library I'm developing. The library has a Client class which basically has a 1:1 mapping with the API, and ...
6
votes
2answers
114 views
Advice for designing API request rate limiter?
I'm in the planning stages of a web application that makes heavy use of data retrieved from a third party's REST API. This data is cached on the server and requested by clients via AJAX. The REST API ...
3
votes
0answers
45 views
Sharing identical events, with differing scopes, between client and server libraries, in a micro-service architecture
I have a shared user repository (id, name, e-mail, password, etc.) exposed as a REST service - and multiple independent web-sites accessing this REST service (from the back-end) as a means of sharing ...
5
votes
1answer
161 views
How do you organize API endpoint contracts
Where trying to improve the "confidence" we have in our inter-service communication.
Background:
"Contracts" has been a matter of sharing a piece of code that defines an interface to implement, but ...
0
votes
0answers
52 views
Using the Facebook Login button, how would I securely convey to my web app's backend that the user is authenticated?
Background: I'm building a web app using the most recent Facebook Javascript SDK to help with user registration and login. The backend is built in PHP, but that likely is irrelevant.
The situation: I ...
36
votes
5answers
2k views
How is defining that a method can be overridden a stronger commitment than defining that a method can be called?
From : http://www.artima.com/lejava/articles/designprinciples4.html
Erich Gamma: I still think it's true even after ten years. Inheritance is a cool way to change behavior. But we know that it's ...
3
votes
1answer
117 views
Best practice for Restful API that perform heavy calculations (Image Processing)
We are currently developing an image processing restful api. Server performs some CPU-heavy computations image processing upon request and return the image to the client.
We want to make this a ...
3
votes
1answer
115 views
Can this be considered an API? [closed]
I'm writing my first API, but I think I screwed it up from the design. It's a simple CRUD API which behave like this:
READ: /api/data gets redirected to api.php?data1=data. POST variables: user, ...
0
votes
0answers
30 views
Where should user input be validated? [duplicate]
I am working on a webbased user interface using AngularJS. As a database I am using MongoDB which can be accessed through an Python-eve-API.
The API is able to validate the passed data as stated in ...
0
votes
1answer
52 views
Internal API to public API - versioning
We have an internal API that is specifically for our website and internal applications, and we are planning to release a public api exposing some of the endpoints in our internal API.
We are using ...
1
vote
3answers
166 views
Soap vs. rest - a hybrid approach? [closed]
I have a proper SOA architecture, with web services defined with WSDL and responding to SOAP requests.
But this application has also an endpoint that responds to json request and replies in json ...
1
vote
1answer
47 views
When and how long should I cache data read from an external API?
I am working with an API but I am unsure what the best way to store the API return values.
Specifically, I am working with the RIOT API just as a small hobby project. I would like to store this ...
3
votes
2answers
180 views
Should I use my own public API for my web interface?
I am designing an API with django and its rest framework (and I am already not sure if it worth the hassle to version it or not).
I totally know the iOS and Android apps will call the API, get a ...
2
votes
1answer
53 views
Image resolution in a RESTful interface
Background
I have a RESTful HTTP API.
I have a resource.
GET /my/cat HTTP/1.1
Clients may want to retrieve the image representation of this resource.
GET /my/cat HTTP/1.1
Accepts: image/png
...
0
votes
1answer
33 views
Can I use data from the Amazon API in my App?
I'm having a hard time finding information on this, but using the Amazon API (such as the ItemSearch api) provides you with data on Amazon products. In my case I am interested in books.
The Amazon ...
0
votes
1answer
45 views
Should API DTOs be shaped to client(s) or be universal?
I have a project with an internal desktop client app and a server-side client API service talking to a relational database. I seem to have two choices:
1) shape DTOs to client views, e.g. ...
6
votes
4answers
422 views
Should a REST API be able to convert datetime to appropriate clients timezone?
Whilst implementing our API, the issue of datetime and timezones came up.
All dates are normalized to UTC in the database. Currently, in the non-API application, all datetimes are converted based on ...
2
votes
2answers
85 views
Rest api with a hello resource / main entry point
I'm designing a Rest API for our web application.
There's one idea that came to my mind today and I haven't found in recent searches: a "hello" resource, where clients are supposed to connect as the ...
0
votes
0answers
30 views
Best way to update driver data from userspace
I have a userspace application which interacts with a kernel-space driver in a Linux environment. The driver, in this case, is an LED driver. In typical *nix fashion, the driver exposes a file in ...
2
votes
3answers
309 views
Are colons ok in a REST API?
I see many REST API examples with URIs like http://<whatever>/widgets or http://<whatever>/widget/123, for a specific thing. For most things I would just stick with the front slash, but ...
1
vote
0answers
19 views
Most suitable solution for logging traffic to external services - ASP.NET
My application relies on several external services - labelled Service A, Service B and Service C in the diagram. I am looking at ways of logging the number of requests made to these services, and the ...
1
vote
0answers
41 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 ...
0
votes
1answer
85 views
Function or class design in library API for efficient object reuse
I am currently building a library in C++11, where I spent a lot of time trying to design a good interface. After some small redesigns along the way, I've ended up with a design that I am happy with. ...
-1
votes
3answers
74 views
Should I Store Data in Database or Fetch it from available Public API
I am working on a idea that is based on Books, and each book carry a standard set of information with it (Author name, publisher , num of pages etc. etc.) , This data is available with Google Books ...
1
vote
1answer
83 views
Databaseless ASP.NET MVC 5 on top of an external REST API
Where you would envision an out-of the-box ASP.NET MVC 5 web application on top of an MSSQL database, I have now been placed in a situation where I'm supposed to use custom external token endpoints ...
2
votes
1answer
62 views
How do you stick to an ABI/API in a commercial library?
How does a commercial library vendor manage to stick to the same ABI over years of development (or is this a bad assumption on my part)?
I would have thought that over time a lot of functions and ...
1
vote
1answer
94 views
Is it correct to implement all the payment flow in the client rather than in the server?
I’m building a mobile app marketplace and I came to the point of integrating a payment tool. I'm using Mangopay, which has a nice workflow for making payments in a marketplace using its REST api. The ...
1
vote
0answers
67 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 ...
2
votes
1answer
170 views
Writing a programming api for an existing project? [closed]
I've an already existing project in C#. Now I should implement a plugin system. For this plugin system I've to implement a programming api/sdk. I dont want, that plugins have access to the assemblies ...
2
votes
3answers
284 views
Microservices REST or AMQP, which case
I've read many articles concerning microservices architecture and I was wondering when to use AMQP or REST.
I've read that losing couple between services is a good thing and AMQP seems to be a good ...
0
votes
0answers
36 views
Understanding SSO flows
I m actually studying SSO using OAuth2 and I m having some questions working with real architecture.
I understand the way how we connect to a tier server, getting an access token and making requests ...
0
votes
1answer
66 views
API Breaking Changes
I have a public REST API for creating new business profile records in my system. The request itself looks similar to this:
{
"BusinessName" : "AName",
"CurrencyCode" : "USD"
}
You can see ...
1
vote
0answers
68 views
Word for method that gets and sets? [closed]
Is there a word for the API pattern where a method may get or set, depending on whether it is called with an argument or none?
This style is often used in JavaScript:
obj.prop(); // ...
1
vote
1answer
59 views
REST API and user rights
I am developing an application using Angular and REST API and I'm facing a problem concerning user access right.
The application runs this way:
A user signup
The same user creates his organization
...
5
votes
2answers
921 views
REST API security Stored token vs JWT vs OAuth
I am still trying to find the best security solution for protecting REST API, because the amount of mobile applications and API is increasing every day.
I have tried different ways of ...
0
votes
1answer
119 views
Best way to separate public API from internal implementation [closed]
I'm developing a little framework (in Scala) where I want to define clean and simple interface for the users of the framework. Some of theses interfaces have to be implemented by the framework itself, ...
2
votes
0answers
149 views
Assembler vs Entity Translator and Entities vs DTO
I was hoping that someone could explain the exact difference between an Assembler and Entity Translator.
Martin Fowler describes the Assembler as a sort of Mapper(?) which converts DTOs into Domain ...
1
vote
1answer
123 views
Methods of preventing SPAM with an API - AngularJS Website Contact Form
I'm exploring AngularJS and ran into an interesting question. If I develop an API to power my AngularJS website it would include public facing items such as a Contact Form. Assume an API method exists ...
8
votes
5answers
309 views
How to prevent changes to an internal API from breaking other projects?
We have like 20 - 30 independent modules/solutions. Each of these has about 7 - 10 projects with different classes, components, etc. These are all used internal to our company.
Our problem is when ...
0
votes
2answers
222 views
Too many REST API calls on a page?
A web app designed with highly modular, small components (in this case using AngularJS directives but could just as easily be WebComponents, ReactJS components, or any other technology). Components ...