XMLHttpRequest in Page Composer "Failed due to - 405 : Method Not Allowed"
We have a requirement to call OIC Rest Endpoint from the Shipment Page, and for that I have created a HTML markup in page composer.
HTML code with a button to call the Rest endpoint is attached.
while triggering the button the integration is triggered but in OIC it is showing below error:
"Error while processing at Trigger. Failed due to - 405 : Method Not Allowed"
Note: The Method is POST and i am Passing the correct value in method still facing that issue.
<html>
<head/>
<style>
button#CallPaaSBuild{
color: #000000;
border-color: #c4ced7;
background-color: #f1f3f3;
background-image: none;
border-radius: 3px;
border: 1px solid #c4ced7;
text-shadow: none;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
font-weight: bold;
min-height: 28px;
margin-right: 2px;
margin-left: 20px;
padding-left:6px;
padding-right:6px;
padding-botton:50px;
}
</style>
<body>
<button align="right" id="CallPaaSBuild" onclick="(function(){
var xhttp = new XMLHttpRequest();
var url = 'https://Servername/ic/api/integration/v1/flows/rest/TEMP_INTEGRATION/1.0/shipment?shipmentNumber=1234';
xhttp.open('POST', url, false);
xhttp.setRequestHeader('Content-Type', 'application/json');
xhttp.setRequestHeader('Authorization', 'Basic ' + window.btoa('username:password'));
xhttp.send(null);})(917274);this.disabled=false;return false">Call PaaS Build</button>
</body>
</html>
Tagged:
0