Adding Custom Headers in REST Outbound Proxy Business Service Methods
There may be some scenarios where the header parameters are not defined in the JSON specification, or where customers want to add some custom headers that are not part of JSON specification. In these scenarios, headers or custom headers can be added as method arguments. For more information, see Overview of Custom Headers in REST Outbound Proxy Business Service Methods.
To add a new custom header parameter:
-
Create a new Workspace.
-
In your list of pre-existing proxy business services, select a required proxy business service, select required method, and then locate your method arguments.
-
Add a new argument record giving it an appropriate name to the new header argument.
-
Append the suffix
:header
to the parameter name.For example, if the parameter name is
myFirstHeader
, then the complete parameter name is:myFirstHeader:header
. -
Update the values in the Type column to specify whether your header is an input header or an output header.
-
(Optional) Update the values in the Storage Type to Property.
To the new method argument, add a use property with the following details:
-
Name. Type
-
Data type. This can be string, integer, or boolean and must be entered in lowercase.
Note: Data type is required when assigning this parameter value to the outgoing JSON payload. The value is usually string for headers.
The following figure shows an example of a Business Service Method Argument User Property called
type
. It has the valuestring
, this indicates that theapi_key:header
is of type string.Note: There is no direct mapping between a Siebel data type and a JSON data type, therefore Siebel REST API uses this user property to specify what JSON data type to use when sending the HTTP request.-
-
Save the new argument and its user property, and deliver the workspace.
You can now pass values to this new method argument at runtime. This argument is converted into a header parameter during the outbound REST endpoint call.