DocuSign ListRecipients() 不工作,但其他调用正常

DocuSign ListRecipients() not working, but other calls OK

我正在使用 Docusign eSign API 进行集成。我的集成密钥可以很好地构建和发送信封,以及检查信封状态(使用 GetEnvelope())。但是 ListRecipients() 不起作用。我一直在关注这里的文档:https://developers.docusign.com/docs/esign-rest-api/how-to/get-envelope-recipients/.

我的收件人验证码是:

apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + authToken.access_token.ToString()); // I am suspicious of this line

var envelopesApi = new EnvelopesApi(apiClient);

foreach (var envelope in envelopes)
{
    List<SignerModel> listSigners = new List<SignerModel>();
    Recipients results = envelopesApi.ListRecipients(_apiAccountId, envelope.envelopeId.ToString());
    // Do something with it...
}

当我 运行 这行有可疑行(未注释)时,我在该行收到此错误消息:

GetSigners error: Object reference not set to an instance of an object.

当我注释掉它时,我在 ListRecipients() 调用中收到相同的错误消息。

这是我获取访问令牌的方式:

                List<string> docusignScopes = new List<string> { "impersonation", "signature" };
           
                apiClient = new ApiClient(_restBasePath);
                authToken = apiClient.RequestJWTUserToken(
                    _clientId,
                    _impersonatedUserId,
                    _authServer,
                    privateKeyBytes, 1, docusignScopes);
            

为什么 listRecipients 调用不起作用?

我测试了这段代码,它工作得很好。确保将您的 envelopeID 放在那里。试试这个基本代码,让我知道:

    var apiClient = new ApiClient(basePath);
    apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken);
    EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
    var rec = envelopesApi.ListRecipients(accountId, "4f925c10-xxxxxx-xxx-xxxx-xxxxxx");