Accessing a Pega application using the Pega API
1 Task
5 mins
Scenario
You are a Solution Builder working on TGB's HRApps application. TGB HR wants external systems to automatically create Employee Evaluation Cases through the Pega API, replacing manual case initiation. To enable this, you will configure secure OAuth 2.0 authentication and verify that an external system can successfully create a Case by using the API.
The following table provides the credentials you need to complete the challenge:
| Role | User name | Password |
|---|---|---|
| Solution Builder | SSA@TGB | pega123! |
After completing this challenge, you should be able to:
- Configure an OAuth 2.0 Client Registration for API authentication.
- Authorize and test the Pega API by using OAuth 2.0 client credentials.
Detailed Tasks
1 Accessing a Pega application using the Pega API
Use the technical documentation linked in the Journey map above to complete the assigned tasks. The technical documentation might have more information than you need to complete the tasks.
Acceptance criteria
Task 1: Configure OAuth 2.0 authentication
- An OAuth 2.0 Client Registration is created with the following configuration:
Field Value Short description EmployeeEvalutionAuthentication Client name EmployeeEvalutionAuthentication Supported grant types Client credentials Access group HRAppsV2:Administrators - The client credentials are downloaded and saved locally as EmployeeEvalutionAuthentication_ClientCredentials.txt.
Task 2: Test Case creation through the Pega API
- The Pega API is authorized by using the
client_idandclient_secretfrom EmployeeEvalutionAuthentication_ClientCredentials.txt under the Constellation DX APIs service package. - The
POST /casesendpoint is executed with the following request body:<code>{
"caseTypeID": "TGB-HRApps-Work-EmployeeEvaluation",
"parentCaseID": "",
"processID": "pyStartCase",
"content": {
"Employee": {
"pyFirstName": "Mario",
"pyLastName": "Rossi",
"Manager": "SSA@TGB",
"Department": "Consulting"
},
"StartDate": "20300601",
"EndDate": "20301231"
},
"pageInstructions": [],
"attachments": []
}</code> - The response body contains the generated Case ID for the new Employee Evaluation Case.
Directions
- Create a new OAuth 2.0 Client Registration named EmployeeEvalutionAuthentication, and configure the grant type and access group as detailed in the Acceptance criteria.
- Download the client credentials.
- Open the Pega API, select the Constellation DX APIs service package, and authorize by using the credentials from EmployeeEvalutionAuthentication_ClientCredentials.txt.
- Execute the
POST /casesendpoint with the request body detailed in the Acceptance criteria, and verify that the response body contains a Case ID.
Want to help us improve this content?