Create a service package
1
Start a new service package
Click the Records tab on the left, expand Integration Resources, right-click Service Package, and select the Create command from the shortcut menu.
2
Name the package
On the Create Service Package form, type
customapi in the Service Package Name field. Provide a description for the package in the Short description field, and then click Create and open.3
Specify the access group
On the Edit Service Package form, specify an access group in the Service access group field. The format of the group is
<Application_name>:<Access group>.To view the list of available access groups, click the Records tab on the left and navigate to Security → Access Group.4
Save the package
Click Save.
Add the Web API role to the access group
Adding this role enables users to access the Web API.1
Open the access group
Click Records → Security → Access Group → ABBYYFC:Administrators/ABBYYFC:Users.
2
Add the role
In the Available roles field, add a
PegaRULES:PegaAPI role.Create the service
1
Start a new Service REST
Click the Records tab on the left, expand Integration-Services, right-click Service REST, and select the Create command from the shortcut menu.
2
Specify the service details
On the form that opens, specify the following values, and then click Create and open.
3
Map the URL path parameters
Click the Service tab and type
Pega-API-CaseManagement in the Pega class field.In the URL path parameters section, type Param.CaseId in the Map to Key column for the Id parameter, and then type Param.FileName for the name parameter.4
Configure the POST request
Click the Methods tab. Expand the POST method and, on the Request tab, specify the following for the Message data fields:
5
Create the response conditions
Click the Response tab and create the three conditions described in Response conditions.
Response conditions
Create the following three conditions on the Response tab.pxIsInternalError
Parameter values:- Condition:
When - When name:
pxIsInternalError - Content type:
application/json - Status code:
Param.StatusCode
pxIsErrorResponse
Parameter values:- Condition:
When - When name:
pxIsErrorResponse - Content type:
application/json - Status code:
Param.StatusCode
- Description:
Response - Map from:
Clipboard - Map from key:
Param.Response
Success response
Parameter values:- Condition:
Default - Content type:
application/json - Status code:
Param.StatusCode
- Name
location, with Map from set toClipboardand Map from key set toParam.Location - Name
etag, with Map from set toClipboardand Map from key set toParam.eTag
- Description:
Response - Map from:
Clipboard - Map from key:
Param.Response
