You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Learning how to use a new tools can be intimidating. Sometimes it is helpful to review a general outline of the tool's functionality before jumping in. Hopefully the following illustration of a typical workflow will help remove some of that new tool anxiety:

Defining a Resource

Developers start by thinking about a resource they want to expose to the internet. A resource can be almost anything, but typically a resource will have a close relationship to a database table in the OpenInsight application. To illustrate, we'll define a resource that relates to a CUSTOMERS database table.

We'll use the Resource Manager to define a resource. Most resources will appear directly underneath the API endpoint (i.e., they are primary resources). To do this we select the api resource node from the Resource Manager tree view, click on the New Resource button, and enter the name of the new resource:

Defining a Resource ID

Is the resource we just defined singular or is it a collection of other resources? In this case, the customers resource is a collection because it represents multiple customers, each of their own unique identifier. Therefore, we need to define a resource ID so any specific customer resource can be identified.

We start by selecting the newly created customers resource node from the Resource Manager tree view, click on the New Resource ID button, and enter the name of the resource ID:


Enabling our Methods

Once a resource endpoint has been defined, we need to define how clients will be able to interact with it by enabling one or more methods. For most database driven resources, CRUD functionality is achieved through the POST (create), GET (read), PUT (update), and DELETE (delete) methods. For our purposes, we'll enable the POST method for the customers resource endpoint (i.e., this is how clients can create a new customer) and we'll enable the GET, PUT, and DELETE methods for the customerID resource endpoint. We'll start by selecting the customers resource node from the Resource Manager tree view and click on the POST checkbox under the Methods block:

Next we'll select the customersID resource node from the Resource Manager tree view and click on the GET, PUT, and DELETE checkboxes under the Methods block:

  • No labels