Hi all,
I am creating a Form that makes a http request on click of a button by calling the function below. You can ignore the id and the string encoded via btoa.
function send(){ var URL = "https://connectwiseSite/v4_6/apis/3.0/company.companies"+id; var xmlhttp = new XMLHttpRequest(); xmlhttp.open("DELETE", URL, true); xmlhttp.setRequestHeader("Content-Type","application/json"); xmlhttp.setRequestHeader("Authorization", "Basic" + window.btoa('companyid+integratorlogin:integratorpassword')) }
The problem is that the API requires you to supply cookies in the format below but I'm not sure if you can do that using JavaScript because of the cross-origin policy.
So, my question is:
1. Is it possible to accomplish a web call like above from the JS section in Forms?
2. Is it possible to perform this type of http request in Workflow?
3. If so, can somebody kindly walk me through how I would go about configuring the HTTP Web Request activity (i.e. what do you need to write in the "Content Body", how would you set up Authorization/Authentication, etc).
4. If not, how would you accomplish making this call?
I am completely new to Worfklow's HTTP Web Request activity and my knowledge on HTTP request in general is poor. Any response would be appreciated. Thanks in advance!