Creates new template with given details for the entire system.
post
/oam/services/rest/ssa/api/v1/template/{name}
Creates a new template.
Request
Supported Media Types
- application/json
Path Parameters
-
name(required): string
Unique Name of the Template
Template that needs to be created
Root Schema : Template
Type:
Show Source
object
-
defaultValue:
string
Default value to be used in case the template processing fails.
-
description:
string
Details describing the intent of this template.
-
dynamicParams:
array dynamicParams
To use dynamic parameters while defining valueTransformation and valueFiltering, they must be added here.
-
transformFirst:
boolean
Default Value:
false
If set to true then valueTransformation will be applied before valueFiltering. -
valueFiltering:
object ValueFiltering
-
valueMapping(required):
string
We can specify the source for value of a template.
-
valueTransformation:
array valueTransformation
Nested Schema : dynamicParams
Type:
array
To use dynamic parameters while defining valueTransformation and valueFiltering, they must be added here.
Show Source
Nested Schema : ValueFiltering
Type:
Show Source
object
-
params:
array params
Parameters for the java method used in populateIf or populateIfNot tag.
-
populateIf:
string
Returns claim value only if the result of this filter java method is true.
-
populateIfNot:
string
Returns claim value only if the result of this filter java method is false.
-
type:
array type
Type of the parameters.
Nested Schema : params
Type:
array
Parameters for the java method used in populateIf or populateIfNot tag.
Show Source
Nested Schema : ValueTransformation
Type:
Show Source
object
-
operation(required):
string
Java method name used as transformation operation.
-
params:
array params
Parameters for the java method used in operation tag.
-
type:
array type
Type of the parameters.
Nested Schema : params
Type:
array
Parameters for the java method used in operation tag.
Show Source
Response
Supported Media Types
- application/json
200 Response
OK.
Root Schema : Template
Type:
Show Source
object
-
defaultValue:
string
Default value to be used in case the template processing fails.
-
description:
string
Details describing the intent of this template.
-
dynamicParams:
array dynamicParams
To use dynamic parameters while defining valueTransformation and valueFiltering, they must be added here.
-
transformFirst:
boolean
Default Value:
false
If set to true then valueTransformation will be applied before valueFiltering. -
valueFiltering:
object ValueFiltering
-
valueMapping(required):
string
We can specify the source for value of a template.
-
valueTransformation:
array valueTransformation
Nested Schema : dynamicParams
Type:
array
To use dynamic parameters while defining valueTransformation and valueFiltering, they must be added here.
Show Source
Nested Schema : ValueFiltering
Type:
Show Source
object
-
params:
array params
Parameters for the java method used in populateIf or populateIfNot tag.
-
populateIf:
string
Returns claim value only if the result of this filter java method is true.
-
populateIfNot:
string
Returns claim value only if the result of this filter java method is false.
-
type:
array type
Type of the parameters.
Nested Schema : params
Type:
array
Parameters for the java method used in populateIf or populateIfNot tag.
Show Source
Nested Schema : ValueTransformation
Type:
Show Source
object
-
operation(required):
string
Java method name used as transformation operation.
-
params:
array params
Parameters for the java method used in operation tag.
-
type:
array type
Type of the parameters.
Nested Schema : params
Type:
array
Parameters for the java method used in operation tag.
Show Source
422 Response
Template : already exists.
Root Schema : Error
Type:
Show Source
object
-
error:
string
Error code
-
error_description:
string
Error description
Examples
cURL Sample Request 1
curl -X POST https://<admin-host>:<admin-port>/oam/services/rest/ssa/api/v1/template/website \ -H 'Accept: application/json' \ -H 'Authorization: Basic dGVzdDp0ZXN0=' \ -H 'Content-Type: application/json' \ -H 'cache-control: no-cache' \ -d '{ "valueMapping": "$user.attr.website", "valueFiltering": { "populateIf": "startsWith", "params": [ "https" ] }, "valueTransformation": [ { "operation": "toLowerCase" } ] }'
cURL Sample Request 2
curl -X POST https://<admin-host>:<admin-port>/oam/services/rest/ssa/api/v1/template/customemail \ -H 'Accept: application/json' \ -H 'Authorization: Basic dGVzdDp0ZXN0=' \ -H 'Content-Type: application/json' \ -H 'cache-control: no-cache' \ -d '{ "dynamicParams": [ "$user.attr.familyName", "$user.attr.custom2" ], "valueMapping": "$user.attr.givenName", "valueTransformation": [ { "operation": "join", "params": [ ".", "$user.attr.givenName", "$user.attr.familyName" ], "type": [ "CharSequence", "CharSequence[]" ] }, { "operation": "concat", "params": [ "@" ] }, { "operation": "concat", "params": [ "$user.attr.custom2" ] }, { "operation": "concat", "params": [ ".com" ] } ] }'