Skip to content

Instantly share code, notes, and snippets.

@mayurah
Created June 15, 2020 18:06
Show Gist options
  • Save mayurah/fc6cd522e824cd04070c4ad1c1d9ff18 to your computer and use it in GitHub Desktop.
Save mayurah/fc6cd522e824cd04070c4ad1c1d9ff18 to your computer and use it in GitHub Desktop.
Test Connectivity with WebEx XML API —— Usage: ./check_webex_api.sh sitename email_or_user password
#!/bin/bash
# Usage: ./check_webex_api.sh sitename email_or_user password
if [ $# -eq 0 ]; then
echo "No arguments provided"
echo
echo
echo "Usage: ./check_webex_api.sh sitename email_or_user password"
echo
echo "Note: Ensure that the special characters in password are escaped."
exit 1
fi
WEBEX_SITENAME=$1
WEBEX_USER_OR_EMAIL=$2
WEBEX_PASSWORD=$3
curl -v --location --request POST "https://$WEBEX_SITENAME.webex.com/WBXService/XMLService" \
--header 'Content-Type: application/xml' \
--data "<?xml version='1.0' encoding='UTF-8'?>
<serv:message xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<header>
<securityContext>
<webExID>$WEBEX_USER_OR_EMAIL</webExID>
<password>$WEBEX_PASSWORD</password>
<siteName>$WEBEX_SITENAME</siteName>
</securityContext>
</header>
<body>
<bodyContent xsi:type=
'java:com.webex.service.binding.history.LstmeetingusageHistory'>
<listControl>
<serv:startFrom>1</serv:startFrom>
<serv:maximumNum>10</serv:maximumNum>
<serv:listMethod>AND</serv:listMethod>
</listControl>
<order>
<orderBy>STARTTIME</orderBy>
<orderAD>DESC</orderAD>
</order>
</bodyContent>
</body>
</serv:message>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment