<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Cross Site Scripting issue with CUMI API</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_recent_posts?p_l_id=" />
  <subtitle>Cross Site Scripting issue with CUMI API</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_recent_posts?p_l_id=</id>
  <updated>2013-05-19T23:04:22Z</updated>
  <dc:date>2013-05-19T23:04:22Z</dc:date>
  <entry>
    <title>RE: Cross Site Scripting issue with CUMI API</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=8155029" />
    <author>
      <name>Amit Gupta</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=8155029</id>
    <updated>2012-10-30T19:43:25Z</updated>
    <published>2012-10-30T19:43:25Z</published>
    <summary type="html">Anil, Yes I tried that too but didn't work.
 Here is my code for your review. 
function requestVoicemailPost() {       
 jQuery.support.cors = true;
        jQuery.ajax({
                type: 'POST', 
                 contentType: 'application/xml; charset=utf-8', 
                 url: 'https://XXXXXX.opr.test.abc.org/vmrest/mailbox?method=requestnotification',
                 data: '{}', 
                 dataType: 'text',
                 username: 'XXXX',
                 password:'XXXXXXXX',
                 xhrFields: {
                      withCredentials: true
                 },
                beforeSend: function (req){ 
                         req.setRequestHeader('Access-Control-Allow-Origin', '*');
                 },
                 success: function(subscriptionId) { 
                         gSubscriptionId = subscriptionId; 
                         alert('Requested events for mailbox, subscriptionId=' + subscriptionId); 
                 },
                 complete: function(jqXHR, textStatus) {
                            alert('complete: ' + textStatus +  '  responseText: ' + jqXHR.responseText);
                 }
        });    
    }
Thanks!
Amit
 </summary>
    <dc:creator>Amit Gupta</dc:creator>
    <dc:date>2012-10-30T19:43:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Access-Control-Allow-Origin and Cross Site Scripting with jQuery</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=8138885" />
    <author>
      <name>Amit Gupta</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=8138885</id>
    <updated>2012-10-30T06:42:11Z</updated>
    <published>2012-10-30T06:42:11Z</published>
    <summary type="html">HI Darren, I'm facing the same CSS issue so wondering if you have figured that out. Thanks!</summary>
    <dc:creator>Amit Gupta</dc:creator>
    <dc:date>2012-10-30T06:42:11Z</dc:date>
  </entry>
  <entry>
    <title>Cross Site Scripting issue with CUMI API</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=8138844" />
    <author>
      <name>Amit Gupta</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=8138844</id>
    <updated>2012-10-30T06:38:12Z</updated>
    <published>2012-10-30T06:38:12Z</published>
    <summary type="html">We need to have voicemail indicator on jabber sdk web based softphone, for which we are using CUMI api for sending notification. But when trying to use below snippet from your api doc, I'm getting Access-Control-Allow-Origin not allowed issue.
$.ajax({ 
type: "POST", 
contentType: "application/xml; charset=utf-8", 
url: "/vmrest/mailbox?method=requestnotification", 
data: "{}", 
dataType: "text", 
success: function(subscriptionId) { 
gSubscriptionId = subscriptionId; 
alert("Requested events for mailbox, subscriptionId=" + subscriptionId); 
} 
});
Here is the doc that I'm referring to: [url=http://docwiki.cisco.com/wiki/Cisco_Unity_Connection_Messaging_Interface_(CUMI)_API_--_Using_the_CUMI_API_for_Sending_Notifications]http://docwiki.cisco.com/wiki/Cisco_Unity_Connection_Messaging_Interface_(CUMI)_API_--_Using_the_CUMI_API_for_Sending_Notifications[/url]
Error message : XMLHttpRequest cannot load [url=http://uc90zcv1.abc.org/vmrest/mailbox?method=requestnotification]http://uc90zcv1.abc.org/vmrest/mailbox?method=requestnotification[/url]. Origin [url=http://wpwdlsrm.abc.org:8080/]http://wpwdlsrm.abc.org:8080[/url] is not allowed by Access-Control-Allow-Origin.
 Do you think it could be a access issue ? I do have following roles for my userid in Unity server : Mailbox Access Delegate Account /Remote Admin /System Admin /User Admin.
FYI, The same AJAX call works fine when I change type to GET and dataType to jsonp but POST is not working for some reason.
any help would highly be appreciated.
Regards,
Amit</summary>
    <dc:creator>Amit Gupta</dc:creator>
    <dc:date>2012-10-30T06:38:12Z</dc:date>
  </entry>
</feed>

