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.

79 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
0answers
187 views

Tick. Tick. *breathe* BOOM! - Setting up real, stable asynchronous callbacks with WinAPI Timers in VBA

WinAPI Timers can be quite tricky to work with, as anyone who's tried to use them and fallen foul of one of the many pitfalls probably knows. Problems such as screen freezing, crashes, uncontrolled ...
7
votes
3answers
1k views

CQS implementation with decorators

I've created a "framework" or more of a library for a CQS implementation with a few decorators. Using ASP.NET Core for the front end, I wanted an opinion about how this looks/feels. I changed the ...
5
votes
0answers
194 views

Entity component system Lua API

The destruction of the objects are handled by the garbage-collector metamethod. (Does this make sense? This means that an out-of-scope object will stay visible in game until garbage collection.) The ...
5
votes
1answer
95 views

Function outcome: consistent approach and easy logging

My goal is to make a consistent and easy way to determine how a function fails/succeeds. I'm looking for code review of my Status class for any bad practices, code ...
5
votes
1answer
151 views

GitHub API client

Here is my Haskell program designed to list all of my GitHub repos along with their descriptions and languages via the GitHub JSON APIs: ...
4
votes
0answers
80 views

One interface for multiple CRUD resources

I asked about an abstraction layer for accessing files (link) a couple of days ago (I decided to not call it a follow-up anymore as there are too many changes). I tried to incorporate many of the ...
4
votes
0answers
498 views

Update UI once all API calls are done

I'm learning Swift at the moment but I would like to produce well-organised code. The goal of my little app is to display the weather of my current location. I use : the API of Darksky : https://...
4
votes
0answers
45 views

Texplode KotH controller

I am creating a KotH (King of the Hill) challenge for Programming Puzzles and Code Golf. Other site users will write programs that play Texplode (a version of this game on a square grid). The program ...
4
votes
0answers
136 views

Core class of a JavaScript framework for Single-Page-Applications

A few years ago I started building a tiny (~300 SLOC) JavaScript framework for scalable and maintainable Single-Page-Applications written in CoffeeScript. GitHub www.scaleapp.org It's inspired by ...
3
votes
0answers
63 views

Middleware which lets developer maintain dynamic context

Problem Statement: Users can chat while the replies of the chatbot are based on past messages. So the chatbot needs to have the context of the previous messages and reply accordingly. Here is ...
3
votes
0answers
62 views

Wrapping a C API to be implemented in rust

I'm writing a Rust library to facilitate implementing the following C API in Rust. That is, it should be possible to create a Rust-idiomatic implementation by depending on my wrapper library. ...
3
votes
0answers
49 views

Node Based Code Flow Builder

Background In my development of a game engine, I realized the need to be able to construct processing units in a serializable way (code below does not show serialization, just the wiring). I broke ...
3
votes
0answers
60 views

PayPal Checkout API with PHP - Sending and retrieving additional data safely

I am learning to use the new API version of Paypal, and I have some doubts. Note: I've tried this on https://www.sandbox.paypal.com and it works, I have not done the tests on Live. onApprove: I ...
3
votes
0answers
57 views

Rest API in a trimmed model

I practiced my Java knowledge in the last couple of days. For that, I want to create a Rest API in a trimmed scale, because there a lot of aspects which must be considered in such an API (Login, ...
3
votes
0answers
76 views

User registration in Actix w/ DynamoDB

I am trying to puzzle out api based user registration for a service I am building, but I have a strong feeling that my code is not optimal. It feels like passing "state" in the way I did prevents the ...
3
votes
0answers
466 views

Python script for OpenStack health check

First time moving from Bash to Python for scripting and looking for feedback/improvements. I've spent the weekend learning about OOP, and am aware that not fully utilizing it in this script — so any ...
3
votes
0answers
82 views

Implementing secure API for use between other internal apps

My team and I are trying to implement a secure API and would appreciate some feedback on the following: If there are areas of improvement in the current code to improve security Recommendations on ...
3
votes
0answers
101 views

Retrieving data from the movie database

I am trying to retrieve the series, seasons and episodes from the movie database, however I am pretty new to Ruby on rails and I feel like what I am doing could be improved a lot. I use an ...
3
votes
1answer
331 views

Executing a sequence of actions over time in Unity

This script executes a sequence of actions over time and is based on the methods exposed by the UrhoSharp framework. I am new to Unity, but well acquainted with C# so I know what I'm doing for the ...
3
votes
0answers
40 views

oEmbed provider servlet to handle four media types

I would like to add oEmbed tags to my site (I'm the oEmbed api provider). My api should respond the results based on the file type. oEmbed Types has Photo Video Link Rich My response to photo ...
3
votes
0answers
104 views

Load data from WebAPI to the ViewController

My current code working perfectly, it is for data load from web api to the UIViewController (UITableView). But I am confused ...
3
votes
0answers
57 views

A function that debits a virtual wallet and calls an API to disburse to a real account

I am trying to determine if there is a better way to handle reversals for this function. This is how it works: A user inputs in amount, bank, and account number this would be used to debit his ...
3
votes
0answers
155 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 ...
3
votes
0answers
262 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 ...
3
votes
0answers
14k views

JWT - Simple API example

I have created this fake API just because I want to learn how to use JWT. It is a simple unsigned token exchange with two methods call: login and adminPassword. I've used https://github.com/lcobucci/...
2
votes
0answers
28 views

nodejs 401 request retry mechanism

I'm working on a project in which I have a backend in nodejs and from there I need to call external APIs, those APIs require authentication token which is valid for 15 minutes. So if response status ...
2
votes
1answer
39 views

WP/PHP getting API data and using hook

Below are the two things I'm trying to solve, logically. This is just a proof of concept; and I'm not implementing this on real data nor via full plugin at this time. Just looking at logic and syntax ...
2
votes
0answers
26 views

Library/API: simple springboot / jdbc query builder and ORM

I have been using and developing a simple ORM and query builder library that I have found useful in it's practical application. I am pretty sure there are improvements to be made, and I welcome any ...
2
votes
0answers
33 views

Command String Parser

I'm working on a library that, in essence, splits a string at whitespace, with extra rules: Consecutive whitespace is collapsed, and trimmed at the start and end. Whitespace wrapped in quotes is not ...
2
votes
0answers
82 views

Google drive backup robot

I have a lot of files. I care about those files. I also care about good programming practices and learning proper python. Given the described context, it seemed appropriate to implement my own ...
2
votes
0answers
32 views

WordPress rest api basic auth with IP check

I'd like to use basic auth with the WordPress API, but restrict the capability to a single IP address. I've updated the existing code from here: https://github.com/WP-API/Basic-Auth accordingly. It ...
2
votes
0answers
162 views

PHP project with Google Calendar API

I'm playing with a simple (for now) project in PHP with Google Calendar API. I have posted the code here in order to improve my programming style about whatever you think it's worth suggesting. Thank ...
2
votes
0answers
193 views

Wrapping a web scraper in a RESTful API

The problem I am looking to solve is wrapping a web scraper in a RESTful API such that it can be called programmatically from another application, frontend or microservice. The overall goal is that ...
2
votes
0answers
54 views

Best approach to parse data from multiple APIs to Entities in PHP

I built an application that extracts and updates data from multiple ecommerces websites. Each eCommerce is either built using platforms/frameworks such as Shopify, Prestashop or WooCommerce. This ...
2
votes
0answers
202 views

Setting many properties in a PHP class

I'm trying to define parameters for my API. It's a super basic one and the first I've made. I'm trying to instantiate my class and set parameters but to me it seems super messy. Is this really the ...
2
votes
0answers
73 views

Reshape GET Request to Long Data Frame in R

Overview Converting the content of the httr::GET() request from json into an r data frame required a few data manipulation steps to reshape the data to long format ...
2
votes
0answers
39 views

Undocumented API client / wrapper in Python

Got the go ahead to make an API wrapper for an undocumented web API. Hoping to get some feedback on my code and design choice. I've been going back and forth and haven't been able to really feel ...
2
votes
1answer
1k views

Node.js/Express middleware to relay requests to various APIs

I am creating a nodejs middleware server that will handle api transactions from a frontend and relay them to various api's (internal and external). The primary goal is to hide api keys from the ...
2
votes
0answers
931 views

Adding support of HTTP PATCH

I have an API endpoint to modify a race car, which supports the PUT method: PUT /api/racecars/{racecarId} Since PUT must be ...
2
votes
0answers
2k views

Serial Port Wrapper with Internal Blocking Buffer

Here I have some complete working code but some aspects seem questionable to me. What I have done is written a wrapper for the Microsoft serial port (...
2
votes
0answers
746 views

REST API wrapper class with Alamofire + Gloss

I have come up with this structure to handle API calls using Alamofire + Gloss. The multipart method I came up with was kind of in a hurry, it works but I think it could be done much better. So this ...
2
votes
0answers
133 views

Send image between apps

I have an ASP.NET CORE API app and now I have an endpoint like: ...
2
votes
0answers
99 views

Fetch object from database, or fetch it using an API if it isn't there

To give some background on this particular code, there is a controller which recieves an object, hashes parts of it and looks into a database to see if there is a similar hash in the db, if there is, ...
2
votes
0answers
150 views

First basic API using Flask with authentication

I've created my first basic API using Flask, that has the ability to create new tasks, delete tasks, update tasks, handles error pages, and has authentication required. What I would like to know is ...
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 ...
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
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 ...
2
votes
0answers
307 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 ...
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 ...
2
votes
0answers
79 views

Restful API for parsing records

I'm trying to implement my own API. This code excerpt should show the basic working routines. The storage is temporary an in-memory-array and the only HTTP method for now is POST. I outsourced the ...