Call REST API from a custom webpage

Version 1
    This document was generated from CDN thread

    Created by: Goswin Weemaes on 19-11-2013 02:24:37 AM
    Hi,

    When I am trying to use the REST API from a custom webpage (for example to display the current configuration of a , I am facing the following issue:
    • I build a simple webpage that uses a "XMLHttpRequest" Javascript object
    • When sending the request to the CCX server I get the following error message 
      XMLHttpRequest cannot load http://uccx10-beta.cisco.be:8080/adminapi/csq. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://tcc-vm.domain.com' is therefore not allowed access.
    • After doing some research on the web, I have the impression that his is due to the "same-origin policy" and that it can be solved by enabling CORS (Cross-origin resource sharing) on the server-side.
    • Is there a way to activate CORS on the CCX server? Or any other way to solve this issue?
    Thanks,
    Goswin

    Subject: RE: New Message from Goswin Weemaes in Contact Center Express Configuration
    Replied by: David Lender on 22-11-2013 09:43:29 AM
    Cors is not available on the UCCX server.  You might be able to use a proxy to get around same-origin policy.

    Subject: RE: New Message from Goswin Weemaes in Contact Center Express Configuration
    Replied by: Praveen Sinha on 26-11-2013 12:46:58 AM
    David Lender:
    Cors is not available on the UCCX server.  You might be able to use a proxy to get around same-origin policy.
    In addition to the proxy workaround suggested by David that you can try now, we have plans to support CORS for our REST APIs in 10.5. Also, we would make it available for 9.0(2) and 10.0(1) as part of our next ES release of 9.0(2) and SU release of 10.0(1).

    Thanks and Regards,
    Praveen