3. Prepare the Identifiers
Before retrieving an envelope, pre-process and hash the identifiers. In a server-side implementation, your server normalizes and hashes each identifier before it sends the request. Emails are the most common identifier. The Envelope API also accepts hashed phone numbers for U.S. users.
Pre-Process the Identifiers
Apply the following basic normalization steps to improve the match rate and make sure the identifiers are valid:
For emails:
- Validate the email against a regular expression.
- Remove spaces, tabs and other empty characters from the plaintext email.
- Convert any cApiTaL letters into the lowercase equivalent. For example;
[email protected]should become[email protected]. - For ALL email addresses - remove any pluses "+" and what comes after it. For example;
[email protected]should become [email protected]. - For GMAIL addresses, remove any dots "." before "@". For example;
[email protected]should become [email protected]. - Drop "fake" emails. We recommend using an email validator library to filter out fake emails.
For phone numbers:
Ensure you remove any country codes or formatting before SHA1 hashing, e.g.:
+1 (415) 555-6656 should become 4155556656 before hashing.
Hash Identifiers Properly
Hash identifiers and indicate the correct identifier type when you call the Envelope API.
For email identifiers
Call the API with all three email hash types to get the best match rate.
- SHA256 (use this if you are only able to hash one)
- SHA1
- MD5
Use a standard hashing library in your server language. If you hash in the browser, a library like jshashes on the web or node is recommended. See our Best Practices for technical guidance.
For phone number identifiers (US only)
For a user with a phone number identifier, only SHA1 hashes should be passed. Note that hashed phone numbers are currently only supported for U.S. ten-digit phone numbers.
Updated 4 days ago