DocuSign API-信封发送了vie REST,但未返回任何状态 [英] DocuSign API - Envelope sent vie REST but no status returned

查看:121
本文介绍了DocuSign API-信封发送了vie REST,但未返回任何状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用GitHub上提供的DocuSign REST API解决方案大约三个月,直到最后一个小时为止,没有任何问题。我可以创建一个信封,创建一个用于放置字段的嵌入式视图,并将草稿信封保存在嵌入视图中。但是,当我随后使用SendEnvelope方法时,我得到的状态为Any back而不是按预期的方式发送。



进一步查看它,response.Content属性为完全为空,因此Deserialize方法无法正确创建EnvelopeStatus对象以返回我的代码(它基本上是一个空实例)。在其他REST调用中似乎并没有发生这种情况,而今天似乎只在SendEnvelope方法中发生过。 API是否已更改,或者这是刚刚出现的错误?



编辑我应该声明这是在演示站点上。 / p>

进一步编辑是用于更改状态的代码:

  public ApiResponse< EnvelopeStatus> SendEnvelopeWithHttpInfo(字符串信封编号,字符串帐户编号)
{
//如果(String.IsNullOrEmpty(accountId))抛出新的ApiException(400),则验证所需的参数'accountId'和'envelopeId'是否设置为
,调用SendEnvelopeWithHttpInfo时缺少必需的参数'accountId');
如果(String.IsNullOrEmpty(envelopeId))抛出新的ApiException(400,在调用SendEnvelopeWithHttpInfo时缺少必需的参数‘envelopeId’);

var path_ = / v2 /帐户/ {accountId} /信封/ {envelopeId} /;

var pathParams = new字典< String,String>();
var queryParams = new Dictionary< String,String>();
var headerParams = new字典< String,String>(Configuration.DefaultHeader);
var formParams = new字典< String,String>();
var fileParams = new字典< String,FileParameter>();
字符串postBody = null;

//确定接受标头
String [] http_header_accepts = new String [] {
application / json
};
字符串http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts);
if(http_header_accept!= null)
headerParams.Add( Accept,Configuration.ApiClient.SelectHeaderAccept(http_header_accepts));

//默认情况下将格式设置为json
//例如/pet/{petId}.{format}变为/pet/{petId}.json
pathParams.Add( format, json);
if(accountId!= null)pathParams.Add( accountId,Configuration.ApiClient.ParameterToString(accountId)); //路径参数
if(envelopeId!= null)pathParams.Add( envelopeId,Configuration.ApiClient.ParameterToString(envelopeId)); //路径参数

postBody = {\ status\:\ sent\} ;;

//发出HTTP请求
IRestResponse response =(IRestResponse)Configuration.ApiClient.CallApi(path_,Method.PUT,queryParams,postBody,headerParams,formParams,fileParams,pathParams);

int statusCode =(int)response.StatusCode;

if(statusCode> = 400)
抛出新的ApiException(statusCode,调用SendEnvelopeWithHttpInfo时出错: + response.Content,response.Content);
else if(statusCode == 0)
抛出新的ApiException(statusCode,调用SendEnvelopeWithHttpInfo时出错: + response.ErrorMessage,response.ErrorMessage);


返回新的ApiResponse< EnvelopeStatus>(statusCode,
response.Headers.ToDictionary(x => x.Name,x => x.Value.ToString() ),
(EnvelopeStatus)Configuration.ApiClient.Deserialize(response,typeof(EnvelopeStatus)));
}


解决方案

DocuSign Engineering的响应:



这是设计使然。 200响应指示更新操作成功。响应正文在设计上为空。



(DS Engineering在2016年9月9日关闭了此报告。直到现在我才注意到解决方案。)


I've been using the DocuSign REST API solution provided on GitHub for around three months now with no issues, until the last hour. I'm able to create an envelope, create an embedded view for field placement and save the draft envelope within the enmbedded view. However, when I then use the SendEnvelope method I get a status of Any back rather than Sent as is expected.

Upon looking further into it, the response.Content property is completely empty, thus the Deserialize method is unable to create the EnvelopeStatus object correctly to return to my code (it's basically an empty instance). This doesn't seem to happen with other REST calls and only appears to have occurred on the SendEnvelope method today. Has the API changed, or is this an error that's just cropped up?

Edit I should state that this is on the demo site.

further edit enclosed is the code being used to change the status:

 public ApiResponse<EnvelopeStatus> SendEnvelopeWithHttpInfo(string envelopeId, string accountId)
    {
        // verify the required parameters 'accountId' and 'envelopeId' are set
        if (String.IsNullOrEmpty(accountId)) throw new ApiException(400, "Missing required parameter 'accountId' when calling SendEnvelopeWithHttpInfo");
        if (String.IsNullOrEmpty(envelopeId)) throw new ApiException(400, "Missing required parameter 'envelopeId' when calling SendEnvelopeWithHttpInfo");

        var path_ = "/v2/accounts/{accountId}/envelopes/{envelopeId}/";

        var pathParams = new Dictionary<String, String>();
        var queryParams = new Dictionary<String, String>();
        var headerParams = new Dictionary<String, String>(Configuration.DefaultHeader);
        var formParams = new Dictionary<String, String>();
        var fileParams = new Dictionary<String, FileParameter>();
        String postBody = null;

        // to determine the Accept header
        String[] http_header_accepts = new String[] {
            "application/json"
        };
        String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts);
        if (http_header_accept != null)
            headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts));

        // set "format" to json by default
        // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
        pathParams.Add("format", "json");
        if (accountId != null) pathParams.Add("accountId", Configuration.ApiClient.ParameterToString(accountId)); // path parameter
        if (envelopeId != null) pathParams.Add("envelopeId", Configuration.ApiClient.ParameterToString(envelopeId)); // path parameter

        postBody = "{\"status\":\"sent\"}";

        // make the HTTP request
        IRestResponse response = (IRestResponse)Configuration.ApiClient.CallApi(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams);

        int statusCode = (int)response.StatusCode;

        if (statusCode >= 400)
            throw new ApiException(statusCode, "Error calling SendEnvelopeWithHttpInfo: " + response.Content, response.Content);
        else if (statusCode == 0)
            throw new ApiException(statusCode, "Error calling SendEnvelopeWithHttpInfo: " + response.ErrorMessage, response.ErrorMessage);


        return new ApiResponse<EnvelopeStatus>(statusCode,
            response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
            (EnvelopeStatus)Configuration.ApiClient.Deserialize(response, typeof(EnvelopeStatus)));
    }

解决方案

Response from DocuSign Engineering:

This is by design. The 200 response indicates that the update operation succeeded. The response body is null by design.

(DS Engineering closed this report 9n Sept, 2016. I didn't notice the resolution until now.)

这篇关于DocuSign API-信封发送了vie REST,但未返回任何状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