Software AG Products 10.7 | Using CentraSite | Asset Management | Managing Assets through CentraSite Business UI | REST Service Management | Adding REST Service from Scratch | Adding Endpoints to REST Service
 
Adding Endpoints to REST Service
After you define the REST Service, you then expose the REST Service's endpoints. An endpoint path includes the hostname of the server where the REST Service is actually hosted.
When you configure the global details for a REST Service, keep the following points in mind:
*An endpoint is the core design element that serves as the only way to access the identified REST Service.
REST Services endpoints are defined as REST Servers. CentraSite allows you to configure multiple Server URL's for the REST Service. REST Server consist of Server URL and Server Variables. The Server URL of an API is constructed by the domain, port, and server variables by enclosing them in curly braces. Use these variables to add a default value, and optionally one or more values and a description.
For example:

url: https://{subdomain}.site.com/{version} // Server URL
description: The main prod server
variables:
subdomain: // Server Variables enclosed in curly braces in Server URL
default: production // default value for Server Variables
version:
enum: // Possible values for Server Variables
- v1
- v2
default: v2
The variable values are replaced to form endpoint for API.
For example:

https://production.site.com/v1

https://production.site.com/v2
*REST Service parameter is an expression that represents a value that the client passes to the REST Service specified in the client call. Since the parameters are defined at the REST Service level, the parameters will be available for all child resources and methods below the REST Service in the hierarchy.
Configure the endpoints for the REST Service using which users would traverse to any of the REST Service's resources. In order to execute this task, you must know the URL of the server that is hosting the REST Service you intend to model.
*To add a endpoint
1. In CentraSite Business UI, access the Advanced Search panel in one of the following ways:
*Click the Browse link in the upper-left corner of the menu bar.
*Click the Search icon next to the Scope list. The default search scope is Assets.
This displays a list of assets in the Search Results page.
2. In the Additional Search Criteria list, select Asset Types.
3. To search for the assets of type, REST Service, click Choose.
This opens the Choose Asset Types dialog box.
4. In the Choose Asset Types dialog box, select the Assets option button, and perform the following:
a. Click the chevron next to Assets option button.
A list of defined asset types in CentraSite is displayed.
b. In the list of asset types, select REST Service.
c. Click OK.
A list of defined REST Service assets is displayed in the Search Results page.
5. Click the REST Service you want to add the endpoint.
This opens the REST Service details page. Also, the Actions bar displays a set of actions that are available for working with the REST Service.
6. On the Actions bar of the REST Service details page, click Edit.
7. Select the Technical Details profile. Click Add Endpoint and provide the required information for each of the displayed data fields.
Field
Description
Server URL
The server URL for the REST Service.
Note:
If you are specifying multiple endpoints for a REST Service, it must be unique among all URLs in the REST Service.
Description
(Optional) Description of the endpoint.
Sandbox
(Optional). The sandbox category using which you want to classify endpoints for the REST Service.
a. Click Choose.
A list of defined sandbox categories is displayed in the Choose dialog box.
b. Click the chevron next to a Sandbox taxonomy to expand the categorization tree.
c. Select the check box of the category you want to use for classifying the endpoint.
d. Click OK.
CentraSite includes a set of predefined categories for the taxonomy node Sandbox, especially for classifying endpoints of REST Services. By default, the endpoints can be classified into the following predefined categories - Development, Production, Test.
For information on the Sandbox categories that CentraSite supports out-of-the-box, in CentraSite Control, go to Administration > Taxonomies. In the Taxonomies page, navigate to Sandbox in the list of taxonomies.
If you want to use sandbox categories that are not supported by CentraSite, you can define your custom categories.
Note:
Although it is possible to define subcategories for the predefined and custom categories within the Sandbox taxonomy, you cannot use these subcategories to classify the endpoints. CentraSite only displays the names of the top-level categories (that is, categories that are defined for the Sandbox taxonomy) for the classification.
Add Parameter - Add Variable (link)
A variable is part of a Server URL. The possible and default value provided to the variable, form valid endpoints for accessing an API. Click Add Variable and provide the following information:
a. Name: Name of the parameter.
b. Description: Description of the parameter.
c. Possible Values: Possible values of the parameter.
To specify additional possible values, use the plus button (+) next to the textbox to create a new possible values input field, and type another value.
To remove a possible value, use the minus button (-).
d. Default Value: (Mandatory) Default value of the parameter. If you have defined possible values, then default value should be one of the defined possible values.
8. Provide the following details in the Technical Details profile.
Field
Description
Namespace
The namespace for request or response message.
Request Content-Type
The content format for request message. (The Request Content-Type displays a list of the supported content formats for the REST Service.) By default, this field shows an empty value.
Response Content-Type
The content format for response message. (The Response Content-Type list displays a list of the supported content formats for the REST Service.) By default, this field shows an empty value.
API Parameters - Add Parameter
(Optional). One or multiple request parameters at the REST Service (API) level. The supported parameters types are:
*Query-String
*Header
*Form
Although CentraSite allows you to define parameters of the type, Form, at the REST Service level, these parameters are not supported at run-time. Only parameters of the type - Query-String and Header, are supported at run-time.
Note:
You cannot add more than one parameter with the same name and the same type at the REST Service level.
a. Click the Add Parameter link.
This opens the Add Parameter dialog box.
b. In the Add Parameter dialog box, specify an input parameter for the REST Service.
To specify multiple parameters, click the Add Parameter link to add each new parameter.
The newly created parameter is added to the Technical Details profile.
To further update the new parameter, hover over the required parameter, and click the Edit icon. Repeat for each parameter for which you want to modify the details.
9. Click Save.