Creating REST URIs to submit records
About this task
Procedure
Example
Examples
The following REST URI template to submit a record was created by using the New REST URI wizard. In this example, ALMActivity was selected from the Record Type list and the check boxes Automatically save changes, Automatically log in, and Include the banner, workspace tree, and main toolbar were selected to create the REST URI.
http://CQWebServerHost/cqweb/restapi/YourConnection/YourUserDB/RECORD?format=HTML&recordType=ALMActivity&fieldsXml=&autoSave=true&loginId={{loginid}}&password={{password}}
- CQWebServerHost
- Web address of your Rational ClearQuest Web server host system. This value is defined when the REST URI template is created.
- YourConnection
- Your Rational ClearQuest connection. This value is defined when the REST URI template is created.
- YourUserDB
- Your Rational ClearQuest user database. This value is defined when the REST URI template is created.
- format
- The default format for the resource request is HTML. You can change the format to XML or ATOM, if desired.
- {{loginid}}
- Replace with your logon ID.
- {{password}}
- Replace with your password.
The following examples show how to enter date field, reference field, reference list, and multiple-line field values as parameters in a REST URI.
- This example shows how to supply a date field value as a parameter
in a REST URI to submit or modify a record:
fieldsXML=<Field><Name>f_datetime</Name><Value><![CDATA[2008-09-08%2009%3A44%3A34]]></Value></Field>
Result: The record field f_datetime is set to 08/09/08 09:44:34.
- The next example shows how to supply a reference field or reference
list values as parameters in a REST URI to submit or modify a record:
fieldsXML=<Field><Name>customer</Name><Value><!CDATA[Joe%20Lee]]></Value><Value><!CDATA[Jane%20Smith]]></Value></Field><Field><Name>Project</Name><Value><!CDATA[Classics]]></Value></Field>
Result: In the reference list customer in the record, Joe Lee and Jane Smith are added, and in the reference field Project, Classics is added.
- This example shows how to supply a multiple-line field value as
a parameter in a REST URI to submit or modify a record:
fieldsXML=<Field><Name>Description</Name><Value><![CDATA[firstline%0Asecondline]]></Value></Field>
Result: In the record field Description, the text firstline and secondline are formatted to appear on separate lines.