Verdocs - Developer Documentation
ReferenceSDKLanguages

Helpers

Utility and convenience functions provided by the Verdocs SDKs.

Colors

color.getRGB

Converts an "rgba(r,g,b,a)" string to its hex equivalent, dropping alpha. The alpha channel is composited against white first, so the hex color is what the translucent tint actually looks like on a page.

Not yet available for Node.js.

color.getRGBA

Returns the color code for a signer given its role index. Indexes cycle through ten colors; index 0 gets its own shade so the first signer stands out from every tenth one after it.

Not yet available for Node.js.

color.nameToRGBA

Derives a stable color code from a role name. The color is not specified explicitly: a hash of the name picks it, so the same name always yields the same color. Matches the js-sdk hash (including its 32-bit shift wraparound) so every SDK tints a given role identically.

Not yet available for Node.js.

color.getRoleColor

Picks a color code for a role name from whichever inputs are available. An explicit index wins, then the name's position in the roles list, and a name absent from the list falls back to the name hash.

Not yet available for Node.js.

color.getRGB

Converts an "rgba(r,g,b,a)" string to its hex equivalent, dropping alpha. The alpha channel is composited against white first, so the hex color is what the translucent tint actually looks like on a page.

Not yet available for Python.

color.getRGBA

Returns the color code for a signer given its role index. Indexes cycle through ten colors; index 0 gets its own shade so the first signer stands out from every tenth one after it.

Not yet available for Python.

color.nameToRGBA

Derives a stable color code from a role name. The color is not specified explicitly: a hash of the name picks it, so the same name always yields the same color. Matches the js-sdk hash (including its 32-bit shift wraparound) so every SDK tints a given role identically.

Not yet available for Python.

color.getRoleColor

Picks a color code for a role name from whichever inputs are available. An explicit index wins, then the name's position in the roles list, and a name absent from the list falls back to the name hash.

Not yet available for Python.

color.getRGB

Converts an "rgba(r,g,b,a)" string to its hex equivalent, dropping alpha. The alpha channel is composited against white first, so the hex color is what the translucent tint actually looks like on a page.

string GetRgb(string rgba)
ParameterTypeDescription
rgbastringA CSS rgba() string, e.g. "rgba(255, 193, 7, 0.4)".

color.getRGBA

Returns the color code for a signer given its role index. Indexes cycle through ten colors; index 0 gets its own shade so the first signer stands out from every tenth one after it.

string GetRgba(int roleIndex)
ParameterTypeDescription
roleIndexintZero-based index of the role in the template's role list.

color.nameToRGBA

Derives a stable color code from a role name. The color is not specified explicitly: a hash of the name picks it, so the same name always yields the same color. Matches the js-sdk hash (including its 32-bit shift wraparound) so every SDK tints a given role identically.

string? NameToRgba(string? name)
ParameterTypeDescription
namestring?The role name. Names ending in a digit get extra hash input so "Signer 1" and "Signer 2" land on visibly different colors.

color.getRoleColor

Picks a color code for a role name from whichever inputs are available. An explicit index wins, then the name's position in the roles list, and a name absent from the list falls back to the name hash.

string? GetRoleColor(string? name, IReadOnlyList<string>? roles, int? index = null)
ParameterTypeDescription
namestring?The role name to color.
rolesIReadOnlyList<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.
DateTime

dateTime.formatShortTimeAgo

formatShortTimeAgo(val: any): string
ParameterTypeDescription
valany

dateTime.formatShortTimeAgo

format_short_time_ago(val: datetime | str | int | float | None) -> str
ParameterTypeDescription
valdatetime | str | int | float | NoneThe moment to describe. None, unsupported types, and unparseable strings yield "".

dateTime.formatShortTimeAgo

string FormatShortTimeAgo(DateTimeOffset? value)
ParameterTypeDescription
valueDateTimeOffset?The moment to describe; null yields "".
Entitlement

entitlement.collapseEntitlements

collapseEntitlements(entitlements: IEntitlement[]): Partial<Record<TEntitlement, IEntitlement>>
ParameterTypeDescription
entitlementsIEntitlement[]

entitlement.collapseEntitlements

collapse_entitlements(entitlements: list[Entitlement]) -> ActiveEntitlements
ParameterTypeDescription
entitlementslist[Entitlement]The raw records, e.g. from organizations.get_entitlements().

