Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
0answers
686 views

Parse query filter expression from request URL

I am building a backend APi for which I need to extract query filters from request URL of following pattern: ...
3
votes
0answers
151 views

Perl nagios plugin to query an api, obtain date from json, and determine if the date is within thresholds

This is an update of Using an API to obtain JSON data and get the date string and determine if data is stale This is a nagios check that will use an API URL, get JSON data, flatten the data into a ...
6
votes
2answers
385 views

Using an API to obtain JSON data and get the date string and determine if data is stale

This is a nagios check that will use an API URL, get JSON data, flatten the data into a usable perl hash, and ultimately obtain a date string. Once the date is obtained, it should recognize the ...
2
votes
0answers
52 views

Requesting information about people from a web API

I'm requesting from a web API information about 20,000 people that I need to update continuously at lightning speed (the web server doesn't throttle the number of requests). I can request an update on ...
6
votes
1answer
603 views

Library to be used against a specific REST web service

I have been trying to generate a basic library that I can use at work, to call different REST calls towards a software vendor that we are using. I would love someone's opinion on it, and what I could ...
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
271 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
586 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
672 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
253 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
625 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
289 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
221 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
160 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
356 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
1k 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
380 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
676 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
296 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
279 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
147 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
101 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
475 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
439 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
346 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
555 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
301 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
176 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
211 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
725 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)...