Testing the Prediction Studio APIs
3 Tasks
10 mins
Scenario
The Prediction Studio APIs facilitate the monitoring and management of predictions remotely, using the scripting language of your choice. They offer endpoints for various operations, such as getting a list of Predictions and their attributes, introducing a challenge model, and more. These operations are categorized under Data export, Models, Reporting, Predictions, and Prediction Studio. As a System Admin, you generate the client credentials that provide access to the APIs, and then inspect the API responses.
Use the following credentials to log in to the exercise system:
| Role | User name | Password |
|---|---|---|
| System Admin | SystemAdmin | rules |
Your assignment consists of the following tasks:
Task 1: Generate the ADM export artifacts
Generate the dataflows to export the ADM model and predictor snapshots.
Task 2: Generate a Client ID and a Client Secret
Generate a Client ID and a Client Secret for access to the Prediction Studio APIs.
Task 3: Inspect the API responses
Use REST calls to try out the Prediction Studio APIs.
Challenge Walkthrough
Detailed Tasks
1 Generate the ADM export artifacts
- Log in as a System Architect:
- In the User name field, enter SystemAdmin.
- In the Password field, enter rules.
- In the header, click PEGAInfinity '26, and then switch to Prediction Studio.
- Click Actions > Export > Export monitoring database.
- In the Export monitoring database dialog box, select filerepo from the Repository dropdown list and click Export to generate the export artifacts.
- In the header, click PREDICTION STUDIO, and then switch to INFINITY STUDIO.
2 Generate a Client ID and a Client Secret
- In the header of Infinity Studio, click Create > Security > OAuth 2.0 Client Registration to create a new OAuth 2.0 Client Registration.
- In the OAuth 2.0 Client Registration short description field, enter Prediction APIs.
- In the Client Name field, enter PegaClient.
- Click Create and open.
- Configure the Client Registration:
- In the Supported grant types section, select Client credentials, and then, in the Operator ID field, enter or select DataScientist.
- In the Client Credentials section, click View & download, and then click Download credentials.
- Securely store the PegaClient_ClientCredentials text file that contains the Client ID and the Client Secret for later reference.
- Close the dialog boxes, and then click Save to complete the OAuth 2.0 Client Registration.
3 Inspect the API responses
- In the left navigation of Infinity Studio, click Channels > Pega API.
- In the Service package field, select Prediction APIs, and then click Authorize.
- In the ClientCredentials (OAuth2, clientCredentials) section, enter the Client ID and the Client Secret from the PegaClient_ClientCredentials text file that you saved in the previous task, and then click Authorize.
- Confirm that the client is authorized, and then click Close.
- In the Models section, click the GET /V1/models API to list the models that are part of the application.
- Click Try it out, and then click Execute.
- Review the content of the server response body, and take note of the modelId of the Web Click Through Rate GB Customer adaptive model.
- In the Models section, click the GET /v1/models/{modelID} API to get a description of the model, and then click Try it out.
- In the modelID field, enter DATA-DECISION-REQUEST-CUSTOMER-CDH!WEB_CLICK_THROUGH_RATE_GB_CUSTOMER to get a description of the Web Click Through Rate Customer adaptive model, and then click Execute.
- In the server response body, review the modeling technique, the target and alternative labels, and the predictors of the adaptive model.
- In the Data export section, click the POST /v1/datamart/export API to trigger the export of the datamart.
- Click Try it out, and then paste the below given string in the body of the Edit Value | Schema section:
{
"exportLocation": "repo name"
}
- Click Execute.
- On the enablement landing page, click Application Switcher > Filebrowser.
- Log in to the repository:
- Username: pega-filerepo
- Password: pega-filerepo
- Open the datamart folder and inspect the exported model snapshots and predictor snapshots files.
Available in the following mission:
Want to help us improve this content?