Hi all,
We have a requirement to post data from community site to webhook through automation. we tried using $.telligent.evolution.post but it's not working. Can anyone guide me?
Hi all,
We have a requirement to post data from community site to webhook through automation. we tried using $.telligent.evolution.post but it's not working. Can anyone guide me?
you can try using the ajax call using the script to execute as javascript
var settings = { "url": "https://websiteurl.com/data/something", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json" }, "data": JSON.stringify({"subject":subject,"description":description}), }; jQuery.ajax(settings).done(function (response) { alert("success " ); }); }).fail(function(data){ alert("Failed due to error " + data.responseText ); });
we tried by implementing the above code in the .js and .jsm, to post data to webhook but it's not working.
Not sure how your webhook is configured to receive data from the sources , May be you need to create a custom widget api to do the job
I think the telligent.evolution.post posts to a wrapper for internal AJAX requests that honor accessing user permissions. Maybe try the $core_v2_http.Post method:
#set($httpResponseResponse = $core_v2_http.Post($url, "%{ BypassUrlFiltering = $bypassUrlFilteringArg, Data = $dataArg, Headers = $headersArg, IsCacheable = $isCacheableArg, Query = $queryArg, TimeoutSeconds = $timeoutSecondsArg, VaryCacheByUser = $varyCacheByUserArg }"))
I think we need to clarify, you do not post data to webhooks, webhooks are a pub/sub feature, meaning you supply an endpoint the webhook SENDS to, you don't send anything to it.