Passing API templates
In REST requests, the _templateKey
and _templateId
parameters reference templates that are stored in the database. Because the templates are accessed
by reference, REST requests that use templates are lightweight, and multiple users can share a
single centrally managed template.
Managing templates in the database
You can create, read, update, and delete API templates with three APIs. For detailed information about these APIs, view the API Javadoc files.
manageApiTemplate
getApiTemplateDetails
getApiTemplateList
You can access "ApiTemplate" APIs by specifying the resource name api_template
in REST Detail, List, Modify, Create, or Delete requests.
POST http://host:port/contextRoot/restapi/api_template
The PLT_API_TEMPLATE
table is used to store the XML-based API and Resource
templates. The description is as follows:
Entry | Description |
---|---|
ORGANIZATION_CODE |
Organization identifier that is used in multi-tenant architectures |
TEMPLATE_TYPE |
The value of
The value of |
API_NAME |
Name of the API or Resource |
TEMPLATE_ID |
Identifier within the org+type+name |
DESCRIPTION |
Extra description information |
TEMPLATE_DATA |
Character Large Object column that contains the template |
Referencing templates
public void setApiTemplate(String apiName, String templateFileName)
templateFileName
:
templateFileName format |
REST query parameter format |
---|---|
"key:primaryKey" |
_templateKey=primaryKey |
"id:orgCode,templateId" |
_templateId=orgCode,templateId |
DEFAULT
.