The MIP Advance API tutorials are designed to give you a basic understanding of how to write client code for the API. To keep the setup and the sample code as simple as possible, we use HTML and the jQuery ajax() method in all our tutorial examples. There are many other ways of calling REST API methods from a variety of languages, but the basic principles remain the same as those described here. (For a further discussion of this point, see HTTP and the REST API.)
Previous experience with jQuery is not necessary to run the sample code and follow the explanations.
Most of the tutorials on this site include sample code. Please be aware that these examples are designed to be as simple as possible, so that they can be read and understood by a relative novice. They should NOT be considered to represent recommended syntax or programming practice for production code.
In order to use the tutorials, you will need three things:
If jQuery is already installed on your machine, make sure you know the complete path of its location. If it is not, you can install it using npm or bower, or simply download it from the jQuery site. Another alternative is to use a hosted library from Google or another provider; we use this option in our examples.
If you are not familiar with jQuery and want to test whether you can access it correctly, type the
following code into your text editor and save it under the filename test.html
. If you have jQuery
installed locally on your machine and want to use that instead of the web-hosted version, substitute its path (beginning with "C:\")
and filename for the URL in line 3.
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> <script> $(document).ready(function() { document.write("jQuery Found!"); }); </script> </head> </html>
Open your new test.html
file with your web browser. If you have correctly specified the path
or URL for jQuery, the resulting page displays the text "jQuery Found!" If the page is blank, check your path or URL and your jQuery
filename.