Skip to main content
First, you need to create a service package:
  1. Click the Records tab on the left, expand Integration Resources, right-click Service Package, and select the Create command from the shortcut menu.
  2. 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 click Create and open.
  3. 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>).
    Note: To view the list of available access groups, click the Records tab on the left and navigate to Security → Access Group.
  4. Click Save.
Next, you need to add a new role to the access group to enable users to access the Web API:
  1. Go to the newly created access group by clicking Records → Security → Access Group → ABBYYFC:Administrators/ABBYYFC:Users.
  2. In the Available roles field, add a PegaRULES:PegaAPI role.
Now you need to create a new service:
  1. Click the Records tab on the left, expand Integration-Services, right-click Service REST, and select the Create command from the shortcut menu.
  2. On the form that opens, specify the following:
    • Service name: files
    • Service package name: customapi
    • URI Template: cases/{id}/files/{name}
    • Service version: v2
  3. Click Create and open.
  4. 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. Then type Param.FileName for the name parameter.
  5. Click the Methods tab. Expand the POST method and on the Request tab, specify the following for the Message data fields:
    • Description: Request Data
    • Map to: Clipboard
    • Map to key: Param.Request
  6. Click the Response tab and create three response conditions:

Process what

Parameter values

Header fields

Message data

pxIsInternalError

  • Condition: When
  • When name: pxIsInternalError
  • Content type: application/json
  • Status code: Param.StatusCode
  

pxIsErrorResponse

  • 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

  • Condition: Default
  • Content type: application/json
  • Status code: Param.StatusCode
  • Name: location: Map from: Clipboard; Map from key: Param.Location
  • Name: etag; Map from: Clipboard; Map from key: Param.eTag
  • Description: Response
  • Map from: Clipboard
  • Map from key: Param.Response
Make sure that the URL of the service method is as follows: https://Server_Name/prweb/PRRestService/customapi/v2/cases/{id}/files/{name}. Otherwise, the connector will return an error when the user attempts to export a file to Pega.