2013-07-18 83 views
0

我們已經從SOAP API遷移到REST API並嘗試「在現有信封上添加/刪除收件人」。CorrectAndResendEnvelope SOAP API現在是否支持REST API?

我們在SOAP API中使用CorrectAndResendEnvelope方法和RecipientCorrection屬性。這個方法和屬性是否有相應的REST API?

試圖做這樣的事情在REST:

DocuSignWeb.Correction correction = new DocuSignWeb.Correction(); 

correction.RecipientCorrections[0] = new DocuSignWeb.RecipientCorrection(); 

correction.RecipientCorrections[0].PreviousUserName = pOldName; 
correction.RecipientCorrections[0].CorrectedUserName = pNewName; 

correction.RecipientCorrections[0].PreviousEmail = pOldEmail; 
correction.RecipientCorrections[0].CorrectedEmail = pNewEmail; 

correction.RecipientCorrections[0].PreviousRoutingOrder = pOldRoutingOrder; 
correction.RecipientCorrections[0].CorrectedRoutingOrder = pNewRoutingOrder; 

correction.RecipientCorrections[0].Resend = true; 
correction.RecipientCorrections[0].ResendSpecified = true; 

DocuSignWeb.CorrectionStatus correctionStatus = _apiClient.CorrectAndResendEnvelope(correction); 

感謝您的答覆,我是新來的REST和不斷收到與下面的代碼中的錯誤請求400響應:

我已經從其他樣品的標準和基本URL ... authenticateStr

_recipientID,pNewEmail,pNewName和pNewRoutingOrder被作爲參數傳遞給程序。

串envDef = 「HTTP://www.docusign.com/restapi \」>」 + 「」 + 「」 + 「」 + _recipientId + 「」 + 「」 + pNewEmail + 「」 + 「」 + pNewName + 「」 + 「」 + pNewRoutingOrder + 「」 + 「」 + 「」 + 「」;

  url = baseURL + "/envelopes/" + pEnvelopeID + "/recipients"; 
      request = (HttpWebRequest)WebRequest.Create(url); 
      request.Headers.Add("X-DocuSign-Authentication", authenticateStr); 
      request.ContentType = "application/xml"; 
      request.Accept = "application/xml"; 
      request.ContentLength = envDef.Length; 
      request.Method = "PUT"; 
      // write the body of the request 
      byte[] body = System.Text.Encoding.UTF8.GetBytes(envDef); 
      Stream dataStream = request.GetRequestStream(); 
      dataStream.Write(body, 0, envDef.Length); 
      dataStream.Close(); 
      // read the response 
      webResponse = (HttpWebResponse)request.GetResponse(); 
      sr.Close(); 

      responseText = ""; 
      sr = new StreamReader(webResponse.GetResponseStream()); 
      responseText = sr.ReadToEnd(); 
+0

我覺得有一個當前錯誤在系統中使用XML格式與此特定API調用(即更正收件人信息)。我在下面發佈的JSON作品,一旦我知道XML版本已修復此問題,我會在這裏發佈...... – Ergin

回答

0

是的,你絕對可以做到這一點使用REST API,以及。請仔細閱讀REST API文檔AINS如何做到這一點:

DocuSign Documentation

打開無論是在線版或下載REST API的PDF,並做「重發」,你會看到兩頁,告訴你如何修改現有搜索信封並重新發送。呼叫你會作出這個樣子的:

PUT https://{server}/restapi/{apiVersion}/accounts/{accountId}/envelopes/{envelopeId}/recipients 

X-DocuSign-Authentication: <DocuSignCredentials><Username>{name}</Username><Password>{password}</Password><IntegratorKey>{integrator_key}</IntegratorKey></DocuSignCredentials> 
Accept: application/json 
Content-Type: application/json 
{ 
    "signers" : 
    [ 
    { 
    "email": "new_email_address", 
    "name": "new_name", 
    "recipientId": "1" 
    } 
] 
} 

要重新發送信封在修改之後,你會想要一個URL參數附加到URL:

?resend_envelope=true