2014-10-07 12 views
0

我需要能夠通過嵌入式簽名的REST API將非拉丁字符傳遞到文本選項卡,但任何不包含在ASCII中的原因要超時的URL。通過DocuSign REST API在文本選項卡中傳遞非拉丁文UTF-8字符

在舊的DocuSign社區論壇上,有人暗示說只支持ASCII字符,但沒有確認。你可以在這裏看到:

http://community.docusign.com/t5/Misc-Dev-Archive-READ-ONLY/File-names-with-CJK-characters/td-p/20249

沒有人有通過非ASCII字符轉換爲文本標籤通過REST API的信息嗎?

-Update-

我試圖再次使用西裏爾字母和片假名字符,它仍然是行不通的。當我查看我的請求主體時,它是完美的。

根據API日誌,正文從最後缺少字符,但金額會根據我使用的非拉丁字符而有所不同。

  • 當我使用9個片假名字符時,API日誌顯示身體缺少15個字符。
  • 當我使用11個西里爾文字符時,API日誌顯示身體缺少11個字符。

任何有關可能導致此問題的想法?

在我結束請求體中的字符串

<envelopeDefinition xmlns="http://www.docusign.com/restapi"> 
    <status>sent</status> 
    <emailSubject>Your NDA is ready for signature.</emailSubject> 
    <enableWetSign>false</enableWetSign> 
    <DocuSign_FinishLaterAllow>false</DocuSign_FinishLaterAllow> 
    <templateId>B66F3541-7DE4-42F7-971F-C66D634FA2EC</templateId> 
    <templateRoles> 
    <templateRole> 
     <email>[email protected]</email> 
     <name>Japanese Test</name> 
     <roleName>Signee</roleName> 
     <clientUserId>1</clientUserId> 
     <tabs> 
     <textTabs> 
      <text> 
      <tabLabel>streetAddress</tabLabel> 
      <name>streetAddress</name> 
      <value>ワタシ</value> 
      </text> 
      <text> 
      <tabLabel>Zip</tabLabel> 
      <name>Zip</name> 
      <value>ワタシ</value> 
      </text> 
      <text> 
      <tabLabel>Nationality</tabLabel> 
      <name>Nationality</name> 
      <value>Afghanistan</value> 
      </text> 
      <text> 
      <tabLabel>City</tabLabel> 
      <name>City</name> 
      <value>ワタシ</value> 
      </text> 
      <text> 
      <tabLabel>Region</tabLabel> 
      <name>Region</name> 
      <value>Aiti [Aichi]</value> 
      </text> 
      <text> 
      <tabLabel>Country</tabLabel> 
      <name>Country</name> 
      <value>Japan</value> 
      </text> 
     </textTabs> 
     </tabs> 
    </templateRole> 
    </templateRoles> 
</envelopeDefinition> 

根據API的DocuSign登錄

<envelopeDefinition xmlns="http://www.docusign.com/restapi"> 
    <status>sent</status> 
    <emailSubject>Your NDA is ready for signature.</emailSubject> 
<enableWetSign>false</enableWetSign> 
    <DocuSign_FinishLaterAllow>false</DocuSign_FinishLaterAllow> 
    <templateId>B66F3541-7DE4-42F7-971F-C66D634FA2EC</templateId> 
    <templateRoles> 
    <templateRole> 
     <email>[email protected]</email> 
     <name>Japanese Test</name> 
     <roleName>Signee</roleName> 
     <clientUserId>1</clientUserId> 
     <tabs> 
     <textTabs> 
      <text> 
      <tabLabel>streetAddress</tabLabel> 
      <name>streetAddress</name> 
      <value>ワタシ</value> 
      </text> 
      <text> 
      <tabLabel>Zip</tabLabel> 
      <name>Zip</name> 
      <value>ワタシ</value> 
      </text> 
      <text> 
      <tabLabel>Nationality</tabLabel> 
      <name>Nationality</name> 
      <value>Afghanistan</value> 
      </text> 
      <text> 
      <tabLabel>City</tabLabel> 
      <name>City</name> 
      <value>ワタシ</value> 
      </text> 
      <text> 
      <tabLabel>Region</tabLabel> 
      <name>Region</name> 
      <value>Aiti [Aichi]</value> 
      </text> 
      <text> 
      <tabLabel>Country</tabLabel> 
      <name>Country</name> 
      <value>Japan</value> 
      </text> 
     </textTabs> 
     </tabs> 
    </templateRole> 
    </templateRoles> 
    </e 

-Update 2- 的請求主體事實證明這是一個問題爲字節數組獲得正確的大小。我使用的是C#嵌入式簽名演練中的代碼。在漫遊中,它從字符串的長度而不是字節數組中分配主體大小。

取而代之的是(在Embedded Signing Walkthrough

public static void addRequestBody(HttpWebRequest request, string requestBody) 

    { 
     // create byte array out of request body and add to the request object 
     byte[] body = System.Text.Encoding.UTF8.GetBytes (requestBody); 
     Stream dataStream = request.GetRequestStream(); 
     dataStream.Write (body, 0, requestBody.Length); 
     dataStream.Close(); 
    } 

它應該是這個

public static void addRequestBody(HttpWebRequest request, string requestBody) 

    { 
     // create byte array out of request body and add to the request object 
     byte[] body = System.Text.Encoding.UTF8.GetBytes (requestBody); 
     Stream dataStream = request.GetRequestStream(); 
     dataStream.Write (body, 0, body.Length); 
     dataStream.Close(); 
    } 

現在所有的UTF-8字符的工作。片假名字符導致更多的身體字符從最後被刪除的原因是,亞洲語言字符集傾向於3字節,而西里爾文和希臘字母傾向於爲2.

回答

1

現在確實支持非拉丁文UTF字符通過DocuSign的REST API。我已經運行了一些最近的測試,這是按預期工作,所以請再次嘗試您的請求,如果不工作,請在您的問題中發佈您的請求正文。

下面是我剛剛與測試樣品JSON請求機構之一,注意textTab的價值:

{ 
    "emailSubject": "DocuSign REST API Testing", 
    "documents": [ 
     { 
      "documentId": "1", 
      "name": "test.pdf" 
     } 
    ], 
    "recipients": { 
     "signers": [ 
      { 
       "email": "[email protected]", 
       "name": "Ergin D.", 
       "recipientId": "1", 
       "tabs": { 
        "signHereTabs": [ 
         { 
          "xPosition": "100", 
          "yPosition": "100", 
          "documentId": "1", 
          "pageNumber": "1" 
         } 
        ], 
        "textTabs": [ 
         { 
          "xPosition": "200", 
          "yPosition": "100", 
          "documentId": "1", 
          "pageNumber": "1", 
          "tabLabel": "name", 
          "value": "Цццццццasdfasfd" 
         } 
        ] 
       } 
      } 
     ] 
    }, 
    "status": "sent" 
}