Posted: 5 May 2016 4:16 EDT Last activity: 16 Dec 2016 6:54 EST
REST Int.- How to upload a sample Request for DELETE Method?
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.
Infact the REST help also suggest the same. I think a bug need to be raised to fix this.
Use the fields in this section to specify the data to include in the DELETE message.
Enter a short description of the string in the response. The data type of the message data is String.
Specify the source or the type of source of the value:
Clipboard — The source is a property or a page on the clipboard.
Constant — The source is a fixed value.
JSON — The source is a stream of JSON data formatted from a Page or PageList property.
XML Stream — The source is a stream of XML data formatted by an XML Stream rule.
HTML Stream — The source is a stream of HTML data formatted by an HTML rule.
Map From Key
Specify the key to locating the property or rule in the source specified in theMap From field:
If the Map From value is Clipboard, enter the reference to the property from which the data is mapped at runtime.
If the Map From value is Constant, enter a literal text string. To include blank spaces in your text string, surround the string with double quotes.
If the Map From value is JSON, enter the reference to the property from which JSON data is generated and mapped at runtime. Only properties of mode Page or PageList must be specified.
If the Map From value is XML Stream, enter either the Stream Name(second key) of the appropriate XML Stream rule or a page name and stream name using the syntax PageName.StreamName. (The page must be present on the clipboard when the connector rule runs for rule resolution to find the rule.) If you specify the stream name only, the system uses the Applies To class of this connector rule as the first key part of the XML Stream rule.
If the Map From value is HTML Stream, enter either the Stream Name(second key) of the appropriate HTML rule or a page name and stream name using the syntax PageName.StreamName. (The page must be present on the clipboard when the service rule runs for rule resolution to find the rule.) If you specify the stream name only, the system uses theApplies To class of this connector rule as the first key part of the HTML rule.
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?
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.
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.
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.
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