I am trying on DX APIs in Pega Community version 23. I am using Postman for hitting Pega DX API’s. I am using this API data/{data_view_ID} for CRUD operations.
I am able to create a record in Datatype and also I am able to update the same record using the same API. But if I try to delete the record. It is showing an error shown below.
{
“errorClassification”: “Execution error”,
“localizedValue”: “Execution error.”,
“errorDetails”: [
{
“message”: “Error_Execution_Error”,
“erroneousInputOutputFieldInPage”: “”,
“erroneousInputOutputIdentifier”: “”,
“errorClassification”: “”,
“localizedValue”: “An internal error occurred while fetching the results using data view. Please contact administrator.”,
I successfully addressed the issue by incorporating dataViewParameters in the Parameters section, where I passed the encoded JSON format of pyGUID as a parameter to dataViewParameters. If we didn’t use encoded format then we are getting the above issue.
In Pega Community version 23, the DELETE method is not supported directly on the data/{data_view_ID} DX API, which is why you see the error. This API mainly supports GET, POST, and PUT. To delete a record, you need to create a custom REST service in Pega that allows the DELETE method. In this custom service, you can use an activity to remove the record from the database. Then, you can call this new DELETE API from Postman instead of using the default data view API. If you’re trying to delete a case or work item, you can use the standard v1/cases/{caseID} DELETE endpoint instead. Always make sure the right permissions are given in the access group