Docusign - 从POST到PUT的X-HTTP-Method-Override - 考虑将信封状态更新为void

时间:2018-02-05 17:33:45

标签: docusignapi zoho

我正在使用Zoho Creator并设法与Docusign集成以创建信封。但是,使用Docusing REST API方法将信封状态更新为void时出现问题。

Zoho创作者提供2种可能性:posturl方法和geturl,如下所示 response = postUrl(url, jsonstring, header, false);

该方法没有选项" PUT"并尝试使用选项" X-HTTP-Method-Override":" PUT"在我的标题(而不是POST)没有成功。

我一直收到以下错误:

  

" INVALID_REQUEST_PARAMETER \" - "请求至少包含一个无效参数。 ' status'的值无效在信封定义中。只发送了'或者'创建' (默认)是允许的。"

因为它试图创建新信封而不是更新。

header = map();
headerdetails = map();
headerdetails.put("Username", "xxxxxxx");
headerdetails.put("Password", "xxxxxxxxx");
headerdetails.put("IntegratorKey", "xxxxxxxxxx");
header.put("X-DocuSign-Authentication", headerdetails);
header.put("Content-Type", "application/json");
header.put("Accept", "application/json");
header.put("X-HTTP-Method-Override", "PUT");
url = ("https://demo.docusign.net/restapi/v2/accounts/xxxxx/envelopes/53f88f09-cc98-43a9-99ce-8769c05a3739");
mapvoid = map();
mapvoid.put("status", "voided");
mapvoid.put("voidedReason", "The report is to be amended.");
response = postUrl(url, mapvoid.toString(), header, false);

提前感谢您的建议,

克莱尔

1 个答案:

答案 0 :(得分:1)

REST API不支持X-HTTP-Method-Override,它似乎是RESTAPI Explorer中的一个错误。我已向Dev团队报告了RESTAPI Explorer错误,并可能在将来的版本中修复。您需要使用PUT来更新信封的状态。