Using JQuery and AJAX to Display API Data on a Web Page

My last post demonstrated how JavaScript and JQuery can be used to make a API call and embed the response into a Document Object Model (DOM) instance. In that post’s example, the API was called, the data was retrieved and loaded into the DOM, but nothing was displayed on the web page. In this post, I show how to access the API response data and present it on the web page. This is the next step in illustrating how the API Science API can be utilized to develop custom consoles and other applications that address your particular needs.

Continue reading

Using JavaScript and JQuery to Access API Monitor Data

The API Science API provides the capability for your custom software to access information about your API monitors. In this post, I provide an example of how you can create a web page that utilizes JQuery and custom JavaScript to bring data about a specific API monitor into a browser’s Document Object Model (DOM). Once […]

Continue reading

Introduction: Javascript and Custom API Dashboards

Javascript provides the capability for a company whose product is based on APIs to create custom dashboards that show their team the current status of the APIs that are critical for their product. If certain APIs are down, then their product is either down or partially down from the point of view of their customers. […]

Continue reading

How to Use the Results From One API Call in Another API Call

In many cases, the availability of your product depends on a sequence of API calls (to both external and internal APIs). Information retrieved from one API may be a critical input for your subsequent call to a different API. If the first call fails, the second can’t return a valid result. So, a question is: […]

Continue reading

Validating API Responses and Performance Using JavaScript

Determining the present state of an API that’s critical to your product’s performance is the reason why companies apply API monitoring on a 24/7 basis. If your product depends on a sequence of calls to multiple APIs (perhaps internal as well as external), your product could appear “down” to your customers if even one of […]

Continue reading

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 reading

Using 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 reading

Using 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 reading

Using 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 reading

Using 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