entitlement.collapseEntitlements

IReadOnlyDictionary<string, Entitlement> CollapseEntitlements(IEnumerable<Entitlement> entitlements)
ParameterTypeDescription
entitlementsIEnumerable<Entitlement>The raw records, e.g. from GetEntitlementsAsync.
Envelope

envelope.canAccessEnvelope

Check to see if the profile ID is the envelope's sender or one of the recipients.

canAccessEnvelope(profile_id: undefined | null | string, envelope: IEnvelope): boolean
ParameterTypeDescription
profile_idundefined | null | string
envelopeIEnvelope

envelope.envelopeIsActive

Check to see if the envelope has pending actions.

envelopeIsActive(envelope: IEnvelope): boolean
ParameterTypeDescription
envelopeIEnvelope

envelope.envelopeIsComplete

Check to see if the envelope has been completed.

envelopeIsComplete(envelope: IEnvelope): boolean
ParameterTypeDescription
envelopeIEnvelope

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): undefined | IRecipient
ParameterTypeDescription
sessionTSession
envelopeIEnvelope

envelope.getNextRecipient

getNextRecipient(envelope: IEnvelope): IRecipient
ParameterTypeDescription
envelopeIEnvelope

envelope.getRecipient

Get a recipient from an envelope via an email match.

getRecipient(email: string, envelope: IEnvelope): undefined | IRecipient
ParameterTypeDescription
emailstring
envelopeIEnvelope

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[]
ParameterTypeDescription
envelopeIEnvelope

envelope.getRecipientWithActions

Get a recipient that can act from an envelope via an email match.

getRecipientWithActions(email: string, envelope: IEnvelope): undefined | boolean
ParameterTypeDescription
emailstring
envelopeIEnvelope

envelope.isEnvelopeOwner

Check to see if the profile ID owns the envelope.

isEnvelopeOwner(profile_id: undefined | null | string, envelope: IEnvelope): boolean
ParameterTypeDescription
profile_idundefined | null | string
envelopeIEnvelope

envelope.isEnvelopeRecipient

Check to see if the profile ID is a recipient within the envelope.

isEnvelopeRecipient(profile_id: undefined | null | string, envelope: IEnvelope): boolean
ParameterTypeDescription
profile_idundefined | null | string
envelopeIEnvelope

envelope.isFieldFilled

isFieldFilled(field: IEnvelopeField, allRecipientFields: IEnvelopeField[]): null | boolean | ''
ParameterTypeDescription
fieldIEnvelopeField
allRecipientFieldsIEnvelopeField[]

envelope.isFieldValid

isFieldValid(field: IEnvelopeField, allRecipientFields: IEnvelopeField[]): null | boolean | ''
ParameterTypeDescription
fieldIEnvelopeField
allRecipientFieldsIEnvelopeField[]

envelope.recipientCanAct

Returns true if the recipient can act.

recipientCanAct(recipient: IRecipient, recipientsWithActions: IRecipient[]): boolean
ParameterTypeDescription
recipientIRecipient
recipientsWithActionsIRecipient[]

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
ParameterTypeDescription
recipientIRecipient

envelope.useCanAccessEnvelope

Check to see if the profile ID is the envelope's sender or one of the recipients.

useCanAccessEnvelope(profile: undefined | null | IProfile, envelope: IEnvelope): boolean
ParameterTypeDescription
profileundefined | null | IProfile
envelopeIEnvelope

envelope.userCanAct

Returns true if the user can act.

userCanAct(email: string, recipientsWithActions: IRecipient[]): undefined | boolean
ParameterTypeDescription
emailstring
recipientsWithActionsIRecipient[]

envelope.userCanCancelEnvelope

Check to see if the user owns the envelope.

userCanCancelEnvelope(profile: undefined | null | IProfile, envelope: IEnvelope): boolean
ParameterTypeDescription
profileundefined | null | IProfile
envelopeIEnvelope

envelope.userCanFinishEnvelope

Check to see if the user owns the envelope.

userCanFinishEnvelope(profile: undefined | null | IProfile, envelope: IEnvelope): boolean
ParameterTypeDescription
profileundefined | null | IProfile
envelopeIEnvelope

envelope.userCanSignNow

Returns true if the user can act.

userCanSignNow(profile: undefined | null | IProfile, envelope: IEnvelope): undefined | boolean
ParameterTypeDescription
profileundefined | null | IProfile
envelopeIEnvelope

envelope.userIsEnvelopeOwner

Check to see if the user owns the envelope.

userIsEnvelopeOwner(profile: undefined | null | IProfile, envelope: IEnvelope): boolean
ParameterTypeDescription
profileundefined | null | IProfile
envelopeIEnvelope

envelope.userIsEnvelopeRecipient

Check to see if the user is a recipient within the envelope.

userIsEnvelopeRecipient(profile: undefined | null | IProfile, envelope: IEnvelope): boolean
ParameterTypeDescription
profileundefined | null | IProfile
envelopeIEnvelope

envelope.sortFields

Sorts fields in reading order: by page, then by Y coordinate in 5-unit bands (Y origin is the bottom-left corner, so bands sort descending), then by X coordinate. Sorts the list in place and returns it, like the js-sdk's sortFields. Local logic; no API call.

Not yet available for Node.js.

envelope.sortDocuments

Sorts documents by their order, falling back to creation date. Sorts the list in place and returns it, like the js-sdk's sortDocuments. Local logic; no API call.

Not yet available for Node.js.

envelope.sortRecipients

Sorts recipients by sequence, then by order within the sequence. Sorts the list in place and returns it, like the js-sdk's sortRecipients; a null list passes through. Local logic; no API call.

Not yet available for Node.js.

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.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.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.sortFields

Sorts fields in reading order: by page, then by Y coordinate in 5-unit bands (Y origin is the bottom-left corner, so bands sort descending), then by X coordinate. Sorts the list in place and returns it, like the js-sdk's sortFields. Local logic; no API call.

Not yet available for Python.

envelope.sortDocuments

Sorts documents by their order, falling back to creation date. Sorts the list in place and returns it, like the js-sdk's sortDocuments. Local logic; no API call.

Not yet available for Python.

envelope.sortRecipients

Sorts recipients by sequence, then by order within the sequence. Sorts the list in place and returns it, like the js-sdk's sortRecipients; a null list passes through. Local logic; no API call.

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)
ParameterTypeDescription
profileIdstring?The profile ID to check, or null for no session.
envelopeEnvelopeThe envelope to check against.

envelope.envelopeIsActive

Check to see if the envelope has pending actions.

bool EnvelopeIsActive(Envelope envelope)
ParameterTypeDescription
envelopeEnvelopeThe envelope to check.

envelope.envelopeIsComplete

Check to see if the envelope has been completed.

bool EnvelopeIsComplete(Envelope envelope)
ParameterTypeDescription
envelopeEnvelopeThe 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)
ParameterTypeDescription
sessionVerdocsSession?The current session, or null for no session.
envelopeEnvelopeThe envelope to scan.

envelope.getNextRecipient

Recipient? GetNextRecipient(Envelope envelope)
ParameterTypeDescription
envelopeEnvelopeThe envelope to scan.

envelope.getRecipient

Get a recipient from an envelope via an email match.

Recipient? GetRecipient(string email, Envelope envelope)
ParameterTypeDescription
emailstringThe email address to look for.
envelopeEnvelopeThe 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)
ParameterTypeDescription
envelopeEnvelopeThe envelope to scan.

envelope.getRecipientWithActions

Get a recipient that can act from an envelope via an email match.

bool GetRecipientWithActions(string email, Envelope envelope)
ParameterTypeDescription
emailstringThe email address to look for.
envelopeEnvelopeThe envelope to scan.

envelope.isEnvelopeOwner

Check to see if the profile ID owns the envelope.

bool IsEnvelopeOwner(string? profileId, Envelope envelope)
ParameterTypeDescription
profileIdstring?The profile ID to check, or null for no session.
envelopeEnvelopeThe 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)
ParameterTypeDescription
profileIdstring?The profile ID to check, or null for no session.
envelopeEnvelopeThe envelope to check against.

envelope.isFieldFilled

bool IsFieldFilled(EnvelopeField field, IReadOnlyList<EnvelopeField> allRecipientFields)
ParameterTypeDescription
fieldEnvelopeFieldThe field to check.
allRecipientFieldsIReadOnlyList<EnvelopeField>Every field assigned to the same recipient, used to resolve grouped fields.

envelope.isFieldValid

bool IsFieldValid(EnvelopeField field, IReadOnlyList<EnvelopeField> allRecipientFields)
ParameterTypeDescription
fieldEnvelopeFieldThe field to check.
allRecipientFieldsIReadOnlyList<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)
ParameterTypeDescription
recipientRecipientThe recipient to check.
recipientsWithActionsIReadOnlyList<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)
ParameterTypeDescription
recipientRecipientThe recipient to check.

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)
ParameterTypeDescription
emailstringThe email address to look for.
recipientsWithActionsIReadOnlyList<Recipient>The pending recipients, from GetRecipientsWithActions.

envelope.userCanCancelEnvelope

Check to see if the user owns the envelope.

bool UserCanCancelEnvelope(Profile? profile, Envelope envelope)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
envelopeEnvelopeThe envelope to check against.

envelope.userCanFinishEnvelope

Check to see if the user owns the envelope.

bool UserCanFinishEnvelope(Profile? profile, Envelope envelope)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
envelopeEnvelopeThe envelope to check against.

envelope.userCanSignNow

Returns true if the user can act.

bool UserCanSignNow(Profile? profile, Envelope envelope)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
envelopeEnvelopeThe envelope to check against.

envelope.userIsEnvelopeOwner

Check to see if the user owns the envelope.

bool UserIsEnvelopeOwner(Profile? profile, Envelope envelope)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
envelopeEnvelopeThe envelope to check against.

envelope.userIsEnvelopeRecipient

Check to see if the user is a recipient within the envelope.

bool UserIsEnvelopeRecipient(Profile? profile, Envelope envelope)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
envelopeEnvelopeThe envelope to check against.

envelope.sortFields

Sorts fields in reading order: by page, then by Y coordinate in 5-unit bands (Y origin is the bottom-left corner, so bands sort descending), then by X coordinate. Sorts the list in place and returns it, like the js-sdk's sortFields. Local logic; no API call.

List<EnvelopeField> SortFields(List<EnvelopeField> fields)
ParameterTypeDescription
fieldsList<EnvelopeField>The fields to sort. Modified in place.

envelope.sortDocuments

Sorts documents by their order, falling back to creation date. Sorts the list in place and returns it, like the js-sdk's sortDocuments. Local logic; no API call.

List<EnvelopeDocument> SortDocuments(List<EnvelopeDocument> documents)
ParameterTypeDescription
documentsList<EnvelopeDocument>The documents to sort. Modified in place.

envelope.sortRecipients

Sorts recipients by sequence, then by order within the sequence. Sorts the list in place and returns it, like the js-sdk's sortRecipients; a null list passes through. Local logic; no API call.

List<Recipient>? SortRecipients(List<Recipient>? recipients)
ParameterTypeDescription
recipientsList<Recipient>?The recipients to sort. Modified in place.
FieldUtils

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)
ParameterTypeDescription
ydoubleThe field's PDF y position (bottom edge).
fieldHeightdoubleThe field's height in document units.
iTextHeightdoubleThe rendered page height in pixels.
yRatiodoublePixels 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)
ParameterTypeDescription
xdoubleThe field's PDF x position.
ratiodoublePixels per document unit on the x axis.

fieldUtil.getRValue

Returns a document-space value scaled to rendered pixels.

double GetRValue(double y, double ratio)
ParameterTypeDescription
ydoubleThe value in document units.
ratiodoublePixels per document unit.

fieldUtil.rescale

Returns a value scaled by a ratio.

double Rescale(double r, double n)
ParameterTypeDescription
rdoubleThe value to scale.
ndoubleThe 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)
ParameterTypeDescription
databyte[]The bytes to encode.
File

file.downloadBlob

Trigger a download dialog to save a blob as a file on disk.

downloadBlob(blob: Blob, name: string = 'file.pdf'): void
ParameterTypeDescription
blobBlob
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>
ParameterTypeDescription
fileFile

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
ParameterTypeDescription
databytesThe file content.
content_typestrThe 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)
ParameterTypeDescription
databyte[]The file content.
contentTypestringThe MIME type to embed, e.g. "application/pdf".
Locales

locale.getCountryByCode

Finds the country for a display code, e.g. "+44". Falls back to prefix matching for the French overseas territories whose codes are stored with extra digits. Codes shared by several countries return the first table entry ("+1" returns American Samoa, never the United States); use GetPlusOneCountry to tell NANP territories apart.

Not yet available for Node.js.

locale.isFrenchGuiana

Whether the code starts with French Guiana's +594 prefix.

Not yet available for Node.js.

locale.isGuadeloupe

Whether the code starts with Guadeloupe's +590 prefix.

Not yet available for Node.js.

locale.isMartinique

Whether the code starts with Martinique's +596 prefix.

Not yet available for Node.js.

locale.isMayotte

Whether the code starts with the Mayotte/Reunion +262 prefix.

Not yet available for Node.js.

locale.getPlusOneCountry

Resolves a "+1" NANP code to its territory by area-code prefix. The first five characters decide the match, so the literal "+1" (nothing after it) yields a country with an empty name, as in the js-sdk switch.

Not yet available for Node.js.

locale.isCanada

Whether a "+1" code carries a Canadian area code.

Not yet available for Node.js.

locale.isAmericanSamoa

Whether the code starts with American Samoa's +1684 prefix.

Not yet available for Node.js.

locale.isDominicanRepublic

Whether the code starts with a Dominican Republic prefix (+1809/+1829/+1849).

Not yet available for Node.js.

locale.isPuertoRico

Whether the code is Puerto Rico's. Ported js-sdk bug: the js compares against "+" twice where the real prefixes are +1787 and +1939, so this returns true only for the literal string "+". Kept as-is per the true-up policy of porting quirks rather than fixing them.

Not yet available for Node.js.

locale.getMatchingCountry

Counts the table entries whose code equals the first characters of the input. The js-sdk marks this one "need to finish": despite the name it returns a count, not a country, and duplicate rows count twice. Ported as-is.

Not yet available for Node.js.

locale.getCountryByCode

Finds the country for a display code, e.g. "+44". Falls back to prefix matching for the French overseas territories whose codes are stored with extra digits. Codes shared by several countries return the first table entry ("+1" returns American Samoa, never the United States); use GetPlusOneCountry to tell NANP territories apart.

Not yet available for Python.

locale.isFrenchGuiana

Whether the code starts with French Guiana's +594 prefix.

Not yet available for Python.

locale.isGuadeloupe

Whether the code starts with Guadeloupe's +590 prefix.

Not yet available for Python.

locale.isMartinique

Whether the code starts with Martinique's +596 prefix.

Not yet available for Python.

locale.isMayotte

Whether the code starts with the Mayotte/Reunion +262 prefix.

Not yet available for Python.

locale.getPlusOneCountry

Resolves a "+1" NANP code to its territory by area-code prefix. The first five characters decide the match, so the literal "+1" (nothing after it) yields a country with an empty name, as in the js-sdk switch.

Not yet available for Python.

locale.isCanada

Whether a "+1" code carries a Canadian area code.

Not yet available for Python.

locale.isAmericanSamoa

Whether the code starts with American Samoa's +1684 prefix.

Not yet available for Python.

locale.isDominicanRepublic

Whether the code starts with a Dominican Republic prefix (+1809/+1829/+1849).

Not yet available for Python.

locale.isPuertoRico

Whether the code is Puerto Rico's. Ported js-sdk bug: the js compares against "+" twice where the real prefixes are +1787 and +1939, so this returns true only for the literal string "+". Kept as-is per the true-up policy of porting quirks rather than fixing them.

Not yet available for Python.

locale.getMatchingCountry

Counts the table entries whose code equals the first characters of the input. The js-sdk marks this one "need to finish": despite the name it returns a count, not a country, and duplicate rows count twice. Ported as-is.

Not yet available for Python.

locale.getCountryByCode

Finds the country for a display code, e.g. "+44". Falls back to prefix matching for the French overseas territories whose codes are stored with extra digits. Codes shared by several countries return the first table entry ("+1" returns American Samoa, never the United States); use GetPlusOneCountry to tell NANP territories apart.

Country? GetCountryByCode(string code)
ParameterTypeDescription
codestringThe display code to look up.

locale.isFrenchGuiana

Whether the code starts with French Guiana's +594 prefix.

bool IsFrenchGuiana(string code)
ParameterTypeDescription
codestringThe phone code to check.

locale.isGuadeloupe

Whether the code starts with Guadeloupe's +590 prefix.

bool IsGuadeloupe(string code)
ParameterTypeDescription
codestringThe phone code to check.

locale.isMartinique

Whether the code starts with Martinique's +596 prefix.

bool IsMartinique(string code)
ParameterTypeDescription
codestringThe phone code to check.

locale.isMayotte

Whether the code starts with the Mayotte/Reunion +262 prefix.

bool IsMayotte(string code)
ParameterTypeDescription
codestringThe phone code to check.

locale.getPlusOneCountry

Resolves a "+1" NANP code to its territory by area-code prefix. The first five characters decide the match, so the literal "+1" (nothing after it) yields a country with an empty name, as in the js-sdk switch.

Country? GetPlusOneCountry(string code)
ParameterTypeDescription
codestringThe phone code to resolve.

locale.isCanada

Whether a "+1" code carries a Canadian area code.

bool IsCanada(string code)
ParameterTypeDescription
codestringThe phone code to check.

locale.isAmericanSamoa

Whether the code starts with American Samoa's +1684 prefix.

bool IsAmericanSamoa(string code)
ParameterTypeDescription
codestringThe phone code to check.

locale.isDominicanRepublic

Whether the code starts with a Dominican Republic prefix (+1809/+1829/+1849).

bool IsDominicanRepublic(string code)
ParameterTypeDescription
codestringThe phone code to check.

locale.isPuertoRico

Whether the code is Puerto Rico's. Ported js-sdk bug: the js compares against "+" twice where the real prefixes are +1787 and +1939, so this returns true only for the literal string "+". Kept as-is per the true-up policy of porting quirks rather than fixing them.

bool IsPuertoRico(string code)
ParameterTypeDescription
codestringThe phone code to check.

locale.getMatchingCountry

Counts the table entries whose code equals the first characters of the input. The js-sdk marks this one "need to finish": despite the name it returns a count, not a country, and duplicate rows count twice. Ported as-is.

int GetMatchingCountry(string code, int substrings)
ParameterTypeDescription
codestringThe phone code to match.
substringsintHow many leading characters to compare (negative counts as zero, like the JS substring bound).
Permissions

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: undefined | null | IProfile, permissions: TPermission[]): boolean
ParameterTypeDescription
profileundefined | null | IProfile
permissionsTPermission[]

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
ParameterTypeDescription
profileProfile | NoneThe profile to check, or None when there is no session.
permissionslist[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)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session (always fails a non-empty check).
permissionsIEnumerable<string>The permissions that must all be present.
Primitive

primitive.formatFullName

Format a profile's full name

formatFullName(source?: null | object): string
ParameterTypeDescription
source?null | object

primitive.formatInitials

Format a profile's initials

formatInitials(profile?: IProfile): string
ParameterTypeDescription
profile?IProfile

primitive.fullNameToInitials

Generate suggested initials for a full name, e.g. "John Doe" will yield "JD".

fullNameToInitials(name: string): string
ParameterTypeDescription
namestring

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[]
ParameterTypeDescription
startnumber
countnumber

primitive.formatFullName

Format a profile's full name

format_full_name(source: Any = None) -> str
ParameterTypeDescription
source?AnyAnything 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
ParameterTypeDescription
profile?AnyAnything 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
ParameterTypeDescription
namestrThe 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]
ParameterTypeDescription
startintThe first value.
countintHow many values to produce.

primitive.formatFullName

Format a profile's full name

string FormatFullName(string? firstName, string? lastName)
ParameterTypeDescription
firstNamestring?The first name; null is treated as empty.
lastNamestring?The last name; null is treated as empty.

primitive.formatInitials

Format a profile's initials

string FormatInitials(Profile? profile)
ParameterTypeDescription
profileProfile?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)
ParameterTypeDescription
namestringThe 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)
ParameterTypeDescription
startintThe first value.
countintHow many values to produce.
String

string.capitalize

Capitalize the first letter of a string.

capitalize(str: string): string
ParameterTypeDescription
strstring

string.convertToE164

Convert a phone-number-like string to E164 format.

convertToE164(input: string): string
ParameterTypeDescription
inputstring

string.randomString

randomString(length: number): string
ParameterTypeDescription
lengthnumber

string.capitalize

Capitalize the first letter of a string.

capitalize(value: str) -> str
ParameterTypeDescription
valuestrThe string to capitalize. May be empty.

string.convertToE164

Convert a phone-number-like string to E164 format.

convert_to_e164(value: str | None) -> str
ParameterTypeDescription
valuestr | NoneThe phone-number-like input; None is treated as empty.

string.randomString

random_string(length: int) -> str
ParameterTypeDescription
lengthintNumber of characters to generate.

string.capitalize

Capitalize the first letter of a string.

string Capitalize(string value)
ParameterTypeDescription
valuestringThe string to capitalize. May be empty.

string.convertToE164

Convert a phone-number-like string to E164 format.

string ConvertToE164(string? input)
ParameterTypeDescription
inputstring?The phone-number-like input; null is treated as empty.

string.randomString

string RandomString(int length)
ParameterTypeDescription
lengthintNumber of characters to generate.
Template

template.canPerformTemplateAction

canPerformTemplateAction(profile: undefined | null | IProfile, action: TTemplateAction, template?: ITemplate): object
ParameterTypeDescription
profileundefined | null | IProfile
actionTTemplateAction
template?ITemplate

template.getFieldsForRole

getFieldsForRole(template: ITemplate, role_name: string): ITemplateField[]
ParameterTypeDescription
templateITemplate
role_namestring

template.hasRequiredPermissions

hasRequiredPermissions(profile: undefined | null | IProfile, permissions: TPermission[]): boolean
ParameterTypeDescription
profileundefined | null | IProfile
permissionsTPermission[]

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: undefined | null | IProfile, template: ITemplate): undefined | null | boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

template.userCanChangeOrgVisibility

Check to see if the user can change whether a template is personal vs org-shared.

userCanChangeOrgVisibility(profile: undefined | null | IProfile, template: ITemplate): undefined | null | boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

template.userCanCreateOrgTemplate

Check to see if the user can create an org-shared template.

userCanCreateOrgTemplate(profile: undefined | null | IProfile): boolean
ParameterTypeDescription
profileundefined | null | IProfile

template.userCanCreatePersonalTemplate

Check to see if the user can create a personal/private template.

userCanCreatePersonalTemplate(profile: undefined | null | IProfile): boolean
ParameterTypeDescription
profileundefined | null | IProfile

template.userCanCreatePublicTemplate

Check to see if the user can create a public template.

userCanCreatePublicTemplate(profile: undefined | null | IProfile): boolean
ParameterTypeDescription
profileundefined | null | IProfile

template.userCanCreateTemplate

Confirm whether the user can create a new template.

userCanCreateTemplate(profile: undefined | null | IProfile): boolean
ParameterTypeDescription
profileundefined | null | IProfile

template.userCanDeleteTemplate

Check to see if the user can change whether a template is personal vs org-shared.

userCanDeleteTemplate(profile: undefined | null | IProfile, template: ITemplate): boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

template.userCanMakeTemplatePrivate

Check to see if the user can change whether a template is personal vs org-shared.

userCanMakeTemplatePrivate(profile: undefined | null | IProfile, template: ITemplate): boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

template.userCanMakeTemplatePublic

Check to see if the user can change whether a template is personal vs org-shared.

userCanMakeTemplatePublic(profile: undefined | null | IProfile, template: ITemplate): boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

template.userCanMakeTemplateShared

Check to see if the user can change whether a template is personal vs org-shared.

userCanMakeTemplateShared(profile: undefined | null | IProfile, template: ITemplate): boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

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: undefined | null | IProfile, template: ITemplate): undefined | null | boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

template.userCanReadTemplate

Check to see if the user can read/view a template.

userCanReadTemplate(profile: undefined | null | IProfile, template: ITemplate): undefined | null | boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

template.userCanSendTemplate

Confirm whether the user can create an envelope using the specified template.

userCanSendTemplate(profile: undefined | null | IProfile, template: ITemplate): undefined | null | boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

template.userCanUpdateTemplate

Check to see if the user can update a tempate.

userCanUpdateTemplate(profile: undefined | null | IProfile, template: ITemplate): undefined | null | boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

template.userHasSharedTemplate

Check to see if a template is "shared" with the user.

userHasSharedTemplate(profile: undefined | null | IProfile, template: ITemplate): undefined | null | boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

template.userIsTemplateCreator

Check to see if the user created the template.

userIsTemplateCreator(profile: undefined | null | IProfile, template: ITemplate): undefined | null | boolean
ParameterTypeDescription
profileundefined | null | IProfile
templateITemplate

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)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
actionstringThe 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)
ParameterTypeDescription
templateTemplateThe template to scan.
roleNamestringThe role name to filter by.

template.hasRequiredPermissions

bool HasRequiredPermissions(Profile? profile, IEnumerable<string> permissions)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
permissionsIEnumerable<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)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplateThe 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)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplateThe template to check against.

template.userCanCreateOrgTemplate

Check to see if the user can create an org-shared template.

bool UserCanCreateOrgTemplate(Profile? profile)
ParameterTypeDescription
profileProfile?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)
ParameterTypeDescription
profileProfile?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)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.

template.userCanCreateTemplate

Confirm whether the user can create a new template.

bool UserCanCreateTemplate(Profile? profile)
ParameterTypeDescription
profileProfile?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)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplateThe 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)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplateThe 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)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplateThe 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)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplateThe 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)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplateThe template to check against.

template.userCanReadTemplate

Check to see if the user can read/view a template.

bool UserCanReadTemplate(Profile? profile, Template template)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplateThe template to check against.

template.userCanSendTemplate

Confirm whether the user can create an envelope using the specified template.

bool UserCanSendTemplate(Profile? profile, Template template)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplateThe template to check against.

template.userCanUpdateTemplate

Check to see if the user can update a tempate.

bool UserCanUpdateTemplate(Profile? profile, Template template)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplateThe template to check against.

template.userHasSharedTemplate

Check to see if a template is "shared" with the user.

bool UserHasSharedTemplate(Profile? profile, Template? template)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplate?The template to check against, or null.

template.userIsTemplateCreator

Check to see if the user created the template.

bool UserIsTemplateCreator(Profile? profile, Template? template)
ParameterTypeDescription
profileProfile?The profile to check, or null for no session.
templateTemplate?The template to check against, or null.
Token

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
ParameterTypeDescription
strstring

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
ParameterTypeDescription
tokenstring{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
ParameterTypeDescription
tokenstring

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
ParameterTypeDescription
tokenstr | NoneThe 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
ParameterTypeDescription
tokenstr | NoneThe 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)
ParameterTypeDescription
tokenstring?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)
ParameterTypeDescription
tokenstring?The JWT; null is treated as empty.
Validators

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: undefined | string): boolean
ParameterTypeDescription
emailundefined | string

validator.isValidInput

isValidInput(value: string, validator: string): boolean
ParameterTypeDescription
valuestring
validatorstring

validator.isValidPhone

Check whether a string looks like a valid phone number, in domestic or international format.

isValidPhone(phone: undefined | string): boolean
ParameterTypeDescription
phoneundefined | string

validator.isValidRoleName

isValidRoleName(value: string, roles: IRole[]): boolean
ParameterTypeDescription
valuestring
rolesIRole[]

validator.isValidTag

isValidTag(value: string, tags: string[]): boolean
ParameterTypeDescription
valuestring
tagsstring[]

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
ParameterTypeDescription
emailstr | NoneThe value to check; None and the empty string fail.

validator.isValidInput

is_valid_input(value: str, validator: str) -> bool
ParameterTypeDescription
valuestrThe value to check.
validatorstrThe 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
ParameterTypeDescription
phonestr | NoneThe value to check; None and the empty string fail.

validator.isValidRoleName

is_valid_role_name(value: str, roles: list[Role]) -> bool
ParameterTypeDescription
valuestrThe role name to look for.
roleslist[Role]The template's roles.

validator.isValidTag

is_valid_tag(value: str, tags: list[str]) -> bool
ParameterTypeDescription
valuestrThe tag to check.
tagslist[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)
ParameterTypeDescription
emailstring?The value to check, or null.

validator.isValidInput

bool IsValidInput(string value, string validator)
ParameterTypeDescription
valuestringThe value to check.
validatorstringThe 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)
ParameterTypeDescription
phonestring?The value to check, or null.

validator.isValidRoleName

bool IsValidRoleName(string value, IEnumerable<Role> roles)
ParameterTypeDescription
valuestringThe role name to look for.
rolesIEnumerable<Role>The template's roles.

validator.isValidTag

bool IsValidTag(string value, IEnumerable<string> tags)
ParameterTypeDescription
valuestringThe tag to check.
tagsIEnumerable<string>The existing tags.