Roger ## Sections • [Roger API documentation](https://app.theneo.io/thanksroger/roger/roger-api-documentation.md): Roger provides APIs for developers to connect data and functionality with your CRM or integration tools like Zapier. • [Drafting a contract](https://app.theneo.io/thanksroger/roger/drafting-a-contract.md): Developers can create links to the Send contract (Page) with customizations. Customizations Term sheet: Pre-populate definitions of the term sheet. Form: Pre-populate answers to questions for the contract's intended recipient. Exhibits : Provide files to be included in the exhibits section. Signature block: Pre-populate the name and email address of the intended recipient. Custom arguments: Provide arbitrary data such as lead identifiers from your CRM, making it easier to trigger automations when contracts are signed. Term sheet To provide a definition to pre-populate in the Term sheet , provide the field identifier (FieldId) and definition in the following format as a query parameter in the URL: Select... https://sign.thanksroger.com/request/ TemplateId ?id- FieldId1 = definition2 &id- FieldId2 = definition2 The FieldId can be found on the by switching to the Editing template (Page) . See Finding a template FieldId . Exhibits To specify a file to as an exhibit in the Exhibits section, provide the field identifier (FieldId) and a publicly accessible URL to a PDF file: Select... https://sign.thanksroger.com/request/ TemplateId ?id- FieldId1 = url1 &id- FieldId2 = url2 The FieldId can be found on the by switching to the Editing template (Page) . See Finding a template FieldId . Form To provide an answer to pre-populate in the Form , provide the field identifier (FieldId) and answer in the following format as a query parameter in the URL: Select... https://sign.thanksroger.com/request/ TemplateId ?id- FieldId1 = answer1 &id- FieldId2 = answer2 The FieldId can be found on the by switching to the Editing template (Page) . See Finding a template FieldId . The answer should be specified according to the type of the field: Plain text: The answer will be used as is. Choose one option: The answer must match the option exactly. Address: An address is made of 6 parts: Address line 1 , Address line 2 , City , State / Province , Postal code , and Country . Each of these 6 parts must be specified as a single string, using the underscore ( _ ) character as the delimiter. For example, to specify the following address (notice that Address line 2 is empty): Select... 123 Main St. San Francisco, CA 94110 United States 123 Main St.__San Francisco_CA_94110_United States Signature block To provide the name and/or email address to pre-populate in the Signature block , use the following URL format: Select... https://sign.thanksroger.com/request/ TemplateId ?name= fullName &email= emailAddress Custom arguments String identifiers may be associated with a contract in the form of key-value pairs. Any key-value pairs (called Custom arguments ) associated with a contract will be retained and delivered with any configured Webhook events for the contract. Use this feature if you need to store the identifier of a lead from your CRM in the contract; when you receive the Acceptance (Contract signed) event, you'll be able to update the corresponding lead in your CRM. Select... https://sign.thanksroger.com/request/ TemplateId ?custom- key1 = value1 &custom- key2 = value2 • [Finding a TemplateId](https://app.theneo.io/thanksroger/roger/drafting-a-contract/finding-a-templateid.md): Each Roger Contract is created from a Template . Each Template is uniquely identified with a TemplateId . You can find the TemplateId in the URL of its Send contract (Page) or Edit template (Page) . Example URLs where TemplateId is wvEOhUlU8rHy5EXAwNn1 : https://sign.thanksroger.com/request/wvEOhUlU8rHy5EXAwNn1 https://sign.thanksroger.com/templates/wvEOhUlU8rHy5EXAwNn1 • [Finding a FieldId](https://app.theneo.io/thanksroger/roger/drafting-a-contract/finding-a-fieldid.md): Fields of a template that can be customized on the Send contract (Page) are each addressed with a unique identifier called a FieldId . In order to provide a value to be prefilled into the definition of a term in the Term sheet or an answer to a question in the Form , you'll need to find it's FieldId . You can find a Term or Question's FieldId on the Edit template (Page) . Click the … icon for a field to reveal FieldID (Developer ID). • [Generating an API Key](https://app.theneo.io/thanksroger/roger/generating-an-api-key.md): Developers can generate API keys from the developer console. When creating the API key, the teams assigned to the API key will determine which templates are available. In order to validate an API key send a GET request to the /apiKey endpoint. You will need to provide the API Key in the authorization • [Creating and sending contracts](https://app.theneo.io/thanksroger/roger/creating-and-sending-contracts.md): The Roger API allows developers the ability to create integrations that programmatically create contracts and optionally send them via email. Every Roger contract is based on a template. To create a contract, one can provide the values required by a template to the body of a request to the API. There are two options available to generate the contract, one that simply generates the contract in the Roger system and provides a URL for signing the agreement. The second option does all the aforementioned and will additionally attempt to send an email to the recipient, requesting them to sign the contract. Contracts created via the API can be viewed in the Roger UI like any other contract. You'll can filter to see the contracts created by a particular API key in the “Created by” menu in the top-right corner of the list of contracts. • [Sending a contract via email](https://app.theneo.io/thanksroger/roger/creating-and-sending-contracts/sending-a-contract-via-email.md): The TemplateId can be found via the instructions at Finding a TemplateId . The contract will be based off the template, and represents preparing the contract as a sender. To specify a value of a term's definition or prefill an answer on behalf of the recipient, use its FieldId as the key. • [Creating a contract without sending](https://app.theneo.io/thanksroger/roger/creating-and-sending-contracts/creating-a-contract-without-sending.md): The TemplateId can be found via the instructions at Finding a TemplateId . The contract will be based off the template, and represents preparing the contract as a sender. To specify a value of a term's definition or prefill an answer on behalf of the recipient, use its FieldId as the key. • [Webhooks](https://app.theneo.io/thanksroger/roger/webhooks.md): Use webhooks to get real-time updates. Webhooks allow developers to receive an HTTP request when an agreement is signed. • [Configuration](https://app.theneo.io/thanksroger/roger/webhooks/configuration.md): Webhooks consist of the teams they are assigned to and the URL to be called whenever an agreement shared with any of the teams is signed. In order to configure a webhook, a user who is an admin of a team can go to the Developer console via the top right menu or by navigating to https://sign.thanksroger.com/dev . Once on the Developer console page, you can click the Create a webhook button to bring up the webhook configuration form. In order to create a webhook we require the where and when. Where being the URL endpoint you want to be notified at when an agreement is signed and the when being the set of teams for whose agreements you want the notifications triggered. • [Handling webhook requests](https://app.theneo.io/thanksroger/roger/webhooks/handling-webhook-requests.md): When an Agreement is signed we send a POST request to any webhook endpoints you registered with data representing the Acceptance . The post request has a JSON payload with the information the signer filled out for you agreement, alongside some of the Acceptance's metadata. This payload consists of any array of all the acceptances for an agreement if there are multiple acceptances. Webhook endpoints should be idempotent to correctly handle the “at least once” semantics of incoming requests. Example Payload Select... [ { "event": "agreement.accepted", "acceptance": { "acceptanceId": "oJLRVux39X9oEShCzNkw", "agreementId": "6tdn3RYQAwsm6TNBxan5", "fieldValues": { "answers": [ { "text": "Monthly Subscription", "type": "text" }, { "text": "Discount Code zzyyxx", "type": "text" } ], "signature": { "email": "theceo@bigcorp.com", "name": "Taylor" }, "version": "cw" }, "customArgs: { "key1": "value1", "key2": "value2" }, "ip": "192.168.0.1", "recipientTimezone": "America/New_York", "timestamp": { "_seconds": 1698274141, "_nanoseconds": 891000000 }, "userId": "6tdn3RYQAwsm6TNBxan5wnbD7YCh2" } } ] Receiving Custom Data If you have a requirement to receive back data to associate with an agreement when your webhook endpoint receives a request notifying the agreement has been signed, then you can use the Custom Args part of the payload. In order to see how to provide the data initially refer to the documentation at https://app.theneo.io/thanksroger/roger/drafting-a-contract/ . The data provided will be returned back to you as the original key value pairings provided in the form of strings. Select... { [string]: “string” } Validating Webhook Requests Since your webhook endpoint must be open to the internet in order for us to reach you, you may want to validate that any requests received come from the Roger API and not a malicious third party. A webhook request comes with several header, that when used with a secret and the body of the webhook request can be used to validate the authenticity of the request. The secret is found in the Developer console. Notice it at the bottom of the below screenshot. The headers pertinent to request validation are “x-roger-timestamp” and “x-roger-signature” Select... http://your-webhook-endpoint/request-validator { headers: { x-roger-timestamp: "Server time the request was sent (milliseconds since epoch).", x-roger-signature: "HMAC (SHA-256 as hex) of the above timestamp and request body" } body: { … } } In order to authenticate the request, a developer should check the requests signature is valid. In order to hash the signature, compute the HMAC of the secret with the concatenation of the timestamp and the request body. This signature should match the “x-roger-signature” header. Furthermore, clients may also choose to verify that the timestamp is within an acceptable range. • [Support](https://app.theneo.io/thanksroger/roger/support.md): If you have any questions, feedback, or need help with Roger APIs, please contact us at support@thanksroger.com .