IMatch Developer Center

In this section you’ll find free resources, tutorials and samples for developers. Learn how to write scripts and apps that use IMatch WebServices to access IMatch database contents. The guides in this section are both for the standalone IMatch Anywhere™ product line and for the IMatch WebServices™ embedded in IMatch for Windows 2017 and later.

In most cases IMatch apps will be written using HTML and JavaScript. But you can also use PHP, Python, Go, C#, Windows PowerShell scripts or any other programming language which is able to utilize web services.

Quick Links

The IMatch and IMWS Developer documentation
Code Recipes

Prerequisites

You don’t need much to get started.

Scripts and Apps Included With IMatch

IMatch ships with over 30 simple and more complex scripts. You can find all these scripts in the App Manager panel. Sample scripts use a special Tutorial icon:

IMatch App Manager 2018

Each example demonstrates one or multiple IMWS or IMatch web service endpoints. Open the context menu by right-clicking the icon to see additional commands for Developers:

IMatch App Manager 2018 Menu

This allows you to open the scripts in your web browser (to use the built-in debugger F12) or to open the scripts in your favorite code editor.

Get Yourself a Good Text Editor

Microsoft Visual Studio Code, Atom, Sublime or Notepad++ are good and free choices (see the right column for links). Especially the first three support JavaScript very well, with syntax highlighting, Intellisense and whatnot.

Tip: Open the C:ProgramData\photools.com\IMatch6\webroot folder in your Developer IDE to see all apps and supporting files in a one workspace (e.g. in Visual Studio Code).

Use the Developer Tools in Your Web Browser

All major browsers include developer tools. You can usually reach them by pressing F12. These tools allow you to see the data your browser sends to the server and the replies from the server. You can debug your JavaScript code and have all other kinds of helpful features. Many web developers prefer Google Chrome or Firefox because of their powerful developer tools. Microsoft Edge is now also very good. Check them out and choose your favorite.

See the sidebar on the right for tutorials for the developer tools in your browser.

If you have written IMatch scripts in BASIC before: the developer tools in your browser are a much improved version of the Basic IDE we had in previous versions of IMatch. They allow you to debug both your JavaScript code, see the JSON replies from IMatch WebServices and help you designing your HTML code as well.

Read the IMatch WebServices Documentation

IMWS documents itself. Via the /discover endpoint you can retrieve a JSON document that explains all API endpoints.

For a human-readable documentation, use the IMatch WebServices Documentation App included with IMatch:

IMatch WebServices Documentation App

In IMatch WebViewer

In IMatch WebViewer you can access the documentation via the Gear Icon. Select the Discover IMatch WebServices command in the drop-down menu.

Live Examples

Most of the endpoints in the documentation come with live examples you can click and run. When generating the documentation, IMWS inserts example URLs matching your server automatically.

The IMatch and IMWS Developer Documentation

Click on the link below to open the most recent version of the IMatch and IMatch Anywhere WebServices™ (IMWS) documentation. It includes documentation for all API endpoints, all methods provided by the free IMatch and IMWS JavaScript class libraries, examples and tutorials.

The IMatch and IMWS Developer documentation.

Code Recipes

Jump straight to Code Recipes for a growing list of simple copy & paste examples you can use in your own code.

Using curl

If you come from UNIX or you are into command-line applications, you can use curl to access IMatch WebServices or the embedded IMWS in IMatch.

curl --request GET --compressed http://127.0.0.1:50519/info

Note: Change the port 50519 in the above statement to match the port on which IMWS is listening on your computer.
The --compress option tells curl to decode the GZIPped response from IMWS so you can sea the JSON text data.
See one of the many curl tutorials out there to learn how to do POST or DELETE requests.

Using Windows PowerShell

You can use Windows PowerShell scripts tp access IMatch WebServices or the embedded IMWS in IMatch.

Invoke-RestMethod -Uri http://127.0.0.1:50519/info

Note: Change the port 50519 in the above statement to match the port on which IMWS is listening on your computer.
See one of the many PowerShell tutorials out there to learn how to do POST or DELETE requests.

Using Python

Python is a very popular programming language. With the Python Requests library it is very easy to utilize web services like IMWS.

Download this ZIP file with a small Python sample script that should get you going with IMatch and/or IMatch WebServices. It demonstrates how to authenticate with IMWS and how to request information about all files currently selected in the active file window.