Skip to main content
The Service REST method receives the exported files into a Pega case. Setting it up takes three parts: a service package, an access role, and the service itself.

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
This condition sets no header fields and no message data.

pxIsErrorResponse

Parameter values:
  • Condition: When
  • When name: pxIsErrorResponse
  • Content type: application/json
  • Status code: Param.StatusCode
Message data:
  • Description: Response
  • Map from: Clipboard
  • Map from key: Param.Response
This condition sets no header fields.

Success response

Parameter values:
  • Condition: Default
  • Content type: application/json
  • Status code: Param.StatusCode
Header fields:
  • Name location, with Map from set to Clipboard and Map from key set to Param.Location
  • Name etag, with Map from set to Clipboard and Map from key set to Param.eTag
Message data:
  • Description: Response
  • Map from: Clipboard
  • Map from key: Param.Response

Service method URL

The URL of the service method has to be exactly as follows:
Otherwise, the connector returns an error when the user attempts to export a file to Pega.