Exploring the HTTP API using a REST Client

Using a REST Client

You can examine the structure of the API using a browser or REST client. A number of these are available as extensions to browsers such as:

Note: Internet Explorer is not recommended for the testing of these requests, as it opens the JSON response into a file.

Enter the following URL into the appropriate REST client. Use the GET method. We are asking for the response to be returned using JSON by adding the .json parameter:

http://localhost:4355/geognosis/8.0.json

http://servername:instance_port_number/geognosis/8.0.json

You will get the following response (using REST Client for FireFox). This displays the paths available at this level:

You can start to move around the structure using the paths available (in green above).

For example, to see which data files are currently available, being served as Data Files, use

http://localhost:4355/geognosis/8.0/Maps.json

Here, there are two Data Files (SWDs) called HTTPTest and SSSI. Just extend the URL in use to examine further the structure of the SWD.

At any time you can use the Operations prompt, adding a ? to the end of the request to see the operations currently available to you.

Because we are viewing preloaded Data Files, these are read only. This limits the available requests to GET only.

At the top level of the API, you have access to the following options:

Account – displays authentication and security set on the GeognoSIS instance.

Basemaps - Basemaps.json gives access to .bdb files in the GeognoSIS\Basemaps\folder. You can get the .bdb tiles from there if you want to access a GeognoSIS tile cache.

Configuration – provides access to all GeognoSIS instance configuration options, accessible through the GeognoSIS Manager. You will be prompted for a username and password to access this section. Use the Administrator user and password defined for the relevant GeognoSIS instance.

Files - Files\Home.json gives access to files and folders of the home directory of the account you used to connect to GeognoSIS (usually the Guest account, unless you use non-anonymous authentication). You can edit the home directory with GeognoSIS Manager.

Files\Shared.json gives access to the files and folders of the virtual data folder specified in GeognoSIS Manager.

You can create and delete folders, dataset files and NOLs there. You can use it as a private or shared scratch area.

With APIs such as NolInsert or InsertDataset you can specify either an absolute file path, or a relative URL to a matching file resource somewhere below Files.json.

Maps – displays the Data Files defined in the GeognoSIS Manager.

Options – displays GeognoSIS options, also accessible through the GeognoSIS Manager.

Sessions – displays the sessions currently accessible on the GeognoSIS instance.


Top of page

Send comments on this topic.

Click to return to www.cadcorp.com

© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).