0
我的用例是一個文檔必須由兩個人簽名:一個是我們有一個電子郵件地址的普通用戶,另一個用戶可以是任何我的應用程序。管理員用戶是在普通用戶簽名後選擇的。DocuSign API:將新收件人添加到信封時重複的initialHere選項卡
我當前使用DocuSign API實現時會創建一個包含兩個簽名者的信封,即常規用戶和名爲admin-placeholder
的第二個簽名者。
當管理員開始簽名時,我會調用API以用實際管理員替換admin-placeholder
。
這裏是我的PHP代碼(callDocusign
函數做什麼它似乎做):
// fetch tabs of placeholder user
$tabs= callDocusign($docusignLogin, 'GET', "envelopes/$envelopeId/recipients/$placeholderRecipient/tabs?include_anchor_tab_locations=true");
// remove tabIds to avoid issue on submission
foreach(array_keys($tabs) as $kind) {
for ($i = 0; $i < count($tabs[$kind]); $i++) {
// sanitize_user_input removes all properties except those listed in its second argument
$tabs[$kind][$i] = sanitize_user_input($tabs[$kind][$i], ["documentId", "pageNumber", "xPosition", "yPosition", "anchorString", "anchorXOffset", "anchorYOffset", "anchorIgnoreIfNotPresent", "anchorUnits"]);
}
}
// add signer
$data = [
'signers' => [[
'email' => $user['email'],
'clientUserId' => pseudo_encrypt($uid),
'recipientId' => pseudo_encrypt($uid),
'name' => user_full_name($user),
]],
];
callDocusign($docusignLogin, 'POST', "envelopes/$envelopeId/recipients", $data);
// delete placeholder signer
callDocusign($docusignLogin, 'DELETE', "envelopes/$envelopeId/recipients/$placeholderRecipient");
// for some reason setting tabs at signer creation doesn't work
// we'll create them now
callDocusign($docusignLogin, 'POST', "envelopes/$envelopeId/recipients/".pseudo_encrypt($uid).'/tabs', $tabs);
所有工作正常,但這個過程結束了複製的佔位符用戶的所有initialHere
標籤。在我的使用案例中,第一個用戶有14 initialHere
選項卡,第二個簽名者最終以28. 28.
更新佔位符用戶而不是刪除它確實可以解決我發現的API錯誤。謝謝 ! – olivieradam666