Questions tagged [api]

API, for code implementing (not using) an Application Programming Interface. A program's API defines the proper way for a developer to request services from that program, site and/or service.

Filter by
Sorted by
Tagged with
1
vote
1answer
38 views

Select comparison function for sorting based on type information

So I'm working on a patch for the python interpreter where you go through the list and look at the types of the elements and try to use optimized special-case comparison functions that are much ...
2
votes
2answers
267 views

Logging all API call traffic in Java servlets

We have a few servlets like the one below, taking JSON request and produce JSON response. And the requirement is to log all API call traffic. ...
4
votes
1answer
94 views

PHP secure server2server communication

I read a lot about security mechanisms used in different APIs. But I'm still wondering if my own implementation is secure or not since it seems that there will ever be a risk of something you forgot .....
1
vote
1answer
580 views

Get data from external API

app.js var employees = require('../models/employees'); employees.read(req.params.id, function(body) { console.log(body.firstName); }); models/employees <...
2
votes
1answer
630 views

The Telegram bot for book information

Telegram Bot that retrieves book information from GoodReads I've created a Telegram bot that implements the inline/offline modes to get the brief info about a book, searched by title(inline mode) or ...
3
votes
0answers
249 views

Uploading series of large files to API via Node

I wrote a node script to traverse a folder of hour-long mp3s and upload them to Mixcloud via their API. It works, but I suspect it's fairly inefficient - the computer it's going to run on at our radio ...
4
votes
2answers
601 views

Telegram Bot that retrieves book information from GoodReads

