Question
Wells Fargo
IN
Last activity: 16 Dec 2016 6:54 EST
REST Int.- How to upload a sample Request for DELETE Method?
Hello,
We are trying to integrate with a REST Service, we need to call a DELETE Method which takes a list of Parameters in Request Body.
We have a samaple request, which we are trying to upload through Wizard, so that wizard will create required rules for request structure. But, there is no option to upload sample request for DELETE method, unlike we have fro POST method. Please suggest how it could be achieved.
We are using Pega v7.1.7
Thanks,
Rajesh
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
Upon reviewing the corresponding SR, we see that it has been resolved. SA-23619 was created as a result of the investigation. Please reference that if you have the same question.
PEG
PL
Ideally message data should be there.
Infact the REST help also suggest the same. I think a bug need to be raised to fix this.
Help doc:
Message Data
Use the fields in this section to specify the data to include in the DELETE message.
Ideally message data should be there.
Infact the REST help also suggest the same. I think a bug need to be raised to fix this.
Help doc:
Message Data
Use the fields in this section to specify the data to include in the DELETE message.
Wells Fargo
IN
Thanks Rajeev, It seems a pega bug. I'll raise an SR.
Regards,
Rajesh
Hi Rajesh,
Please let us know here if you end up opening an SR so that we may track it through this post!
Regards,
Lochan | Online Community Moderator | Pegasystems Inc.
Pegasystems Inc.
US
Hi Michael,
Thank you for updating that here!
Regards,
Lochan
Pegasystems Inc.
US
The question here is why would a sample JSON be needed. The DELETE request should only contain an ID. Additional parameters are not considered RESTful and is probably why Pega is not adding "add Sample" section".
Please confirm, Praneeth.
The sample JSON the customer would use is quite complex. Would this be a POST with an "action" of CANCEL?
{
"user_id": "",
"application_id": "xxx",
"requester_ph": "000-000-0000",
"requester_name": "no_called",
"corporate_id": "xxxxx",
"cancellation_dt": "2014-02-07",
"accounts": {
"account": [
{
"account_nbr": "xxxxxxx",
"cancellation_reason": "Deceased"
},
{
"account_nbr": "xxxxxxx",
"cancellation_reason": "Deceased"
},
{
"account_nbr": "xxxxxx",
"cancellation_reason": "Deceased"
}
]
},
"note": {
"cm_nbr": "xxxxxxx",
"bca_nbr": "xxxxxxx",
"ica_nbr": "",
"mca_nbr": "xxxxxxxx",
"notes_txt": "aaaaaaaaaaaaaaaaaa"
}
The question here is why would a sample JSON be needed. The DELETE request should only contain an ID. Additional parameters are not considered RESTful and is probably why Pega is not adding "add Sample" section".
Please confirm, Praneeth.
The sample JSON the customer would use is quite complex. Would this be a POST with an "action" of CANCEL?
{
"user_id": "",
"application_id": "xxx",
"requester_ph": "000-000-0000",
"requester_name": "no_called",
"corporate_id": "xxxxx",
"cancellation_dt": "2014-02-07",
"accounts": {
"account": [
{
"account_nbr": "xxxxxxx",
"cancellation_reason": "Deceased"
},
{
"account_nbr": "xxxxxxx",
"cancellation_reason": "Deceased"
},
{
"account_nbr": "xxxxxx",
"cancellation_reason": "Deceased"
}
]
},
"note": {
"cm_nbr": "xxxxxxx",
"bca_nbr": "xxxxxxx",
"ica_nbr": "",
"mca_nbr": "xxxxxxxx",
"notes_txt": "aaaaaaaaaaaaaaaaaa"
}
}
The Requirement is to perform multi cancel in a single click. Our enterprise architecture services team delivered this REST API service to perform multi cancel operation from front end. In order to invoke this service from our app, we supposed to pass multiple card numbers in the JSON body request under delete method. I believe since it is a cancellation, They might have designed this request under delete method.
When we checked with our services team regarding delete method standards, The advised as below.
Multi Cancel API is developed as per API Standards and Security Requirements. PI Data you shouldn’t send with URI also there shouldn’t be constraint in using body with DELETE method.
Please advice how to proceed further.
Pegasystems Inc.
US
Pertaining to " ... there shouldn’t be constraint in using body with DELETE method." - relevant discussion at following link.
http://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-delete-request
Apparently, several applications have not been able to handle this requirement .. although some have been making changes in recent years to accommodate it.
As for Pega 7.2, it still does not have ability to use sample for GET request or DELETE request. It is looking like this will be "Enhancement Request" at best. I would not anticipate that development will agree to hotfix for 7.1.7. I have reached out to them to review and someone should be following up here.
Pegasystems Inc.
CA
I remember the reason we removed Request message data section for DELETE was that the underlying Apache HTTP Components library we use doesn't support adding request body to DELETE requests. However, there seems to be a workaround as mentioned in this post: https://daweini.wordpress.com/2013/12/20/apache-httpclient-send-entity-body-in-a-http-delete-request/
This does fall under enhancement request category though.
This is also the reason we don't support uploading sample request JSON/XML for DELETE method in the REST wizard.
This will be blocking to promote one of our functionality to production.
Is there any alternative solution to use the delete method with request body?
Can we do any customization to pass message data in Connect-REST for delete method?
Please advice.
Pegasystems Inc.
US
Reviewing and will reply in the A.M.
Updated: 16 May 2016 15:48 EDT
Pegasystems Inc.
US
Hi Uthay,
The alternative solution to use the delete method with request body will require work from your developers. As Praneeth Purighalla mentioned,
the underlying Apache HTTP Components library that Pega uses doesn't support adding request body to DELETE requests. There is a workaround
in link above that would detail over-writing a class in that API. Your programmers would have to compile the class externally and then
import it into Pega. I imagine we would need to provide you the API version installed in Pega.
This change would allow the Connect REST calls with DELETE method to assemble and send the body that you are requiring. As I understand it,
Pega will not send any body without “re-configuring” the Apache HTTP Components library.
As for UI, there is no clear solution there. You will have to manually setup the DELETE parameters as opposed to using sample JSON. The Rest
Integration Wizard would require additional customization on your part in order to be able to get “Prove Sample” functionality.
Updating SR with same response
Pegasystems Inc.
CA
Two corrections Paul.
The workaround is not to overwrite a class in the Apache HTTP Components API but to extend it and the class that needs to be extended is HttpEntityEnclosingRequestBase.
As for the REST wizard, though there is no provision to upload a sample JSON for DELETE, one can choose GET, upload a sample for GET and use the generated data model for DELETE method by manually changing the mapping configuration on the Connect REST rule.
Pegasystems Inc.
US
Ok, customer is going to either ask service team to convert Delete to Post/PUT -or- use the current Delete multiple times. Their COE does not want to engage in extending the Apache API we're using.
They do want to know if there is any plans in Pega for this going forward.
-
yordkwan wannupatham Lohitha Karuna Sree Kola
Accepted Solution
Pegasystems Inc.
US
Upon reviewing the corresponding SR, we see that it has been resolved. SA-23619 was created as a result of the investigation. Please reference that if you have the same question.
WellsFargo
IN
Hi ,
We have the similar Requirement, We need to send message data(request body) to the dleet method but , we are getting the 405 error delete is not supported ,Can some one help me to resolve the issue? PEGA version 7.18
Regards
Ram