cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Please note that Remote Expert Mobile announced end-of-life and support will end on February 28, 2022.
396
Views
0
Helpful
2
Replies
Beginner

Macro Creation - Making API calls

Hi 

 

I have been looking into the following github module and been trying to see if we could integrate this using an API call to icigna2 to let us know that rooms etc are having audio/video issues or needs attention as specified in the module. 

 

However, attempting to integrate this using either the fetch command or using  XMLHttpRequest is throwing up errors within the macro. Stating; "ReferenceError: identifier 'XMLHttpRequest' undefined" or similar error for fetch. 

 

Does anyone have any working examples for making API calls from the macros? 

 

Thanks

Everyone's tags (3)
2 REPLIES 2
Beginner

Re: Macro Creation - Making API calls

I "think" I have found a way of doing this, but it appears that I am getting an invalid SSL cert. 

 

ReportIssue'Unhandled promise rejection' { code: 0, message: 'HttpClientPostResult', data: { status: 'Error', Message: 'SSL peer certificate or SSH remote key was not OK' } }

 

function sendMonitoringUpdatePost(message){
  
     xapi.command('HttpClient Post', { 'Header': 'Content-Type: application/json', 'Url':MONITORING_URL}
     , JSON.stringify(Object.assign({'Message': message}, systemInfo)));
}
Highlighted
Cisco Employee

Re: Macro Creation - Making API calls

There are configurations/processes for either importing the target certificate (production) or disabling the cert check (development), see this learning lab for details: https://developer.cisco.com/learning/lab/collab-xapi-macros/step/4

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards