![]() ![]() Setting Sparkbooth up with a webcam was very easy. Frankly, the hardest thing in the setup I found was remembering where my old Canon DSLR live view setting were buried. Sparkbooth as a very smooth and intuitive interface that gets you up and running in no time. The resulting web page includes web forms for all of the API functions.Sparkbooth is a user-friendly photo booth solution that’s easy to install and operate a fraction of the cost of renting a [photo booth. Each web form is configured with the URL and parameters of one of the API functions. The server passes the set of API specification objects to a Jade web template and generates a web testing page including a set of web forms for the API functions. For example, I also use it to generate a web-based testing interface. In addition to controlling the API processing pipeline, these API specification objects can be used for other purposes, such as for documentation and testing. Other Uses for the API Specification Object If the server matches an incoming API request to an API specification object and passes all of these validation steps, then it forwards the API request to the callback function in the API specification object for processing. The server validates parameters using a standard validation module, wrapped in another module to allow for user-defined parameter types. If all of the required parameters are present, then the server validates and sanitizes the API request’s parameters (including any optional or extraneous parameters). The API processing pipeline then uses these API specification objects to evaluate each incoming API request. The server initializes the API processing pipeline with the API specification objects for the supported API. The web services server processes all incoming requests as follows: Processing API Requests Using the API Specification Object For each API function’s parameters, this object specifies the parameter names, the parameters’ data types, and whether the parameters are required or optional. Each API function’s specification object includes the function name, version, calling URL, the callback function used to process the API call, and any function parameters. This Javascript array includes objects representing each API function. API Specification Objectįor example, this is an abridged API specification: ![]() Despite being code, the API specification objects are easy to read and understand. Additionally, new API functions and even entirely new APIs can be easily added just by passing their API specification objects to the API processing pipeline. This API specification object is used by the server to process all incoming web requests and generate a testing interface.īy controlling the API processing pipeline using the API specification object, changes or modifications to an API specification object are automatically implemented by the server. Each API is defined by a Javascript object that defines that API’s specific function calls, associated URLs, and parameters. Rather than trying to implement each of these APIs separately, I decided to build a data-driven, self-documenting, modular API processing system. Data-driven API Processing Eliminates the Tedium of Supporting Different APIs Because these APIs are exposed to the web, user authentication, URL validation, and API parameter validation are extremely important. Additionally, we needed the ability to quickly add other social and sharing services to the server, support API versioning, and a server administration and testing interface. Some of these interfaces are outgoing-only, but others, such as the e-mail and SMS interfaces, are two-way and may receive calls from the cloud at anytime. ![]() A photobooth client API to enable photobooth applications to access these web services.E-mail service to request and receive photobooth pictures.Text messaging (SMS and MMS) service to send and receive text messages and photobooth pictures.Cloud blob storage to temporarily store pictures.Cloud table storage for the server’s own data.The primary purpose of the web services server is to act as “glue” for all of these various services.įor this project, the initial set of APIs included: It seems that virtually every conceivable function is available via a REST API. The Problem: So Many APIs to Connect Together For these and other reasons, he wanted to create a web server to handle all of the social and sharing integration. Also, some recent changes in Tumblr’s API made uploading pictures directly from the client rather burdensome. However, he wanted to add more sharing and social functions, such as sending photobooth pictures to users via texting and e-mail. ![]() Until then, the photobooth software was a heavyweight client application. In 2013, I wrote a web services server for my friend’s popular photobooth software. ![]()
0 Comments
Leave a Reply. |