Creating REST URIs to view records

You can create REST URIs to view records in your user database by linking directly to the records. The REST URI that you create to view a record opens the record faster than the REST URI that you create to find a record. The reason is that when you create a REST URI template to view a record, you must specify the record type, which narrows the search scope.

About this task

To create a REST URI to view a record:

Procedure

  1. On the HCL Compass Web toolbar, click the arrow next to New Change Request and select New REST URI. The New REST URI wizard opens.
  2. Select View a record from the REST URI Type list.
  3. Select a record type from the Record Type list.
  4. Optional: To add HCL Compass Web logon parameters to the REST URI, select the Automatically log in check box.
  5. Optional: To include the banner, workspace tree, and main toolbar in the window that opens when the REST URI runs, select the Include the banner, workspace tree, and main toolbar check box.
  6. Click Create.
    The REST URI template appears in the REST URI Template field.
  7. Copy the template into a text editor and replace the placeholders, enclosed by double curly brackets {{ }}, with appropriate values.

    Optional: Change the default format for the resource request from HTML to XML or ATOM.

  8. Copy the modified template into your Web application or another Web browser window.
  9. Click Reset to create a new REST URI template or Close to exit.

Example

Example

The following REST URI template to view a record was created by using the New REST URI wizard. In this example, ALMActivity was selected as the value for Record Type when creating the REST URI.

http://CQWebServerHost/cqweb/restapi/YourConnection/YourUserDB/RECORD/{{recordId}}?format=HTML&recordType=ALMActivity&loginId={{loginid}}&password={{password}}
The variables and template placeholders have the following meanings:
CQWebServerHost
Web address of your HCL Compass Web server host. This value is defined when the REST URI template is created.
YourConnection
Your HCL Compass connection. This value is defined when the REST URI template is created.
YourUserDB
Your HCL Compass user database. This value is defined when the REST URI template is created.
{{recordId}}
Placeholder for the record ID to which you want to link.
format
The default format for the resource request is HTML. You can change the format to XML or ATOM, if desired.
{{loginid}}
Replace this placeholder with your logon ID.
{{password}}
Replace this placeholder with your password.