DocuSign is the leader in online document signing. They provide a REST API which allows for embedded document signing in several server-side languages, not currently including R.
The docuSignr
package uses httr
to embed DocuSign into Shiny applications.
docuSignr
is available on CRAN and Github.
# from CRAN
install.packages("docuSignr")
# from Github
devtools::install_github("CannaData/docuSignr")
For docuSignr
to function you will need several things:
It is recommended that you set the DocuSign username, password, and integrator key as environmental variables idealy in your .Rprofile.
Sys.setenv("docuSign_username" = "username")
Sys.setenv("docuSign_password" = "password")
Sys.setenv("docuSign_integrator_key" = "integrator_key")
library(docuSignr)
# login to get baseURL and accountID
login <- docu_login()
# load templates
templates <- docu_templates(base_url = login[1, "baseUrl"])
# create envelope
envelope <- docu_envelope(
account_id = login[1, "accountId"],
base_url = login[1, "baseUrl"],
template_id = templates[1, "templateId"],
template_roles = list(
email = "example@example.com",
name = "R-Test",
roleName = "Patient",
clientUserId = "1"
),
email_subject = "R-Test",
email_blurb = "R-Test"
)
# get URL
URL <- docu_embed(
base_url = login[1, "baseUrl"],
return_url = "https://www.google.com",
envelope_id = envelope$envelopeId,
# info here must be consistent with info in template_roles above
signer_name = "R-Test",
signer_email = "example@example.com",
client_user_id = "1"
)
# sign document
browseURL(URL)
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Also see contributing.