Programatically create and send ROGER contracts
Authorization
HTTP header using the
Bearer
scheme. Below is an example of a header specifying your API key:
workspaceId
in the endpoint path.
You can find the ID of your workspace in the URL of your ROGER Dashboard.
In the below example, your workspaceId
would be wvEOhUlU8rHy5EXAwNn1
:
templateId
in the request body.
You can find the ID of your workspace in the URL of the template’s edit screen.
In the below example, your templateId
would be E23eipzNxLKe28bYP1FI
:
@
prefix). The
createdBy
parameter should be set to an email address of a user from a team
within your workspace.
workspaceId
, contractId
, and a
signingLink
, which can be used to sign the contract.
email
paramter in the request.
The email
parameter (default false
) will send the signing link to the
contract’s signers if it is either true
or an object specifying additional
options.
Here are a couple of examples:
subject
, or message
are not specified, the defaults will be used. If
logoUrl
is not specified, the default for your workspace as configured in your
workspace’s settings will be used. If your workspace has a default logo
configured, but you wish to omit the logo in this email, use null
for
logoUrl
.
reply-to
header set to the createdBy
user. To
maximize deliverability to the recipient’s inbox, ROGER uses minimal,
email-compatible HTML that has been tested with email deliverability tools like
Litmus and Unspam. Here are a few other tips to help make sure your emails land
in recipient inboxes:
to
header.templateValues
property of the
request body. It is a JSON record mapping from names of template variables to
a typed value object. A typed value object is is a JSON record with a type
property. Other properties of the typed value object depend on the type.
Type | Description | Value type |
---|---|---|
singletext | Text (single line) | singletext |
multitext | Paragraph (multiple lines) | multitext |
richtext | Rich text (HTML) | richtext |
chooseonetext | Choose one option | singletext |
Type | Description | Example |
---|---|---|
singletext | Text with no newlines | { "type": "singletext", "value": "foo" } |
multitext | Text with newlines | { "type": "multitext", "value": "foo\nbar" } |
richtext | HTML-formatted text | { "type": "richtext", "value": "<ul><li>foo</li></ul>" } |
opportunityId
to a contract you’re
programatically creating in response to an opportunity being created in your
HubSpot. Later, when the contract.signed
event is fired and any configured
webhooks are notified, it is convenient to have the associated opportunityId
present in the webhook event body so you can update your CRM object accordingly.
To do this, create another template variable called @Opportunity ID
— it’s
okay if you don’t use the value of this variable to populate any information in
the contract. You can create any number of arbitrary variables in your template
that you can populate via the templateValues
parameters of the POST request
body. They will be provided in the submission.values
property of the
contract.signed
event when the contract is signed.