API의 데모 URL을 통해 Docusign에서 문서를 업로드하기 위해 Timeout 속성을 사용해 보았습니다. 그러나 때때로 api 호출이 "원격 서버에서 오류를 반환했습니다 : (400) 잘못된 요청"을 반환합니다. 피들러 디버그 추적을 조사했습니다. XML은 오류 코드 와 메시지 "1. errorCode : HOURLY_APIINVOCATION_LIMIT_EXCEEDED. 2. 메시지 : 시간당 API 호출의 최대 수를 초과했습니다. 시간 제한은 1000"이라는 두 가지를 표시합니다. . 하지만 지속적으로 업로드 할 수있는 통화는 약 15 ~ 20 건이었습니다. 그 후 잘못된 요청이 시작됩니다. 잠시 후에 다시 업로드하기 시작했습니다. Fidler XML 이미지를 업로드 할 수 없습니다. 이미지를 게시하려면 10 개의 평판이 필요함을 보여주었습니다.
string envdef = "<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" + envDef;
string temp = Environment.ExpandEnvironmentVariables("%temp%");
FileStream fileStream = System.IO.File.OpenRead(path);
// build the multipart request body
string requestBodyStart = "\r\n\r\n--BOUNDARY\r\n" +
"Content-Type: application/xml\r\n" +
"Content-Disposition: form-data\r\n" +
"\r\n" +
envdef + "\r\n\r\n--BOUNDARY\r\n" + // our xml formatted envelopeDefinition
"Content-Type: application/x-www-form-urlencoded\r\n" +
"Content-Disposition: file; filename=\"CaptionBookmarkTest - 214744463.doc\"; documentId=1\r\n" +
"\r\n";
string requestBodyEnd = "\r\n--BOUNDARY--\r\n\r\n";
// use baseURL value + "/envelopes" for url of this request
request.Timeout = 1000000;
request = (HttpWebRequest)WebRequest.Create(baseURL + "/envelopes");
request.Headers.Add("X-DocuSign-Authentication", authenticateStr);
request.ContentType = "multipart/form-data; boundary=BOUNDARY";
request.Accept = "application/xml";
request.ContentLength = requestBodyStart.ToString().Length + fileStream.Length + requestBodyEnd.ToString().Length;
request.Method = "POST";
// write the body of the request
byte[] bodyStart = System.Text.Encoding.UTF8.GetBytes(requestBodyStart.ToString());
byte[] bodyEnd = System.Text.Encoding.UTF8.GetBytes(requestBodyEnd.ToString());
Stream dataStream = request.GetRequestStream();
dataStream.Write(bodyStart, 0, requestBodyStart.ToString().Length);
// Read the file contents and write them to the request stream
byte[] buf = new byte[4096];
int len;
while ((len = fileStream.Read(buf, 0, 4096)) > 0)
{
dataStream.Write(buf, 0, len);
}
dataStream.Write(bodyEnd, 0, requestBodyEnd.ToString().Length);
dataStream.Close();
// read the response
request.MaximumAutomaticRedirections = 4;
webResponse = (HttpWebResponse)request.GetResponse();
sr.Close();
responseText = "";
sr = new StreamReader(webResponse.GetResponseStream());
responseText = sr.ReadToEnd();
StreamWriter SW;
SW = System.IO.File.CreateText(temp + "\\upload.XML");
SW.WriteLine(responseText);
SW.Close();
sr.Close();
DocuSign에는 API 호출 제한이 있습니다 . 계정 당 API 호출은 시간당 1,000 개로 제한됩니다 . 이 한도에 도달 한 것 같습니다. 드문 경우이므로 1 시간 이내에 그렇게 많은 전화를 거는 방법과 이유가 궁금합니다.
시간 창은 슬라이딩 창이 아니라 각 시간의 상단에서 다음 시간의 시작까지입니다. 따라서 예를 들어 오후 3시에서 오후 4시 사이에 특정 계정에서 1000 개 이상의 API 호출을 할 수 없습니다.
이것은 서명 요청 API 호출뿐만 아니라 DocuSign의 서버에 대해 수행하는 모든 API 호출을위한 것입니다. 따라서 로그인 API를 호출하여 baseUrl 및 accountId를 검색하면 한 번의 호출로 계산됩니다. 그런 다음 후속 서명 요청 또는 다른 API 호출에 해당 baseUrl을 사용하면 2로 계산됩니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다