且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

DocuSign API-信封发送了vie REST,但未返回任何状态

更新时间:2022-10-14 18:58:00

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.)