The project below is about a Telegram bot that implements both inline and offline modes. The idea is to get a brief info about a book, searched by title(it's author, rating, short description). I ...
4
votes
1answer
58 views

GET event handler

I'm working on my first NodeJS / Express application with the async module. It's been an uphill battle for me learning node (and even JavaScript) as I go along so I'm sure there's a lot of room for ...
2
votes
2answers
284 views

Parsing and saving JSON result from GoEuro API

I am new to python so I decided to write a script that parses a json array and writes data in a file. I wrote the code that does that but I think it can be done way better, So I was hoping to get ...
6
votes
2answers
219 views

~600k external API requests for uploading part numbers to an inventory

I have a CSV containing ~600k part numbers to be uploaded to my website's inventory. However, this CSV only contains limited information. We're missing pricing and other related information. To get ...
4
votes
1answer
158 views

Validating attributes of a page in Adobe Experience Manager

I am reviewing the following code written by a fellow developer. I am not an java expert but IMHO i did not feel this is efficient use of exceptions — the reason I feel so is: The below code throwing ...
0
votes
1answer
348 views

JavaScript Weather App using 3 APIs

This is one of my first programs working with APIs and I was hoping to get some input in the form of suggestions, recommendations or corrections. The goal is to register the user location by IP, ...
2
votes
1answer
976 views

Combining json responses of recursive web service calls with PHP and curl

I'm implementing the Hotel Price List API from Skyscanner. This requires a first call to the service to implement a session followed by 1 or more calls to the service to get the actual results. I've ...
1
vote
1answer
105 views

RESTful backend API for user account

I have made a RESTful API built with Node.js, Express, Basic-auth and Mongoose. it will respond JSON. This is the folder structure: ...
2
votes
0answers
50 views

Java interface to C library - Refactoring to singleton usage

I am currently writing a Java interface to a C library. It mostly just delegates calls and adds a object oriented layer on top of it to make integration into a regular Java program more natural. The ...
2
votes
2answers
370 views

Basic API wrapper around a Restful service - follow-up

This is a follow up from my previous post: Basic API wrapper around a Restful service I'm writing a basic wrapper around a restful service that returns a list of Stores. Naturally, I want to make it ...
7
votes
1answer
2k views

JSON REST client proxy generator

Trying to create something really lightweight. Sources are on GitHub. To create a proxy we need to define an interface first, e.g.: ...
5
votes
2answers
6k views

Basic API wrapper around a Restful service

I'm writing a basic wrapper around a restful service that returns a list of Stores. I'm using RestSharp which I'm injecting into the class. Naturally, I want to make it completely testable (that's a ...
3
votes
2answers
668 views

C# Async Oauth API Wrapper Class

Two quick notes: I'm targeting 4.5, and the server already has newtownsoft's json library. I'd prefer not installing anything additional on the server. ...
2
votes
1answer
291 views

Weather API implementation

This class uses the openweathermap API to receive information about the current weather and forecasts. I am looking for any type of advice, but primary for structure and style improvement suggestions: ...
6
votes
2answers
274 views

Powershell cmdlet authenticating to Aerohive API

After dipping my toes in PowerShell for over a year i think it is time for creating a real cmdlet. My first mission was creating a regular PS script to take in a .csv and create a wifi account using ...
1
vote
1answer
61 views

Django class based view URL API

I kind of started making an API for my site in a Django class based view because it seemed logical and now it has gotten quite large and unruly and I am starting to wonder if I am doing this correctly....
5
votes
1answer
145 views

Python Politico API attempt

I love politics, and I love programming, so I figured why not try and combine the two for something to do? I'm making a work-in-progress (but runnable at this stage) Politico api that I call "...
2
votes
2answers
15k views

Calling Web API from MVC generic way of approach

Our Project architecture is AngularJS + MVC + WebAPI. Angular JS would call MVC action and MVC action further calls API methods. Below are some of the action methods we used for calling api methods. ...
2
votes
0answers
52 views

Adding or editing a child

I have a class which will add or edit a child. So whenever I click on "save," I need to check the child image. If it's an image, then I need to upload to the image server. Once that's done only, I ...
0
votes
1answer
100 views

List and post tasks with jQuery

I've written the code below to display a list of tasks from a Flask API. The form and associated .ajax method post to the API, immediately appending the data to the list of tasks. The code is working, ...
5
votes
1answer
3k views

Random quote generator from API

I have built a random machine generator website. It fetches the quotes from forismatic and has a button to get a new quote. When it gets a new quote, the website color changes. It also features a ...
9
votes
2answers
474 views

Responding to API requests with much complexity

So having used the SE API multiple times, I like how all responses are in a Wrapper object, and for my own API design I figured it was a good method to follow. Of ...
1
vote
1answer
414 views

Using the BBC iPlayer API for managing TV programs

I have been learning Ruby by reading books and tutorials, and practising some problems on Codewars to level-up my new skills, when I had an idea for a little Ruby code project. It will store ...
5
votes
1answer
1k views

Telegram Rest API client design

I'm working on a "framework" for Telegram bots and right now everything "just works". I'm now in the process of rethinking about what I wrote and one of the things I dislike a lot is how I implemented ...
9
votes
2answers
2k views

Managing a programmatically accessible stack trace

VBA has a call stack... but there's no programmatic way to tap into it, which means in order to get a stack trace for a runtime error, one has to manage it manually. Here's some example code that ...
1
vote
0answers
80 views

Wrapper for a vendor API that lacks common interfaces

I know basic Java, but I struggle sometimes with object orientation design. There is a vendor api I use, and I wanted to wrap it to be reusable as a lib in other projects. All the services from the ...
3
votes
1answer
2k views

Calling TWITCH API and displaying online/offline users of a channel

I've got this working almost to where I want it. The part I can't get right may be due to the programming so I'd like to get a review. I'm making JSON calls to ...
3
votes
1answer
3k views

Simple Calculator RESTfull API on Java

I have written a small calculator REST API and I need someone to look the structure and design of what I did. I want to know how I can make it better. Here is an example with multiplication. Other ...
1
vote
0answers
333 views

Run a potentially long running application from within a Python webserver and return different results depending on whether the application finishes

I want an API on a Flask/Gunicorn webserver to make a call to a separate, potentially long-running java application. If the java application finishes before the Gunicorn timeout, Flask should return ...
1
vote
0answers
539 views

Active Directory Searcher class/API

This is intended to be a model for an application that queries an Active Directory. It can return IEnumerables of the following: ...
2
votes
0answers
294 views

API design for loading OpenGL textures asynchronously

What do you think about this API for loading OpenGL textures asynchronously? My main concern is that the loader class executes code on the client io_service. This takes away some control from the ...
3
votes
1answer
67 views

Interface to the Force.com REST API

I'm implementing an interface to the Force.com REST API, with very specific ideas about which parts of the API I need. My problem is with testability of consumers of this API abstraction. The first ...
2
votes
0answers
72 views

Pointers for C++/CLI library header formatting, layout and design

I have designed a C++/CLI wrapper library that allows C++ applications on windows, and other platforms that can load C dlls (e.g. Java via JNA or Python) to make calls to my .Net library. I was ...
5
votes
1answer
175 views

Home Test Exercise - Create a Java Service capable of posting GitHub events to Slack

I was asked to provide a codebase for the following exercise. I have provided the requirement of the problem and also putting down the code of two main classes. Can you please review and provide your ...
3
votes
1answer
206 views

Google Maps geocoding lookup function

In an effort to keep all of the Google Maps Javascript API in it's own little world, I have created a googleMaps object that will contain all of the functions that directly make google maps webservice ...
0
votes
2answers
54 views

Acquiring all products with a particular license ID

I am working on refactoring this method on the API. It's very slow, and can take the browser 12+ seconds to receive the result from the API. Can someone give me something to get me started or point ...
4
votes
2answers
1k views

Wrapper for a transfer transaction API

I'm looking for any kind of advice, like when or where to do exception handling, the overall library structure/layout, usage of classes/partial classes, code efficiency, naming conventions, and so on ...
4
votes
1answer
718 views

Secure Token for use in API calls

My team has developed an API and I've been tasked with creating an authentication layer that allows partners' applications to consume it. To that end, I've created a data store which houses an ...
2
votes
1answer
2k views

Script that retrieves trending topics from Twitter

The following code fetches trending topics from Twitter's API using a WOEID. It caches the response, loading from this cache the next time if its relatively fresh (generated within the last 15 minutes)...
3
votes
1answer
119 views

Querying the Google ads API

I have a method which relies heavily on object supplied by third party APIs. Below is my working code, is there any scope of improvement? ...
1
vote
1answer
660 views

MVC API controller processing POST request

Do I need to restructure for readability? ...
7
votes
1answer
360 views

Stack Exchange API Python library

I wrote a package a few years ago to make my interactions with the Stack Exchange API more straightforward. I've maintained it over the years and used it in several scripts I've written that interact ...
1
vote
1answer
7k views

Weather app using the openweathermap.com API

I have been working on a simplistic weather application that utilizes the openweathermap.com API. I have an ajax call to make an HTTP request to get a JSON object that contains the data which is ...
7
votes
1answer
345 views

Parse JSON data of upcoming fixtures of Chelsea FC

This program makes a call to an API (http://api.football-data.org/) and obtains data for fixtures of Chelsea FC for the next 100 days in JSON format. The JSON is parsed into a Java object and then ...