Creating a REST V2 Resource
To build a REST V2 resource, first create an empty REST V2 resource or a REST V2 resource based on an existing document type and then define operations and attributes for the resource.
![*](icon_task_xpe.png)
To create a REST V2 resource
1. In the Service Development perspective, select File > New > REST Resource.
2. In the New REST Resource dialog box, select the package or folder in which you want to create the REST resource.
In the
REST resource name field, type a name for the REST resource using any combination of letters, numbers, and/or the underscore character. For information about restricted characters, see
About Element Names.
3. Click Next.
4. On the Select Source Type panel, do one of the following:
Select | To |
Empty REST Resource | Create an empty REST V2 resource. Use this option if you do not have an existing document type to create the REST V2 resource. |
Document Type Based REST Resource | Create a REST V2 resource from an existing IS document type. Designer accesses the resource definition from the Integration Server document type and creates the REST V2 resource allocating the properties according to the resource definition. |
5. Select the Generate JSON API URL templates check box if you want Designer to create JSON API compliant URL templates for the REST resource as part of creating the REST V2 resource. For information about the URL template for a REST V2 resource, see
Example of Defining a REST V2 Resource Operation. 6. If you selected Empty REST Resource as the source resource type, click Finish.
Designer adds an empty REST V2 resource to the selected location in the namespace. For the created resource, you can define resource operations. For more information, refer to
Defining a REST V2 Resource
Operation.
If you selected Document Type Based REST Resource, click Next.
7. On the Select Document Type panel, navigate to and select the Integration Server document type.
To select a field from the document type to use as the unique identifier for the REST V2 resource, click Next. Otherwise, click Finish.
Note:
If you selected the Generate JSON API URL templates check box, you must select a field from the document type to use as the unique identifier.
8. On the Select Unique Identifier panel, select the field in the document type to use as the unique identifier for the REST V2 resource.
Note:
Only fields of type String can be used as the unique identifier.
9. Click Finish.
Designer adds a REST V2 resource created from an existing document type with the resource operations and attributes already defined.