【问题标题】:i got a 400 bad request error, While sending the document by using the DocuSign rest api我收到 400 错误请求错误,使用 DocuSign 休息 api 发送文档时
【发布时间】:2018-07-09 11:25:27
【问题描述】:

我是新来调用文档发送 DocuSign REST API 并使用文档免费文档 ID,同时调用文档发送 DocuSign REST API,收到 BAD 400 请求错误,并显示错误消息 "error-code": "UNSPECIFIED_ERROR""message": "Non-static method requires a target

<script>
$(document).ready(function(){
$("#Submit").click(function(){
$.ajax({
method  : 'POST',
crossDomain : true,
headers: {
"X-DocuSign-Authentication":
"{\"Username\":\"username\",\"Password\":\"password\",\"IntegratorKey\":\"HEWL-dadabbac-6614-\"}"  },
body: 
{
  "emailBlurb": "DocuSign",
  "emailSubject": "DocuSign",
  "status": "Sent",
  "templateId": "738411FD-73BD-4CE8-9BE2-D944943FE3DE",
  "templateRoles": [
    {
      "roleName": "signer"
    }
  ]
},

success: function(result){
  var len = result.length;
 alert("Success");
},
 error: function(result){
    alert("Please Checkit Once..... !");
},
 error: function(result){
    alert("Please Checkit Once..... !");
},
});

【问题讨论】:

  • 不确定发生了什么,但“非静态方法需要目标”错误消息似乎来自 C#,这表明接收端存在问题(我假设是 DoguSign)。您是直接将该请求发送给 Docusign,还是以某种方式通过您的 C# 应用程序传递它?
  • 嗨 Max,感谢您的重播,我正在尝试通过 Docusign 门户发送文档,这里我使用 jquery/java 脚本功能来调用 REST API...我能够发送从文档门户成功记录文档,如果我尝试使用 jquery/javascript 调用相同的 rest api(将文档发送给相应的用户),它会显示错误.. 请检查是否需要传递给API...
  • 能否请您发布您在门户网站中使用的代码?您能否提供一个链接,以便我们查看?

标签: jquery docusignapi


【解决方案1】:

仅供参考 - DocuSign 不支持 CORS(跨源资源共享),因此您需要发出后端 API 请求才能访问 DocuSign 的核心平台。请参阅此帖子,包括 cmets:

Unable to login in Docusign

此外,关于您的特定 400 - Bad Request 我相信这是因为您没有指定任何收件人信息。您正在设置模板角色,但未为其分配实际收件人。尝试更改您的 templateRoles 结构,使其如下所示:

"templateRoles": [
    {
        "roleName": "signer",
        "email": "john@email.com",
        "Name": "John Dow",
    }

【讨论】:

  • 嗨 Argin,感谢您的回复,我能够成功获取登录信息,envalope 发送 API 仅显示 400 错误.. 其余 API 工作正常...我做了一些更改在我的 google chrome 浏览器属性中为您指定的错误...
  • 嗨 Kumar,我编辑了我的帖子,因为我认为我在您的请求中看到了问题。请测试并告诉我...谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-07
  • 1970-01-01
相关资源
最近更新 更多