While (RESTful) web services are the predominant design pattern for modern APIs, there remain many APIs that employ the SOAP (Simple Object Access Protocol) protocol. Can the uptime and performance of SOAP APIs be monitored using your API Science account? Most certainly! In this post, I’ll illustrate how to configure an API Science monitor that […]
Continue readingMonth: October 2016
Using Regular Expressions and JavaScript to Validate API Responses
Regular expressions (RegEx) are “a sequence of characters that define a search pattern, mainly for use in pattern matching with strings, or string matching.” Amazingly, the RegEx concept was invented back in the 1950s, by U.S. mathematician Stephen Cole Kleene, who was a student of Alan Turing, among others. In his book Mastering Regular Expressions, […]
Continue readingUsing JavaScript to Validate API Response Bodies
In prior posts, I’ve illustrated how API Science’s JavaScript validations capability can be used to validate API response timing versus data size, API HTTP response headers, and HTTP response status codes. What hasn’t yet been investigated is how you can use the API Science JavaScript validation facility to validate the API response body. We’ll use […]
Continue readingUsing JavaScript to Validate HTTP Response Codes in API Responses
In addition to using JavaScript to validate HTTP headers received by your API Science monitors, JavaScript can be applied for fine-grained validation of the HTTP Status Code for each API response. The status code normally associated with a successful response is 200 (“OK”). However, all 2xx status codes indicate that from the server’s point of […]
Continue readingUsing JavaScript to Validate HTTP Headers in API Responses
In my last post, I applied JavaScript to create a timing versus data size validation for my XKCD API monitor: var timing = context.response.timing.total; var size = context.response.meta.downloadSize; if (timing > 5000) { assert(size > 10000, “Download size vs speed issue”); } The validation checks how long it took to complete the API check. If […]
Continue readingUsing JavaScript and Chai Asserts to Validate API Response Timing versus Data Size
My last post described the possibility of applying JavaScript and API Science’s built-in Chai Assertion Library to validate responses from API calls. In that post, I created a monitor that calls the xkcd.com API, which returns JSON formatted responses. Now it’s time to write some JavaScript that validates the API’s responses. The API Science monitoring […]
Continue reading