如何通过浏览器JavaScript访问Docusign API? [英] How to access Docusign API via browser javascript?

查看:101
本文介绍了如何通过浏览器JavaScript访问Docusign API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用Javascript构建基于浏览器的应用程序。我试图通过jQuery访问docusign api:

I'm building a browser based application in Javascript. I've tried to access the docusign api via jQuery:

$.support.cors = true;
$.ajax({crossDomain:true, url:"https://demo.docusign.net/restapi/v2"})

我收到错误:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://demo.docusign.net/restapi/v2?_=1407189114238. This can be fixed by moving the resource to the same domain or enabling CORS.

访问yahoo等其他API完全可以:

Accessing other APIs such as yahoo, totally works:

$.ajax({crossDomain:true, url:"https://query.yahooapis.com/v1/public/yql"})

对于docusign api,我需要做些特别的事情吗?谢谢。 (注意:我的示例在这里使用空白查询来说明是否可以访问api。实际代码使用的是实际查询。此问题不是由没有真正的查询引起的。您可以通过将上述url粘贴到自己的代码中来自己查看)浏览器,并看到它返回一些xml。)

Is there a special thing that I need to do for docusign api? Thanks. (Note: My examples here use blank queries to illustrate whether an api is accessible at all. The actual code uses real queries. This problem is not caused by not having a real query. You can see this yourself by pasting the above url into your browser and see that it returns some xml.)

推荐答案

DocuSign在其平台中不支持CORS(跨源资源共享) 。 CORS存在太多潜在的安全风险,而DocuSign要保持其极高的安全性和认证合规性,就无法支持CORS。

DocuSign does not support CORS (Cross-Origin Resource Sharing) in its platform. There are too many potential security risks with CORS and for DocuSign to maintain its extremely high level of security and certification compliance it can not support CORS.

这篇关于如何通过浏览器JavaScript访问Docusign API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