-->

DocuSign API - Envelope sent vie REST but no statu

2019-09-10 16:53发布

问题:

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)));
    }

回答1:

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