02-23-2018 12:03 AM
Hey,
If anyone is interested, I've made a NodeJS version to work with the API. Here you go
const request = require('request');
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // to ignore the error for self-signed certificates
let cisco_axl_config = {
url: 'https://YOURURL:8443/axl/',
auth: 'Basic YOURCREDENTIALS',
version: 'YOURVERSION'
}
function cucm_exec_sql(query, callback) {
request({
uri: cisco_axl_config.url,
method: 'POST',
headers: {
Authorization: cisco_axl_config.auth,
SOAPAction: 'CUCM:DB ver=' + cisco_axl_config.version + ' executeSQLQuery'
},
body: '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/' + cisco_axl_config.version + '"><soapenv:Header/><soapenv:Body><ns:executeSQLQuery><sql>' + query + '</sql></ns:executeSQLQuery></soapenv:Body></soapenv:Envelope>',
callback: (err, data, response) => {
callback(err, response);
}
});
}
05-24-2019 03:13 AM
I've tried the same methodology but I'm getting the error 'CERT_HAS_EXPIRED'.
Please find the below code:
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide