Skip to main content
Previous sectionNext section

Introduction to the Caché Source Code File REST API

This REST API provides access to Caché source code files. We developed this API to allow Atelier, our Eclipse-based IDE, to access Caché class definitions, routines, and CSP files on a Caché server. You can use the API to perform the actions needed to access Caché classes, routines, and CSP files. These actions include:

  • Getting the namespaces available on a Caché instance

  • Finding the class definitions, routines, and CSP files defined in a namespace

  • Getting the text definitions of the classes, routines, and CSP files

  • Updating a class definition, routine, or CSP file

  • Creating a new class definition, routine, or CSP file

  • Deleting a class definition, routine, or CSP file

  • Compiling a Caché class or routine

  • Discovering properties of the Caché environment by performing SQL queries on tables

These actions provide the mechanisms to access Caché source code files. In order to create a Caché development environment, you should understand this API and have a comprehensive understanding of how the Caché source code files are used within Caché.

This is a special-purpose API. If you are creating a development environment or working on a similar application, such as a class browser, you may find this API useful. But, it is not a general-purpose REST API to access Caché objects.

If you want information about downloading Atelier and about using Atelier to develop Caché applications, see http://www.intersystems.com/atelier, the Atelier home page, which provides links to downloading instructions and to the Atelier documentation.

This document describes versions 1 and 2 of the Caché Source Code File REST API. Version 1 was first provided by Caché 2016.2 and version 2 by Caché 2017.2. Future releases of Caché may support higher versions of this REST API that provide additional calls, but you will always be able to call the earlier versions. The APIs for version 1 include /v1/ in the URL and the APIs for version 2 include /v2/. You can find out the version of this API that is provided by Caché by calling the GetServer method.

The following describes the major capabilities of the API and the methods that provide them:

  • Getting information about the server environment:

    • GetServer method provides the important information about the server including the namespaces on the server.

    • GetNamespace method provides additional information about the specified namespace. It includes the list of databases that are mapped to the namespace.

    • HeadServer method provides header information about the server. You can call HeadServer to check if the server is available.

    • GetJobs method provides information about the jobs running in Caché.

    • GetCSPApps method provides information about the CSP applications. These applications provide access to Caché.

  • Getting information about source code files:

    • GetDocNames method provides the names of the source code files in the namespace. You can optionally limit the files to a specific category of files or with a specific file type.

    • GetModifiedDocNames method provides the same names as GetDocNames, but additionally provides a hash for the database state. If you keep a local copy of the file, you can call GetModifiedDocNames and see if the document has changed since you last retrieved it.

    • GetDoc method gets the contents of the specified source code file. You can optionally use the ETAG and If-None-Match headers to only get the contents of the source code file if it has changed since the previous time you retrieved it.

    • GetDocs method gets the contents of the specified files.

    • Index method provides some key properties of the class definitions in the namespace. Your application can use this information to select the class definitions to access.

    • HeadDoc method provides header information about source code files.

  • Creating, updating, and deleting source code files

    • PutDoc method updates an existing source code file, or, if the file does not exist, creates a new source code file.

    • DeleteDoc method deletes the specified source code file.

    • DeleteDocs method deletes the specified list of source code files.

  • Compiling source code files

    • Compile method compiles the source code file.

  • Performing SQL queries to get information from Caché tables

    • Query method performs an SQL query on any Caché database.

  • Searching in source code files

    • Search method searches source code files in the Caché database.

  • Special calls for dealing with Ensemble classes