我正在尝试对eSignature REST API信封进行API调用:listStatus(如图所示(
然而,我得到错误400错误请求和以下内容:
{
"errorCode": "UNSPECIFIED_ERROR",
"message": "Object reference not set to an instance of an object."
}
即使在DocuSign的API资源管理器中尝试它,我也会得到同样的错误。这个错误似乎指向了请求主体的形成方式问题。DocuSign建议,
{
"envelopeIds": [
"44c5ad6c-xxxx-xxxx-xxxx-ebda5e2dfe15",
"8e26040d-xxxx-xxxx-xxxx-1e29b924d237",
"c8b40a2d-xxxx-xxxx-xxxx-4fe56fe10f95"
]
}
但是如果我使用";信封ID">在体内相反,我得到:
{
"errorCode": "INVALID_REQUEST_PARAMETER",
"message": "The request contained at least one invalid parameter. Query parameter 'from_date' must be set to a valid DateTime, or 'envelope_ids' or 'transaction_ids' must be specified."
}
替换">信封IDs";用">envelove_ids";我得到:
响应:
{
"errorCode": "UNSPECIFIED_ERROR",
"message": "Object reference not set to an instance of an object."
}
即使使用逗号分隔列表之类的,我也会得到相同的错误:
正文:
{ "envelopeIds": "44c5ad6c-xxxx-xxxx-xxxx-ebda5e2dfe15,8e26040d-xxxx-xxxx-xxxx-1e29b924d237"}
响应:
{
"errorCode": "UNSPECIFIED_ERROR",
"message": "Object reference not set to an instance of an object."
}
任何帮助都将不胜感激。我已经使用poster和DocuSign的API资源管理器进行了尝试。
您需要在URL中包含?envelope_ids=request_body
。然后它应该与身体一起工作:
{
"envelopeIds": [
"44c5ad6c-xxxx-xxxx-xxxx-ebda5e2dfe15",
"8e26040d-xxxx-xxxx-xxxx-1e29b924d237",
"c8b40a2d-xxxx-xxxx-xxxx-4fe56fe10f95"
]
}
如果您正在使用他们的PHP SDK,下面是代码:
//Get envelopes API
$envelopesApi = new EnvelopesApi($this->docusignClient);
//Create ListStatusOptions object for the listStatus endpoint
$lso = new EnvelopesApiListStatusOptions();
//Important : Specify that the envelope ids will be in the request body
$lso->setEnvelopeIds('request_body');
//Call list status
$envelopesInformation = $envelopesApi->listStatus(
account_id:$this->accountId,
//The request body, as a new EnvelopeIdsRequest object, whith the values as an array of strings
envelope_ids_request: new EnvelopeIdsRequest(['envelope_ids'=>$toCheck]),
//The carefuly crafted ListStatusOptions object
options: $lso);
正如@JD Brennan的回答所示,您必须指定将在请求正文中发送您的id,并且这是通过ListStatusOption对象完成的。