I've been working with trying to automate the creation of user accounts in WebEx and activate/deactivate accounts but I've encountered a problem.
With XML API you assign the securitycontext first and does not require any session creation like you do in URL API. I've managed to create a URL API to create a user but when I'm using some sort of signin mechanism it crashes, or I get a pop-up window of Internet Explorer where it tells me to allow cookies to run (I've followed the instructions on this site to turn allow cookies and also added webex to trusted sites).
I've tried with partnerId and siteId aswell, it seems like the request get accepted but there is some type of cookie issue.
I would really appreciate some help with the question.
This Code is used in Powershell
<?xml version="1.0" encoding="UTF-8"?>
$uri = "https://company.webex.com/company/"
Invoke-WebRequest -Uri $uri -Method Post -ContentType 'text/xml' -Body $body
Solved! Go to Solution.
In powershell I've tried Invoke-webrequest, Invoke-restMethod and also creating the request from .NET library directly by [System.Net.HttpWebRequest]::CreateHttp('URL'). None of the methods work and all give the same response (see below). Because several posts about URI and XML APIs where the administrators recommend using XML instead of URI I've done the requests with XML instead of URI.
When I use Invoke-WebRequest I do get a pop-up window within Internet Explorer (11) where it say that cookies needs to be enabled. According to WebEx webmeetings prerequists you need Internet Explorer 4.0+ with Cookies and Java enabled and all those prereqs have been fullfilled. I've also tried using the properties in Powershell Invoke-Webrequest named UserAgent and chosen between all different types without any success.
I don't think I'm the only one trying to solve this process with Powershell and would really like to get some examples where it works.
The error message i get in response from Webex is the following.
<p><b>WebEx requires the use of Netscape Navigator 4.0, Internet Explorer 4.0 or better.</b></p>
I've changed the URL and it seem to work now.
I did some changes to the script as well which might have made some kind of change to the result. I added the XML namespace for SERV which can't be found anywhere except in the example codes in the end of the documentation of XML API.
In case someone needs the working script I'll post it here.
$XML =[xml]'<?xml version="1.0" encoding="UTF-8" ?>
$webex_URI = "https://Sitename.webex.com/WBXService/XMLService"
$response = Invoke-WebRequest -Uri $webex_URI -Method Post -ContentType 'text/xml' -TimeoutSec 120 -Body $XML