【发布时间】:2018-02-05 17:33:45
【问题描述】:
我正在使用 Zoho Creator 并已成功设置与 Docusign 的集成以创建信封。但是,使用 Docusing REST API 方法将信封状态更新为无效时,我遇到了问题。
Zoho creator 提供了 2 种可能性:posturl 方法和 geturl,如下
response = postUrl(url, jsonstring, header, false);
方法“PUT”没有选项,并且尝试在我的标头(而不是 POST)中使用选项“X-HTTP-Method-Override”:“PUT”但没有成功。
我不断收到以下错误:
" INVALID_REQUEST_PARAMETER\" - "请求包含至少一个无效参数。信封定义中的 'status' 值无效。只允许 'sent' 或 'created'(默认)。"
因为它试图创建一个新信封而不是更新。
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);
提前感谢您的建议,
克莱尔
【问题讨论】:
-
我猜 Docusign 必须支持
X-HTTP-Method-Override才能工作。您可能必须要求他们为您添加此内容,或 chase Zoho to implement PUT,或者如果您找不到其他内容,则可能使用他们在该线程中命名的付费扩展。 -
@Rup 从 Docusign Rest API explorer 复制和粘贴的标头信息表明支持 X-HTTP-Method-Override(这是复制/粘贴下面)。 HTTP/1.1 access-control-allow-credentials: true Access-Control-Allow-Headers: X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept Access-Control-Allow-Methods: OPTIONS, HEAD , GET, POST, PUT, DELETE access-control-allow-origin: * Access-Control-Max-Age: 86400 Date: Mon, 05 Feb 2018 18 x-frame-options: Deny X-XSS-Protection: 1; mode=block Transfer-Encoding: chunked Connection: keep-alive
-
这是来自 Docusign 的响应标头? (如果需要,您可以将其编辑到问题中。)所以我猜 Docusign 应该支持 X-HTTP-Method-Override,然后看起来 Zoho 没有为您发送标头,或者 Docusign 忽略了它:-/你能查出是否正在发送标头,即接下来要看的地方吗?
-
@Rup 这是来自 Docusign 的响应标头(在 API Explorer 平台上)。我已经将 X-HTTP-Method-Override 与 Zoho 一起用于与其他 Zoho 服务的其他集成,并且效果很好。不过,不确定从 Zoho 创建者拨打电话时是否正在发送标头。
标签: docusignapi zoho