Snippets
Useful snippets of code given as examples to help with various scripting needs.
Use this script to add a SOAP endpoint to a Unifi Process. You will need to update the api_name to be the same as the one you set in the Process record.
(function scriptedWebServiceOperation(request, response) {
var helper = new x_snd_eb.SoapHelper('api_name'); // the API name of the Unifi Process
var xml = helper.processRequest(soapRequestXML);
response.soapResponseElement = snd_eb_util.getSoapResponseElement(xml);
})(request, response);
Use this script to add a REST endpoint to a Unifi Process. You will need to update the api_name to be the same as the one you set in the Process record.
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {