Helpers
Utility and convenience functions provided by the Verdocs SDKs.
auth.createCodeChallenge
Create the PKCE code challenge for a verifier: the base64url-encoded SHA-256 of it. Isomorphic, using WebCrypto in both browsers and Node 18 or later.
createCodeChallenge(verifier: string): Promise<string>| Parameter | Type | Description |
|---|---|---|
verifier | string |
auth.createCodeVerifier
Create a PKCE code verifier: 43 characters of URL-safe randomness, per RFC 7636. Keep it where it will survive the round trip to the provider (`sessionStorage` in a browser), pass its challenge to `getSocialLoginUrl()`, and send it back with the `login-code` grant.
createCodeVerifier(): stringauth.getMFAChallenge
Companion to `isMFARequired()` that returns the challenge body, or null if the error is something else. Handy in `catch` blocks that just need the `mfa_token`.
getMFAChallenge(e: unknown): IMFARequiredError | null| Parameter | Type | Description |
|---|---|---|
e | unknown |
auth.isMFARequired
Type guard for the `mfa_required` challenge. A sign-in for a user with MFA enabled fails with a 403 carrying `{error: 'mfa_required', mfa_token}`, and the app finishes the sign-in with an mfa grant. Use `getMFAChallenge()` instead if it is easier to work with the body directly.
isMFARequired(e: unknown): boolean| Parameter | Type | Description |
|---|---|---|
e | unknown |
auth.createCodeChallenge
Create the PKCE code challenge for a verifier: the base64url-encoded SHA-256 of it. Isomorphic, using WebCrypto in both browsers and Node 18 or later.
create_code_challenge(verifier: str) -> str| Parameter | Type | Description |
|---|---|---|
verifier | str | The value returned by create_code_verifier(). |
auth.createCodeVerifier
Create a PKCE code verifier: 43 characters of URL-safe randomness, per RFC 7636. Keep it where it will survive the round trip to the provider (`sessionStorage` in a browser), pass its challenge to `getSocialLoginUrl()`, and send it back with the `login-code` grant.
create_code_verifier() -> strauth.getMFAChallenge
Companion to `isMFARequired()` that returns the challenge body, or null if the error is something else. Handy in `catch` blocks that just need the `mfa_token`.
get_mfa_challenge(error: object) -> MFAChallenge | None| Parameter | Type | Description |
|---|---|---|
error | object | Any object, usually a caught exception. |
auth.isMFARequired
Type guard for the `mfa_required` challenge. A sign-in for a user with MFA enabled fails with a 403 carrying `{error: 'mfa_required', mfa_token}`, and the app finishes the sign-in with an mfa grant. Use `getMFAChallenge()` instead if it is easier to work with the body directly.
is_mfa_required(error: object) -> TypeGuard[MFARequiredError]| Parameter | Type | Description |
|---|---|---|
error | object | Any object, usually a caught exception. |
auth.createCodeChallenge
Create the PKCE code challenge for a verifier: the base64url-encoded SHA-256 of it. Isomorphic, using WebCrypto in both browsers and Node 18 or later.
string CreateCodeChallenge(string verifier)| Parameter | Type | Description |
|---|---|---|
verifier | string | The verifier from CreateCodeVerifier. |
auth.createCodeVerifier
Create a PKCE code verifier: 43 characters of URL-safe randomness, per RFC 7636. Keep it where it will survive the round trip to the provider (`sessionStorage` in a browser), pass its challenge to `getSocialLoginUrl()`, and send it back with the `login-code` grant.
string CreateCodeVerifier()auth.getMFAChallenge
Companion to `isMFARequired()` that returns the challenge body, or null if the error is something else. Handy in `catch` blocks that just need the `mfa_token`.
Not yet available for C#.
auth.isMFARequired
Type guard for the `mfa_required` challenge. A sign-in for a user with MFA enabled fails with a 403 carrying `{error: 'mfa_required', mfa_token}`, and the app finishes the sign-in with an mfa grant. Use `getMFAChallenge()` instead if it is easier to work with the body directly.
Not yet available for C#.
color.getRGB
Given a `rgba(r,g,b,a)` string value, returns the hex equivalent, dropping the alpha channel.
getRGB(rgba: string): string| Parameter | Type | Description |
|---|---|---|
rgba | string |
color.getRGBA
Given a signer role index, return the color code for that signer.
getRGBA(roleIndex: number): 'rgba(255, 193, 7, 0.4)' | 'rgba(134, 134, 134, 0.3)' | 'rgba(156, 39, 176, .4)' | 'rgba(33, 150, 243, .4)' | 'rgba(220, 231, 117, 0.3)' | 'rgba(121, 134, 203, 0.3)' | 'rgba(77, 182, 172, 0.3)' | 'rgba(255, 202, 165, 0.3)' | 'rgba(2, 247, 190, 0.3)' | 'rgba(255, 138, 101, 0.3)' | 'rgba(82, 255, 79, 0.3)' | 'rgba(229, 115, 155, 0.3)'| Parameter | Type | Description |
|---|---|---|
roleIndex | number |
color.getRoleColor
Helper function to obtain a color code given a role name given various possible inputs.
getRoleColor(name: string, roles: TRole[], index?: number): string | undefined| Parameter | Type | Description |
|---|---|---|
name | string | |
roles | TRole[] | |
index? | number |
color.nameToRGBA
Given a role name, return a color code for it. This works by computing a hash code so the specific color returned is not specified explicitly, but will be the same for every call with the same input value.
nameToRGBA(str: string): string | undefined| Parameter | Type | Description |
|---|---|---|
str | string |
color.getRGB
Given a `rgba(r,g,b,a)` string value, returns the hex equivalent, dropping the alpha channel.
Not yet available for Python.
color.getRGBA
Given a signer role index, return the color code for that signer.
Not yet available for Python.
color.getRoleColor
Helper function to obtain a color code given a role name given various possible inputs.
Not yet available for Python.
color.nameToRGBA
Given a role name, return a color code for it. This works by computing a hash code so the specific color returned is not specified explicitly, but will be the same for every call with the same input value.
Not yet available for Python.
color.getRGB
Given a `rgba(r,g,b,a)` string value, returns the hex equivalent, dropping the alpha channel.
string GetRgb(string rgba)| Parameter | Type | Description |
|---|---|---|
rgba | string | A CSS rgba() string, e.g. "rgba(255, 193, 7, 0.4)". |
color.getRGBA
Given a signer role index, return the color code for that signer.
string GetRgba(int roleIndex)| Parameter | Type | Description |
|---|---|---|
roleIndex | int | Zero-based index of the role in the template's role list. |
color.getRoleColor
Helper function to obtain a color code given a role name given various possible inputs.
string? GetRoleColor(string? name, IReadOnlyList<string>? roles, int? index = null)| Parameter | Type | Description |
|---|---|---|
name | string? | The role name to color. |
roles | IReadOnlyList<string>? | The template's role names, in order. May be null or empty. |
index? | int? | Explicit role index. The js-sdk checks truthiness, so 0 falls through to the roles lookup; we keep that quirk. |
color.nameToRGBA
Given a role name, return a color code for it. This works by computing a hash code so the specific color returned is not specified explicitly, but will be the same for every call with the same input value.
string? NameToRgba(string? name)| Parameter | Type | Description |
|---|---|---|
name | string? | The role name. Names ending in a digit get extra hash input so "Signer 1" and "Signer 2" land on visibly different colors. |
dateTime.formatShortTimeAgo
formatShortTimeAgo(val: any): string| Parameter | Type | Description |
|---|---|---|
val | any |
dateTime.formatShortTimeAgo
format_short_time_ago(val: datetime | str | int | float | None) -> str| Parameter | Type | Description |
|---|---|---|
val | datetime | str | int | float | None | The moment to describe. None, unsupported types, and unparseable strings yield "". |
dateTime.formatShortTimeAgo
string FormatShortTimeAgo(DateTimeOffset? value)| Parameter | Type | Description |
|---|---|---|
value | DateTimeOffset? | The moment to describe; null yields "". |
entitlement.collapseEntitlements
collapseEntitlements(entitlements: IEntitlement[]): Partial<Record<TEntitlement, IEntitlement>>| Parameter | Type | Description |
|---|---|---|
entitlements | IEntitlement[] |
entitlement.collapseEntitlements
collapse_entitlements(entitlements: list[Entitlement]) -> ActiveEntitlements| Parameter | Type | Description |
|---|---|---|
entitlements | list[Entitlement] | The raw records, e.g. from organizations.get_entitlements(). |
entitlement.collapseEntitlements
IReadOnlyDictionary<string, Entitlement> CollapseEntitlements(IEnumerable<Entitlement> entitlements)| Parameter | Type | Description |
|---|---|---|
entitlements | IEnumerable<Entitlement> | The raw records, e.g. from GetEntitlementsAsync. |
envelope.canAccessEnvelope
Check to see if the profile ID is the envelope's sender or one of the recipients.
canAccessEnvelope(profile_id: string | null | undefined, envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
profile_id | string | null | undefined | |
envelope | IEnvelope |
envelope.envelopeIsActive
Check to see if the envelope has pending actions.
envelopeIsActive(envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
envelope | IEnvelope |
envelope.envelopeIsComplete
Check to see if the envelope has been completed.
envelopeIsComplete(envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
envelope | IEnvelope |
envelope.getMyRecipient
Regardless of if the session is `user` or `signer`, returns the envelope's recipient that matches the user's session.
getMyRecipient(session: TSession, envelope: IEnvelope): IRecipient | undefined| Parameter | Type | Description |
|---|---|---|
session | TSession | |
envelope | IEnvelope |
envelope.getNextRecipient
getNextRecipient(envelope: IEnvelope): IRecipient| Parameter | Type | Description |
|---|---|---|
envelope | IEnvelope |
envelope.getRecipient
Get a recipient from an envelope via an email match.
getRecipient(email: string, envelope: IEnvelope): IRecipient | undefined| Parameter | Type | Description |
|---|---|---|
email | string | |
envelope | IEnvelope |
envelope.getRecipientsWithActions
Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).
getRecipientsWithActions(envelope: IEnvelope): IRecipient[]| Parameter | Type | Description |
|---|---|---|
envelope | IEnvelope |
envelope.getRecipientWithActions
Get a recipient that can act from an envelope via an email match.
getRecipientWithActions(email: string, envelope: IEnvelope): boolean | undefined| Parameter | Type | Description |
|---|---|---|
email | string | |
envelope | IEnvelope |
envelope.isEnvelopeOwner
Check to see if the profile ID owns the envelope.
isEnvelopeOwner(profile_id: string | null | undefined, envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
profile_id | string | null | undefined | |
envelope | IEnvelope |
envelope.isEnvelopeRecipient
Check to see if the profile ID is a recipient within the envelope.
isEnvelopeRecipient(profile_id: string | null | undefined, envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
profile_id | string | null | undefined | |
envelope | IEnvelope |
envelope.isFieldFilled
isFieldFilled(field: IEnvelopeField, allRecipientFields: IEnvelopeField[]): boolean | '' | null| Parameter | Type | Description |
|---|---|---|
field | IEnvelopeField | |
allRecipientFields | IEnvelopeField[] |
envelope.isFieldValid
isFieldValid(field: IEnvelopeField, allRecipientFields: IEnvelopeField[]): boolean | '' | null| Parameter | Type | Description |
|---|---|---|
field | IEnvelopeField | |
allRecipientFields | IEnvelopeField[] |
envelope.recipientCanAct
Returns true if the recipient can act.
recipientCanAct(recipient: IRecipient, recipientsWithActions: IRecipient[]): boolean| Parameter | Type | Description |
|---|---|---|
recipient | IRecipient | |
recipientsWithActions | IRecipient[] |
envelope.recipientHasAction
Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).
recipientHasAction(recipient: IRecipient): boolean| Parameter | Type | Description |
|---|---|---|
recipient | IRecipient |
envelope.sortDocuments
Utility function to sort documents by their order, falling back to created_at. NOTE: This function mutates the input array.
sortDocuments(documents: object[]): object[]| Parameter | Type | Description |
|---|---|---|
documents | object[] |
envelope.sortFields
Utility function to sort fields by page, then by Y coordinate, then by X coordinate. NOTE: This function mutates the input array.
sortFields(fields: object[]): object[]| Parameter | Type | Description |
|---|---|---|
fields | object[] |
envelope.sortRecipients
Utility function to sort documents by their order, falling back to created_at. NOTE: This function mutates the input array.
sortRecipients(recipients?: object[]): object[] | undefined| Parameter | Type | Description |
|---|---|---|
recipients? | object[] |
envelope.useCanAccessEnvelope
Check to see if the profile ID is the envelope's sender or one of the recipients.
useCanAccessEnvelope(profile: IProfile | null | undefined, envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
envelope | IEnvelope |
envelope.userCanAct
Returns true if the user can act.
userCanAct(email: string, recipientsWithActions: IRecipient[]): boolean | undefined| Parameter | Type | Description |
|---|---|---|
email | string | |
recipientsWithActions | IRecipient[] |
envelope.userCanCancelEnvelope
Check to see if the user owns the envelope.
userCanCancelEnvelope(profile: IProfile | null | undefined, envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
envelope | IEnvelope |
envelope.userCanFinishEnvelope
Check to see if the user owns the envelope.
userCanFinishEnvelope(profile: IProfile | null | undefined, envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
envelope | IEnvelope |
envelope.userCanResetEnvelope
Check to see if the user can reset the envelope: they own it, and it either expired or has a recipient who failed authentication. This may be used to pre-determine if the envelope may be reset before calling `resetEnvelope`, e.g. to disable a "Reset" button.
userCanResetEnvelope(profile: IProfile | null | undefined, envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
envelope | IEnvelope |
envelope.userCanSignNow
Returns true if the user can act.
userCanSignNow(profile: IProfile | null | undefined, envelope: IEnvelope): boolean | undefined| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
envelope | IEnvelope |
envelope.userIsEnvelopeOwner
Check to see if the user owns the envelope.
userIsEnvelopeOwner(profile: IProfile | null | undefined, envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
envelope | IEnvelope |
envelope.userIsEnvelopeRecipient
Check to see if the user is a recipient within the envelope.
userIsEnvelopeRecipient(profile: IProfile | null | undefined, envelope: IEnvelope): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
envelope | IEnvelope |
envelope.canAccessEnvelope
Check to see if the profile ID is the envelope's sender or one of the recipients.
Not yet available for Python.
envelope.envelopeIsActive
Check to see if the envelope has pending actions.
Not yet available for Python.
envelope.envelopeIsComplete
Check to see if the envelope has been completed.
Not yet available for Python.
envelope.getMyRecipient
Regardless of if the session is `user` or `signer`, returns the envelope's recipient that matches the user's session.
Not yet available for Python.
envelope.getNextRecipient
Not yet available for Python.
envelope.getRecipient
Get a recipient from an envelope via an email match.
Not yet available for Python.
envelope.getRecipientsWithActions
Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).
Not yet available for Python.
envelope.getRecipientWithActions
Get a recipient that can act from an envelope via an email match.
Not yet available for Python.
envelope.isEnvelopeOwner
Check to see if the profile ID owns the envelope.
Not yet available for Python.
envelope.isEnvelopeRecipient
Check to see if the profile ID is a recipient within the envelope.
Not yet available for Python.
envelope.isFieldFilled
Not yet available for Python.
envelope.isFieldValid
Not yet available for Python.
envelope.recipientCanAct
Returns true if the recipient can act.
Not yet available for Python.
envelope.recipientHasAction
Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).
Not yet available for Python.
envelope.sortDocuments
Utility function to sort documents by their order, falling back to created_at. NOTE: This function mutates the input array.
Not yet available for Python.
envelope.sortFields
Utility function to sort fields by page, then by Y coordinate, then by X coordinate. NOTE: This function mutates the input array.
Not yet available for Python.
envelope.sortRecipients
Utility function to sort documents by their order, falling back to created_at. NOTE: This function mutates the input array.
Not yet available for Python.
envelope.useCanAccessEnvelope
Check to see if the profile ID is the envelope's sender or one of the recipients.
Not yet available for Python.
envelope.userCanAct
Returns true if the user can act.
Not yet available for Python.
envelope.userCanCancelEnvelope
Check to see if the user owns the envelope.
Not yet available for Python.
envelope.userCanFinishEnvelope
Check to see if the user owns the envelope.
Not yet available for Python.
envelope.userCanResetEnvelope
Check to see if the user can reset the envelope: they own it, and it either expired or has a recipient who failed authentication. This may be used to pre-determine if the envelope may be reset before calling `resetEnvelope`, e.g. to disable a "Reset" button.
Not yet available for Python.
envelope.userCanSignNow
Returns true if the user can act.
Not yet available for Python.
envelope.userIsEnvelopeOwner
Check to see if the user owns the envelope.
Not yet available for Python.
envelope.userIsEnvelopeRecipient
Check to see if the user is a recipient within the envelope.
Not yet available for Python.
envelope.canAccessEnvelope
Check to see if the profile ID is the envelope's sender or one of the recipients.
bool CanAccessEnvelope(string? profileId, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
profileId | string? | The profile ID to check, or null for no session. |
envelope | Envelope | The envelope to check against. |
envelope.envelopeIsActive
Check to see if the envelope has pending actions.
bool EnvelopeIsActive(Envelope envelope)| Parameter | Type | Description |
|---|---|---|
envelope | Envelope | The envelope to check. |
envelope.envelopeIsComplete
Check to see if the envelope has been completed.
bool EnvelopeIsComplete(Envelope envelope)| Parameter | Type | Description |
|---|---|---|
envelope | Envelope | The envelope to check. |
envelope.getMyRecipient
Regardless of if the session is `user` or `signer`, returns the envelope's recipient that matches the user's session.
Recipient? GetMyRecipient(VerdocsSession? session, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
session | VerdocsSession? | The current session, or null for no session. |
envelope | Envelope | The envelope to scan. |
envelope.getNextRecipient
Recipient? GetNextRecipient(Envelope envelope)| Parameter | Type | Description |
|---|---|---|
envelope | Envelope | The envelope to scan. |
envelope.getRecipient
Get a recipient from an envelope via an email match.
Recipient? GetRecipient(string email, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
email | string | The email address to look for. |
envelope | Envelope | The envelope to scan. |
envelope.getRecipientsWithActions
Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).
IReadOnlyList<Recipient> GetRecipientsWithActions(Envelope envelope)| Parameter | Type | Description |
|---|---|---|
envelope | Envelope | The envelope to scan. |
envelope.getRecipientWithActions
Get a recipient that can act from an envelope via an email match.
bool GetRecipientWithActions(string email, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
email | string | The email address to look for. |
envelope | Envelope | The envelope to scan. |
envelope.isEnvelopeOwner
Check to see if the profile ID owns the envelope.
bool IsEnvelopeOwner(string? profileId, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
profileId | string? | The profile ID to check, or null for no session. |
envelope | Envelope | The envelope to check against. |
envelope.isEnvelopeRecipient
Check to see if the profile ID is a recipient within the envelope.
bool IsEnvelopeRecipient(string? profileId, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
profileId | string? | The profile ID to check, or null for no session. |
envelope | Envelope | The envelope to check against. |
envelope.isFieldFilled
bool IsFieldFilled(EnvelopeField field, IReadOnlyList<EnvelopeField> allRecipientFields)| Parameter | Type | Description |
|---|---|---|
field | EnvelopeField | The field to check. |
allRecipientFields | IReadOnlyList<EnvelopeField> | Every field assigned to the same recipient, used to resolve grouped fields. |
envelope.isFieldValid
bool IsFieldValid(EnvelopeField field, IReadOnlyList<EnvelopeField> allRecipientFields)| Parameter | Type | Description |
|---|---|---|
field | EnvelopeField | The field to check. |
allRecipientFields | IReadOnlyList<EnvelopeField> | Every field assigned to the same recipient, used to resolve grouped fields. |
envelope.recipientCanAct
Returns true if the recipient can act.
bool RecipientCanAct(Recipient recipient, IReadOnlyList<Recipient> recipientsWithActions)| Parameter | Type | Description |
|---|---|---|
recipient | Recipient | The recipient to check. |
recipientsWithActions | IReadOnlyList<Recipient> | The pending recipients, from GetRecipientsWithActions. |
envelope.recipientHasAction
Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).
bool RecipientHasAction(Recipient recipient)| Parameter | Type | Description |
|---|---|---|
recipient | Recipient | The recipient to check. |
envelope.sortDocuments
Utility function to sort documents by their order, falling back to created_at. NOTE: This function mutates the input array.
List<EnvelopeDocument> SortDocuments(List<EnvelopeDocument> documents)| Parameter | Type | Description |
|---|---|---|
documents | List<EnvelopeDocument> | The documents to sort. Modified in place. |
envelope.sortFields
Utility function to sort fields by page, then by Y coordinate, then by X coordinate. NOTE: This function mutates the input array.
List<EnvelopeField> SortFields(List<EnvelopeField> fields)| Parameter | Type | Description |
|---|---|---|
fields | List<EnvelopeField> | The fields to sort. Modified in place. |
envelope.sortRecipients
Utility function to sort documents by their order, falling back to created_at. NOTE: This function mutates the input array.
List<Recipient>? SortRecipients(List<Recipient>? recipients)| Parameter | Type | Description |
|---|---|---|
recipients | List<Recipient>? | The recipients to sort. Modified in place. |
envelope.useCanAccessEnvelope
Check to see if the profile ID is the envelope's sender or one of the recipients.
Not yet available for C#.
envelope.userCanAct
Returns true if the user can act.
bool UserCanAct(string email, IReadOnlyList<Recipient> recipientsWithActions)| Parameter | Type | Description |
|---|---|---|
email | string | The email address to look for. |
recipientsWithActions | IReadOnlyList<Recipient> | The pending recipients, from GetRecipientsWithActions. |
envelope.userCanCancelEnvelope
Check to see if the user owns the envelope.
bool UserCanCancelEnvelope(Profile? profile, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
envelope | Envelope | The envelope to check against. |
envelope.userCanFinishEnvelope
Check to see if the user owns the envelope.
bool UserCanFinishEnvelope(Profile? profile, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
envelope | Envelope | The envelope to check against. |
envelope.userCanResetEnvelope
Check to see if the user can reset the envelope: they own it, and it either expired or has a recipient who failed authentication. This may be used to pre-determine if the envelope may be reset before calling `resetEnvelope`, e.g. to disable a "Reset" button.
Not yet available for C#.
envelope.userCanSignNow
Returns true if the user can act.
bool UserCanSignNow(Profile? profile, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
envelope | Envelope | The envelope to check against. |
envelope.userIsEnvelopeOwner
Check to see if the user owns the envelope.
bool UserIsEnvelopeOwner(Profile? profile, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
envelope | Envelope | The envelope to check against. |
envelope.userIsEnvelopeRecipient
Check to see if the user is a recipient within the envelope.
bool UserIsEnvelopeRecipient(Profile? profile, Envelope envelope)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
envelope | Envelope | The envelope to check against. |
field.blobToBase64
blobToBase64(image: Blob): Promise<unknown>| Parameter | Type | Description |
|---|---|---|
image | Blob |
field.getRLeft
getRLeft(x: number, ratio: number): number| Parameter | Type | Description |
|---|---|---|
x | number | |
ratio | number |
field.getRTop
getRTop(y: number, fieldHeight: number, iTextHeight: number, yRatio: number): number| Parameter | Type | Description |
|---|---|---|
y | number | |
fieldHeight | number | |
iTextHeight | number | |
yRatio | number |
field.getRValue
getRValue(y: number, ratio: number): number| Parameter | Type | Description |
|---|---|---|
y | number | |
ratio | number |
field.rescale
rescale(r: number, n: number): number| Parameter | Type | Description |
|---|---|---|
r | number | |
n | number |
field.blobToBase64
Not yet available for Python.
field.getRLeft
Not yet available for Python.
field.getRTop
Not yet available for Python.
field.getRValue
Not yet available for Python.
field.rescale
Not yet available for Python.
field.blobToBase64
Not yet available for C#.
field.getRLeft
Not yet available for C#.
field.getRTop
Not yet available for C#.
field.getRValue
Not yet available for C#.
field.rescale
Not yet available for C#.
fieldUtil.getRTop
Returns the rendered top offset for a field. Flips the y axis: PDF y grows upward from the page bottom, screen y grows downward from the top.
Not yet available for Node.js.
fieldUtil.getRLeft
Returns the rendered left offset for a field: its PDF x scaled to pixels.
Not yet available for Node.js.
fieldUtil.getRValue
Returns a document-space value scaled to rendered pixels.
Not yet available for Node.js.
fieldUtil.rescale
Returns a value scaled by a ratio.
Not yet available for Node.js.
fieldUtil.blobToBase64
Encodes raw bytes as a base64 string. Adapted from the js-sdk's blobToBase64, which reads a browser Blob through FileReader and resolves a data URL. A byte array carries no MIME type, so this returns the bare base64 payload; use BytesToDataUrl when the "data:<type>;base64," prefix is needed.
Not yet available for Node.js.
fieldUtil.getRTop
Returns the rendered top offset for a field. Flips the y axis: PDF y grows upward from the page bottom, screen y grows downward from the top.
Not yet available for Python.
fieldUtil.getRLeft
Returns the rendered left offset for a field: its PDF x scaled to pixels.
Not yet available for Python.
fieldUtil.getRValue
Returns a document-space value scaled to rendered pixels.
Not yet available for Python.
fieldUtil.rescale
Returns a value scaled by a ratio.
Not yet available for Python.
fieldUtil.blobToBase64
Encodes raw bytes as a base64 string. Adapted from the js-sdk's blobToBase64, which reads a browser Blob through FileReader and resolves a data URL. A byte array carries no MIME type, so this returns the bare base64 payload; use BytesToDataUrl when the "data:<type>;base64," prefix is needed.
Not yet available for Python.
fieldUtil.getRTop
Returns the rendered top offset for a field. Flips the y axis: PDF y grows upward from the page bottom, screen y grows downward from the top.
double GetRTop(double y, double fieldHeight, double iTextHeight, double yRatio)| Parameter | Type | Description |
|---|---|---|
y | double | The field's PDF y position (bottom edge). |
fieldHeight | double | The field's height in document units. |
iTextHeight | double | The rendered page height in pixels. |
yRatio | double | Pixels per document unit on the y axis. |
fieldUtil.getRLeft
Returns the rendered left offset for a field: its PDF x scaled to pixels.
double GetRLeft(double x, double ratio)| Parameter | Type | Description |
|---|---|---|
x | double | The field's PDF x position. |
ratio | double | Pixels per document unit on the x axis. |
fieldUtil.getRValue
Returns a document-space value scaled to rendered pixels.
double GetRValue(double y, double ratio)| Parameter | Type | Description |
|---|---|---|
y | double | The value in document units. |
ratio | double | Pixels per document unit. |
fieldUtil.rescale
Returns a value scaled by a ratio.
double Rescale(double r, double n)| Parameter | Type | Description |
|---|---|---|
r | double | The value to scale. |
n | double | The ratio to scale by. |
fieldUtil.blobToBase64
Encodes raw bytes as a base64 string. Adapted from the js-sdk's blobToBase64, which reads a browser Blob through FileReader and resolves a data URL. A byte array carries no MIME type, so this returns the bare base64 payload; use BytesToDataUrl when the "data:<type>;base64," prefix is needed.
string BytesToBase64(byte[] data)| Parameter | Type | Description |
|---|---|---|
data | byte[] | The bytes to encode. |
file.downloadBlob
Trigger a download dialog to save a blob as a file on disk.
downloadBlob(blob: Blob, name: string = 'file.pdf'): void| Parameter | Type | Description |
|---|---|---|
blob | Blob | |
name? | string |
file.fileToDataUrl
Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that includes the MIME type of the file, e.g. "data:image/jpeg;base64,iVBORw0K......"
fileToDataUrl(file: File): Promise<IFileWithData>| Parameter | Type | Description |
|---|---|---|
file | File |
file.downloadBlob
Trigger a download dialog to save a blob as a file on disk.
Not yet available for Python.
file.fileToDataUrl
Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that includes the MIME type of the file, e.g. "data:image/jpeg;base64,iVBORw0K......"
bytes_to_data_url(data: bytes, content_type: str) -> str| Parameter | Type | Description |
|---|---|---|
data | bytes | The file content. |
content_type | str | The MIME type to embed, e.g. "application/pdf". |
file.downloadBlob
Trigger a download dialog to save a blob as a file on disk.
Not yet available for C#.
file.fileToDataUrl
Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that includes the MIME type of the file, e.g. "data:image/jpeg;base64,iVBORw0K......"
string BytesToDataUrl(byte[] data, string contentType)| Parameter | Type | Description |
|---|---|---|
data | byte[] | The file content. |
contentType | string | The MIME type to embed, e.g. "application/pdf". |
locale.getCountryByCode
getCountryByCode(code: string): ICountry | null| Parameter | Type | Description |
|---|---|---|
code | string |
locale.getMatchingCountry
getMatchingCountry(code: string, substrings: number): number| Parameter | Type | Description |
|---|---|---|
code | string | |
substrings | number |
locale.getPlusOneCountry
getPlusOneCountry(code: string): ICountry | null| Parameter | Type | Description |
|---|---|---|
code | string |
locale.isAmericanSamoa
isAmericanSamoa(code: string): boolean| Parameter | Type | Description |
|---|---|---|
code | string |
locale.isCanada
isCanada(code: string): boolean| Parameter | Type | Description |
|---|---|---|
code | string |
locale.isDominicanRepublic
isDominicanRepublic(code: string): boolean| Parameter | Type | Description |
|---|---|---|
code | string |
locale.isFrenchGuiana
isFrenchGuiana(code: string): boolean| Parameter | Type | Description |
|---|---|---|
code | string |
locale.isGuadeloupe
isGuadeloupe(code: string): boolean| Parameter | Type | Description |
|---|---|---|
code | string |
locale.isMartinique
isMartinique(code: string): boolean| Parameter | Type | Description |
|---|---|---|
code | string |
locale.isMayotte
isMayotte(code: string): boolean| Parameter | Type | Description |
|---|---|---|
code | string |
locale.isPuertoRico
isPuertoRico(code: string): boolean| Parameter | Type | Description |
|---|---|---|
code | string |
locale.getCountryByCode
Not yet available for Python.
locale.getMatchingCountry
Not yet available for Python.
locale.getPlusOneCountry
Not yet available for Python.
locale.isAmericanSamoa
Not yet available for Python.
locale.isCanada
Not yet available for Python.
locale.isDominicanRepublic
Not yet available for Python.
locale.isFrenchGuiana
Not yet available for Python.
locale.isGuadeloupe
Not yet available for Python.
locale.isMartinique
Not yet available for Python.
locale.isMayotte
Not yet available for Python.
locale.isPuertoRico
Not yet available for Python.
locale.getCountryByCode
Country? GetCountryByCode(string code)| Parameter | Type | Description |
|---|---|---|
code | string | The display code to look up. |
locale.getMatchingCountry
int GetMatchingCountry(string code, int substrings)| Parameter | Type | Description |
|---|---|---|
code | string | The phone code to match. |
substrings | int | How many leading characters to compare (negative counts as zero, like the JS substring bound). |
locale.getPlusOneCountry
Country? GetPlusOneCountry(string code)| Parameter | Type | Description |
|---|---|---|
code | string | The phone code to resolve. |
locale.isAmericanSamoa
bool IsAmericanSamoa(string code)| Parameter | Type | Description |
|---|---|---|
code | string | The phone code to check. |
locale.isCanada
bool IsCanada(string code)| Parameter | Type | Description |
|---|---|---|
code | string | The phone code to check. |
locale.isDominicanRepublic
bool IsDominicanRepublic(string code)| Parameter | Type | Description |
|---|---|---|
code | string | The phone code to check. |
locale.isFrenchGuiana
bool IsFrenchGuiana(string code)| Parameter | Type | Description |
|---|---|---|
code | string | The phone code to check. |
locale.isGuadeloupe
bool IsGuadeloupe(string code)| Parameter | Type | Description |
|---|---|---|
code | string | The phone code to check. |
locale.isMartinique
bool IsMartinique(string code)| Parameter | Type | Description |
|---|---|---|
code | string | The phone code to check. |
locale.isMayotte
bool IsMayotte(string code)| Parameter | Type | Description |
|---|---|---|
code | string | The phone code to check. |
locale.isPuertoRico
bool IsPuertoRico(string code)| Parameter | Type | Description |
|---|---|---|
code | string | The phone code to check. |
permission.userHasPermissions
Confirm whether the user has all of the specified permissions, resolving the profile's direct permissions, the permissions granted by its roles, and any group profiles.
userHasPermissions(profile: IProfile | null | undefined, permissions: TPermission[]): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
permissions | TPermission[] |
permission.userHasPermissions
Confirm whether the user has all of the specified permissions, resolving the profile's direct permissions, the permissions granted by its roles, and any group profiles.
user_has_permissions(profile: Profile | None, permissions: list[Permission]) -> bool| Parameter | Type | Description |
|---|---|---|
profile | Profile | None | The profile to check, or None when there is no session. |
permissions | list[Permission] | The permissions that must all be held. |
permission.userHasPermissions
Confirm whether the user has all of the specified permissions, resolving the profile's direct permissions, the permissions granted by its roles, and any group profiles.
bool UserHasPermissions(Profile? profile, IEnumerable<string> permissions)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session (always fails a non-empty check). |
permissions | IEnumerable<string> | The permissions that must all be present. |
primitive.formatFullName
Format a profile's full name
formatFullName(source?: object | null): string| Parameter | Type | Description |
|---|---|---|
source? | object | null |
primitive.formatInitials
Format a profile's initials
formatInitials(profile?: IProfile): string| Parameter | Type | Description |
|---|---|---|
profile? | IProfile |
primitive.fullNameToInitials
Generate suggested initials for a full name, e.g. "John Doe" will yield "JD".
fullNameToInitials(name: string): string| Parameter | Type | Description |
|---|---|---|
name | string |
primitive.integerSequence
Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful in rendering operations when there is no source array to .map() across.
integerSequence(start: number, count: number): number[]| Parameter | Type | Description |
|---|---|---|
start | number | |
count | number |
primitive.formatFullName
Format a profile's full name
format_full_name(source: Any = None) -> str| Parameter | Type | Description |
|---|---|---|
source? | Any | Anything carrying first_name and last_name, as keys or attributes (a dict, a Profile, a Recipient). None and missing names are treated as empty. |
primitive.formatInitials
Format a profile's initials
format_initials(profile: Any = None) -> str| Parameter | Type | Description |
|---|---|---|
profile? | Any | Anything carrying first_name and last_name, as keys or attributes. The js-sdk assumes both names are present; we treat a missing one as empty rather than raising. |
primitive.fullNameToInitials
Generate suggested initials for a full name, e.g. "John Doe" will yield "JD".
full_name_to_initials(name: str) -> str| Parameter | Type | Description |
|---|---|---|
name | str | The full name. |
primitive.integerSequence
Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful in rendering operations when there is no source array to .map() across.
integer_sequence(start: int, count: int) -> list[int]| Parameter | Type | Description |
|---|---|---|
start | int | The first value. |
count | int | How many values to produce. |
primitive.formatFullName
Format a profile's full name
string FormatFullName(string? firstName, string? lastName)| Parameter | Type | Description |
|---|---|---|
firstName | string? | The first name; null is treated as empty. |
lastName | string? | The last name; null is treated as empty. |
primitive.formatInitials
Format a profile's initials
string FormatInitials(Profile? profile)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to read. The js-sdk assumes both names are present; a missing one is treated as empty here rather than throwing. |
primitive.fullNameToInitials
Generate suggested initials for a full name, e.g. "John Doe" will yield "JD".
string FullNameToInitials(string name)| Parameter | Type | Description |
|---|---|---|
name | string | The full name. |
primitive.integerSequence
Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful in rendering operations when there is no source array to .map() across.
IReadOnlyList<int> IntegerSequence(int start, int count)| Parameter | Type | Description |
|---|---|---|
start | int | The first value. |
count | int | How many values to produce. |
string.capitalize
Capitalize the first letter of a string.
capitalize(str: string): string| Parameter | Type | Description |
|---|---|---|
str | string |
string.convertToE164
Convert a phone-number-like string to E164 format.
convertToE164(input: string): string| Parameter | Type | Description |
|---|---|---|
input | string |
string.randomString
randomString(length: number): string| Parameter | Type | Description |
|---|---|---|
length | number |
string.capitalize
Capitalize the first letter of a string.
capitalize(value: str) -> str| Parameter | Type | Description |
|---|---|---|
value | str | The string to capitalize. May be empty. |
string.convertToE164
Convert a phone-number-like string to E164 format.
convert_to_e164(value: str | None) -> str| Parameter | Type | Description |
|---|---|---|
value | str | None | The phone-number-like input; None is treated as empty. |
string.randomString
random_string(length: int) -> str| Parameter | Type | Description |
|---|---|---|
length | int | Number of characters to generate. |
string.capitalize
Capitalize the first letter of a string.
string Capitalize(string value)| Parameter | Type | Description |
|---|---|---|
value | string | The string to capitalize. May be empty. |
string.convertToE164
Convert a phone-number-like string to E164 format.
string ConvertToE164(string? input)| Parameter | Type | Description |
|---|---|---|
input | string? | The phone-number-like input; null is treated as empty. |
string.randomString
string RandomString(int length)| Parameter | Type | Description |
|---|---|---|
length | int | Number of characters to generate. |
template.canPerformTemplateAction
canPerformTemplateAction(profile: IProfile | null | undefined, action: TTemplateAction, template?: ITemplate): object| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
action | TTemplateAction | |
template? | ITemplate |
template.getFieldsForRole
getFieldsForRole(template: ITemplate, role_name: string): ITemplateField[]| Parameter | Type | Description |
|---|---|---|
template | ITemplate | |
role_name | string |
template.hasRequiredPermissions
hasRequiredPermissions(profile: IProfile | null | undefined, permissions: TPermission[]): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
permissions | TPermission[] |
template.userCanBuildTemplate
Check to see if the user can "build" the template (use the field builder). The user must have write access to the template, and the template must have at least one signer role.
userCanBuildTemplate(profile: IProfile | null | undefined, template: ITemplate): boolean | null | undefined| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userCanChangeOrgVisibility
Check to see if the user can change whether a template is personal vs org-shared.
userCanChangeOrgVisibility(profile: IProfile | null | undefined, template: ITemplate): boolean | null | undefined| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userCanCreateOrgTemplate
Check to see if the user can create an org-shared template.
userCanCreateOrgTemplate(profile: IProfile | null | undefined): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined |
template.userCanCreatePersonalTemplate
Check to see if the user can create a personal/private template.
userCanCreatePersonalTemplate(profile: IProfile | null | undefined): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined |
template.userCanCreatePublicTemplate
Check to see if the user can create a public template.
userCanCreatePublicTemplate(profile: IProfile | null | undefined): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined |
template.userCanCreateTemplate
Confirm whether the user can create a new template.
userCanCreateTemplate(profile: IProfile | null | undefined): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined |
template.userCanDeleteTemplate
Check to see if the user can change whether a template is personal vs org-shared.
userCanDeleteTemplate(profile: IProfile | null | undefined, template: ITemplate): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userCanMakeTemplatePrivate
Check to see if the user can change whether a template is personal vs org-shared.
userCanMakeTemplatePrivate(profile: IProfile | null | undefined, template: ITemplate): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userCanMakeTemplatePublic
Check to see if the user can change whether a template is personal vs org-shared.
userCanMakeTemplatePublic(profile: IProfile | null | undefined, template: ITemplate): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userCanMakeTemplateShared
Check to see if the user can change whether a template is personal vs org-shared.
userCanMakeTemplateShared(profile: IProfile | null | undefined, template: ITemplate): boolean| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userCanPreviewTemplate
Check to see if the user can preview the template. The user must have read access to the template, the template must have at least one signer, and every signer must have at least one field.
userCanPreviewTemplate(profile: IProfile | null | undefined, template: ITemplate): boolean | null | undefined| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userCanReadTemplate
Check to see if the user can read/view a template.
userCanReadTemplate(profile: IProfile | null | undefined, template: ITemplate): boolean | null | undefined| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userCanSendTemplate
Confirm whether the user can create an envelope using the specified template.
userCanSendTemplate(profile: IProfile | null | undefined, template: ITemplate): boolean | null | undefined| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userCanUpdateTemplate
Check to see if the user can update a tempate.
userCanUpdateTemplate(profile: IProfile | null | undefined, template: ITemplate): boolean | null | undefined| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userHasSharedTemplate
Check to see if a template is "shared" with the user.
userHasSharedTemplate(profile: IProfile | null | undefined, template: ITemplate): boolean | null | undefined| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.userIsTemplateCreator
Check to see if the user created the template.
userIsTemplateCreator(profile: IProfile | null | undefined, template: ITemplate): boolean | null | undefined| Parameter | Type | Description |
|---|---|---|
profile | IProfile | null | undefined | |
template | ITemplate |
template.canPerformTemplateAction
Not yet available for Python.
template.getFieldsForRole
Not yet available for Python.
template.hasRequiredPermissions
Not yet available for Python.
template.userCanBuildTemplate
Check to see if the user can "build" the template (use the field builder). The user must have write access to the template, and the template must have at least one signer role.
Not yet available for Python.
template.userCanChangeOrgVisibility
Check to see if the user can change whether a template is personal vs org-shared.
Not yet available for Python.
template.userCanCreateOrgTemplate
Check to see if the user can create an org-shared template.
Not yet available for Python.
template.userCanCreatePersonalTemplate
Check to see if the user can create a personal/private template.
Not yet available for Python.
template.userCanCreatePublicTemplate
Check to see if the user can create a public template.
Not yet available for Python.
template.userCanCreateTemplate
Confirm whether the user can create a new template.
Not yet available for Python.
template.userCanDeleteTemplate
Check to see if the user can change whether a template is personal vs org-shared.
Not yet available for Python.
template.userCanMakeTemplatePrivate
Check to see if the user can change whether a template is personal vs org-shared.
Not yet available for Python.
template.userCanMakeTemplatePublic
Check to see if the user can change whether a template is personal vs org-shared.
Not yet available for Python.
template.userCanMakeTemplateShared
Check to see if the user can change whether a template is personal vs org-shared.
Not yet available for Python.
template.userCanPreviewTemplate
Check to see if the user can preview the template. The user must have read access to the template, the template must have at least one signer, and every signer must have at least one field.
Not yet available for Python.
template.userCanReadTemplate
Check to see if the user can read/view a template.
Not yet available for Python.
template.userCanSendTemplate
Confirm whether the user can create an envelope using the specified template.
Not yet available for Python.
template.userCanUpdateTemplate
Check to see if the user can update a tempate.
Not yet available for Python.
template.userHasSharedTemplate
Check to see if a template is "shared" with the user.
Not yet available for Python.
template.userIsTemplateCreator
Check to see if the user created the template.
Not yet available for Python.
template.canPerformTemplateAction
ValueTuple<bool, string> CanPerformTemplateAction(Profile? profile, string action, Template? template = null)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
action | string | The action to test; see TemplateAction for known values. |
template? | Template? | The template to act on, required for everything except the create actions. |
template.getFieldsForRole
IReadOnlyList<TemplateField> GetFieldsForRole(Template template, string roleName)| Parameter | Type | Description |
|---|---|---|
template | Template | The template to scan. |
roleName | string | The role name to filter by. |
template.hasRequiredPermissions
bool HasRequiredPermissions(Profile? profile, IEnumerable<string> permissions)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
permissions | IEnumerable<string> | The permissions that must all be present. |
template.userCanBuildTemplate
Check to see if the user can "build" the template (use the field builder). The user must have write access to the template, and the template must have at least one signer role.
bool UserCanBuildTemplate(Profile? profile, Template template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template | The template to check against. |
template.userCanChangeOrgVisibility
Check to see if the user can change whether a template is personal vs org-shared.
bool UserCanChangeOrgVisibility(Profile? profile, Template template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template | The template to check against. |
template.userCanCreateOrgTemplate
Check to see if the user can create an org-shared template.
bool UserCanCreateOrgTemplate(Profile? profile)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template.userCanCreatePersonalTemplate
Check to see if the user can create a personal/private template.
bool UserCanCreatePersonalTemplate(Profile? profile)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template.userCanCreatePublicTemplate
Check to see if the user can create a public template.
bool UserCanCreatePublicTemplate(Profile? profile)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template.userCanCreateTemplate
Confirm whether the user can create a new template.
bool UserCanCreateTemplate(Profile? profile)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template.userCanDeleteTemplate
Check to see if the user can change whether a template is personal vs org-shared.
bool UserCanDeleteTemplate(Profile? profile, Template template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template | The template to check against. |
template.userCanMakeTemplatePrivate
Check to see if the user can change whether a template is personal vs org-shared.
bool UserCanMakeTemplatePrivate(Profile? profile, Template template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template | The template to check against. |
template.userCanMakeTemplatePublic
Check to see if the user can change whether a template is personal vs org-shared.
bool UserCanMakeTemplatePublic(Profile? profile, Template template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template | The template to check against. |
template.userCanMakeTemplateShared
Check to see if the user can change whether a template is personal vs org-shared.
bool UserCanMakeTemplateShared(Profile? profile, Template template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template | The template to check against. |
template.userCanPreviewTemplate
Check to see if the user can preview the template. The user must have read access to the template, the template must have at least one signer, and every signer must have at least one field.
bool UserCanPreviewTemplate(Profile? profile, Template template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template | The template to check against. |
template.userCanReadTemplate
Check to see if the user can read/view a template.
bool UserCanReadTemplate(Profile? profile, Template template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template | The template to check against. |
template.userCanSendTemplate
Confirm whether the user can create an envelope using the specified template.
bool UserCanSendTemplate(Profile? profile, Template template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template | The template to check against. |
template.userCanUpdateTemplate
Check to see if the user can update a tempate.
bool UserCanUpdateTemplate(Profile? profile, Template template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template | The template to check against. |
template.userHasSharedTemplate
Check to see if a template is "shared" with the user.
bool UserHasSharedTemplate(Profile? profile, Template? template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template? | The template to check against, or null. |
template.userIsTemplateCreator
Check to see if the user created the template.
bool UserIsTemplateCreator(Profile? profile, Template? template)| Parameter | Type | Description |
|---|---|---|
profile | Profile? | The profile to check, or null for no session. |
template | Template? | The template to check against, or null. |
token.AtoB
Simplified, Node/Browser-safe alternative to atob() for base64 decoding. Modified from https://github.com/MaxArt2501/base64-js/blob/master/base64.js
AtoB(str: string): string| Parameter | Type | Description |
|---|---|---|
str | string |
token.decodeAccessTokenBody
Decode the body of an Verdocs access token. Note that raw tokens contain namespaced fields, e.g. `https://verdocs.com/profile_id`. To make these tokens easier to use in front-end code, this name-spacing will be removed. Note that user and signing sessions have different access token formats. The calling application should distinguish between the two based on the context of the authenticated session, or by the presence of the `document_id` field, which will only be present for signing sessions.
decodeAccessTokenBody(token: string): TSession| Parameter | Type | Description |
|---|---|---|
token | string | {String} |
token.decodeJWTBody
Decode the body of a JWT. This helper may allow front-end applications to avoid a dependency on `jsonwebtoken` in many cases. Note that this should only be used for true JWTs. Opaque tokens will cause this to throw.
decodeJWTBody(token: string): any| Parameter | Type | Description |
|---|---|---|
token | string |
token.AtoB
Simplified, Node/Browser-safe alternative to atob() for base64 decoding. Modified from https://github.com/MaxArt2501/base64-js/blob/master/base64.js
Not yet available for Python.
token.decodeAccessTokenBody
Decode the body of an Verdocs access token. Note that raw tokens contain namespaced fields, e.g. `https://verdocs.com/profile_id`. To make these tokens easier to use in front-end code, this name-spacing will be removed. Note that user and signing sessions have different access token formats. The calling application should distinguish between the two based on the context of the authenticated session, or by the presence of the `document_id` field, which will only be present for signing sessions.
decode_access_token_body(token: str | None) -> dict[str, Any] | None| Parameter | Type | Description |
|---|---|---|
token | str | None | The access token; None is treated as empty. |
token.decodeJWTBody
Decode the body of a JWT. This helper may allow front-end applications to avoid a dependency on `jsonwebtoken` in many cases. Note that this should only be used for true JWTs. Opaque tokens will cause this to throw.
decode_jwt_body(token: str | None) -> Any| Parameter | Type | Description |
|---|---|---|
token | str | None | The JWT; None is treated as empty. |
token.AtoB
Simplified, Node/Browser-safe alternative to atob() for base64 decoding. Modified from https://github.com/MaxArt2501/base64-js/blob/master/base64.js
Not yet available for C#.
token.decodeAccessTokenBody
Decode the body of an Verdocs access token. Note that raw tokens contain namespaced fields, e.g. `https://verdocs.com/profile_id`. To make these tokens easier to use in front-end code, this name-spacing will be removed. Note that user and signing sessions have different access token formats. The calling application should distinguish between the two based on the context of the authenticated session, or by the presence of the `document_id` field, which will only be present for signing sessions.
VerdocsSession? DecodeAccessTokenBody(string? token)| Parameter | Type | Description |
|---|---|---|
token | string? | The access token; null is treated as empty. |
token.decodeJWTBody
Decode the body of a JWT. This helper may allow front-end applications to avoid a dependency on `jsonwebtoken` in many cases. Note that this should only be used for true JWTs. Opaque tokens will cause this to throw.
JsonElement DecodeJwtBody(string? token)| Parameter | Type | Description |
|---|---|---|
token | string? | The JWT; null is treated as empty. |
validator.getValidators
Get a list of available validators for field inputs. Note that validators always check strings, because that is all a user can enter in an HTML input field. Numeric-format validators should perform any necessary conversions internally. Validators never throw - they just return a boolean. indicating whether the value is valid.
getValidators(): string[]validator.isValidEmail
Check whether a string is a validly-formatted email address.
isValidEmail(email: string | undefined): boolean| Parameter | Type | Description |
|---|---|---|
email | string | undefined |
validator.isValidInput
isValidInput(value: string, validator: string): boolean| Parameter | Type | Description |
|---|---|---|
value | string | |
validator | string |
validator.isValidPhone
Check whether a string looks like a valid phone number, in domestic or international format.
isValidPhone(phone: string | undefined): boolean| Parameter | Type | Description |
|---|---|---|
phone | string | undefined |
validator.isValidRoleName
isValidRoleName(value: string, roles: IRole[]): boolean| Parameter | Type | Description |
|---|---|---|
value | string | |
roles | IRole[] |
validator.isValidTag
isValidTag(value: string, tags: string[]): boolean| Parameter | Type | Description |
|---|---|---|
value | string | |
tags | string[] |
validator.getValidators
Get a list of available validators for field inputs. Note that validators always check strings, because that is all a user can enter in an HTML input field. Numeric-format validators should perform any necessary conversions internally. Validators never throw - they just return a boolean. indicating whether the value is valid.
get_validators() -> list[str]validator.isValidEmail
Check whether a string is a validly-formatted email address.
is_valid_email(email: str | None) -> bool| Parameter | Type | Description |
|---|---|---|
email | str | None | The value to check; None and the empty string fail. |
validator.isValidInput
is_valid_input(value: str, validator: str) -> bool| Parameter | Type | Description |
|---|---|---|
value | str | The value to check. |
validator | str | The validator name; see get_validators for the options. |
validator.isValidPhone
Check whether a string looks like a valid phone number, in domestic or international format.
is_valid_phone(phone: str | None) -> bool| Parameter | Type | Description |
|---|---|---|
phone | str | None | The value to check; None and the empty string fail. |
validator.isValidRoleName
is_valid_role_name(value: str, roles: list[Role]) -> bool| Parameter | Type | Description |
|---|---|---|
value | str | The role name to look for. |
roles | list[Role] | The template's roles. |
validator.isValidTag
is_valid_tag(value: str, tags: list[str]) -> bool| Parameter | Type | Description |
|---|---|---|
value | str | The tag to check. |
tags | list[str] | Already-known tags, which pass regardless of format. |
validator.getValidators
Get a list of available validators for field inputs. Note that validators always check strings, because that is all a user can enter in an HTML input field. Numeric-format validators should perform any necessary conversions internally. Validators never throw - they just return a boolean. indicating whether the value is valid.
IReadOnlyList<string> GetValidators()validator.isValidEmail
Check whether a string is a validly-formatted email address.
bool IsValidEmail(string? email)| Parameter | Type | Description |
|---|---|---|
email | string? | The value to check, or null. |
validator.isValidInput
bool IsValidInput(string value, string validator)| Parameter | Type | Description |
|---|---|---|
value | string | The value to check. |
validator | string | The validator name; see GetValidators for the known names. |
validator.isValidPhone
Check whether a string looks like a valid phone number, in domestic or international format.
bool IsValidPhone(string? phone)| Parameter | Type | Description |
|---|---|---|
phone | string? | The value to check, or null. |
validator.isValidRoleName
bool IsValidRoleName(string value, IEnumerable<Role> roles)| Parameter | Type | Description |
|---|---|---|
value | string | The role name to look for. |
roles | IEnumerable<Role> | The template's roles. |
validator.isValidTag
bool IsValidTag(string value, IEnumerable<string> tags)| Parameter | Type | Description |
|---|---|---|
value | string | The tag to check. |
tags | IEnumerable<string> | The existing tags. |