CentraSite Documentation : Working with REST-based APIs : Modeling a RESTful API : Configuring REST Resources : Adding a Resource to the REST API
Adding a Resource to the REST API
In this task, you identify the resource of the API, and capture the resource URI for the API. Indirectly, a URI address implies the relationship between each of the resources.
To add a resource
1. Display the details page for the REST API that you want to configure. If you need procedures for this step, see Viewing the Details of a REST API.
2. In the actions bar for the API, click Edit  icon.
3. Navigate to Advanced Information > Resource and Methods profile.
4. Click Add Resource link.
5. In the Add Resource dialog box, enter the following information in the fields provided:
In this field...
Do the following...
Name
Mandatory. Enter a display name for the new resource.
Note:  
If you are specifying multiple resources for an API, the name must be unique among all resources in the API.
Resource Path
Mandatory. Enter the new resource URI. Structure the URI with the simple tips and guidelines described above.
Important:  
When you specify a path parameter in the resource URI, as a best practice, we recommend that you adopt the following conventions:
*Append the path parameter variable within curly {} brackets.
*Specify the path parameter variable to exactly match with the path parameter.
Description
Optional. Enter a description for the new resource.
Note:  
This is the description information that users will see when they view instances of this type in the user interface, therefore, the description should be meaningful.
Schema
Optional. Specify a XML Schema Definition (XSD) file for the new resource.
Documents
Optional. Specify one or more input files for API.
You can use the Browse button to navigate to the required folder.
If you want to specify additional input files, use the plus button to create a new input field, and then use the Browse button to select another input file.
Parameters - Add Parameter (link)
Optional. Specify one or more request parameters at the resource level.
Note:  
You cannot add more than one parameter with the same name and the same type within the resource.
a. Click the Add Parameter link to open the Add Parameter dialog.
b. In this dialog, you define input parameters at the resource level. To specify multiple parameters, click on the Add Parameter link to add each new parameter.
The new parameter is added to the resource. For a complete description of how to add the request parameters, see Adding a Parameter to the REST API.
For each method, depending on the requirements, you can specify the path parameters, query parameters, and header parameters.
6. Expand the resource to view details of the newly added resource.
7. To further update the new resource, click Edit . Repeat for each resource that you want to modify.
8. To specify multiple resources, click the Add Resource link to add each new resource.
9. After you specify the value for all of the required fields, click Save  to save the API.
Copyright © Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback