Accessing and testing V2 Prediction API
Explore the possibilities of the V2 Prediction API by testing the endpoints. Each test generates a sample response to a simulated endpoint call, which helps you understand how the endpoint works and what types of responses to expect.
The PredictionStudio service package in Dev Studio holds the settings for the V2 Prediction API. By default, the service package uses the OAuth 2.0 authentication type. OAuth 2.0 is the preferred option that provides more security than basic authentication. For more information about configuring service package settings, see Model context.
- In the header of Dev Studio, click the Resources menu icon, and then click Pega API.
- In the Pega API Help window, from the Service package list, select V2 Prediction API.
- Click Authorize.
- In the Available authorizations window, enter the required
credentials for the scopes that you want to use:
- In the username and
password fields, enter your operator
credentials.The V2 Prediction API is server-specific and not application-specific. You can work with all the predictions on the server to which you have access. Your operator's default access group determines which predictions you can access.
- In the type field, select the authorization
type:
- Request body
- Query parameters
- In the client_id and client_secret fields, enter the OAuth credentials that you saved in Creating and configuring an OAuth 2.0 client registration.
- In the username and
password fields, enter your operator
credentials.
- Click Authorize, and then click
Close.
Result: You can now test the endpoints. - Click the endpoint that you want to test.
Result: The details of the endpoint are displayed, including the description, parameters, and sample responses. - Test an endpoint:
- Click the name of the endpoint that you want to test to expand the section.
- Click Try it out.
- If the endpoint requires additional parameters, enter the information in the required fields.
For example: If you want to test the GET /predictions/model_update/{referenceID}/status endpoint, which retrieves the status of a specific model update, after you click Try it out, provide the reference ID of the model update in which you are interested. For more information, see Updating active models in predictions through API with MLOps. - Click Execute.
Result: The system generates a response to the simulated query.
Previous topic Retrieving the model update status Next topic Understanding MLOps