{"id":25553817,"url":"https://github.com/docusign/code-examples-ruby","last_synced_at":"2025-10-13T13:07:34.101Z","repository":{"id":38431573,"uuid":"163942339","full_name":"docusign/code-examples-ruby","owner":"docusign","description":"Docusign Ruby on Rails code examples and launcher","archived":false,"fork":false,"pushed_at":"2025-09-26T16:09:39.000Z","size":2148,"stargazers_count":28,"open_issues_count":1,"forks_count":21,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-10-13T13:06:10.536Z","etag":null,"topics":["click-api","docusign","docusign-api","esignature","jwt","monitor-api","rooms-api","ruby","webforms-api"],"latest_commit_sha":null,"homepage":"https://developers.docusign.com/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docusign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-01-03T08:09:11.000Z","updated_at":"2025-09-26T16:09:44.000Z","dependencies_parsed_at":"2024-02-23T00:25:07.785Z","dependency_job_id":"20853ac5-2101-4382-9b11-c5d0f777523f","html_url":"https://github.com/docusign/code-examples-ruby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/docusign/code-examples-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docusign%2Fcode-examples-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docusign%2Fcode-examples-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docusign%2Fcode-examples-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docusign%2Fcode-examples-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docusign","download_url":"https://codeload.github.com/docusign/code-examples-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docusign%2Fcode-examples-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015278,"owners_count":26085683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["click-api","docusign","docusign-api","esignature","jwt","monitor-api","rooms-api","ruby","webforms-api"],"created_at":"2025-02-20T12:01:50.066Z","updated_at":"2025-10-13T13:07:34.095Z","avatar_url":"https://github.com/docusign.png","language":"Ruby","readme":"# Ruby Launcher Code Examples\n\n\u003e\n\u003e### PLEASE! Share your feedback in a [two-question survey](https://docs.google.com/forms/d/e/1FAIpQLScPa74hwhJwi7XWDDj4-XZVOQTF9jJWgbIFEpulXokCqYWT4A/viewform?usp=pp_url\u0026entry.680551577=Ruby).\n\u003e\n\u003e\n### GitHub repo: [code-examples-ruby](./README.md)\n\nIf you downloaded this project using the [Quickstart](https://developers.docusign.com/docs/esign-rest-api/quickstart/) tool, it may be configured in one of three ways:\n\n* **[JWT Grant remote signing example](#jwt-grant-remote-signing-example)**–demonstrates how to implement JSON Web Token authentication. It includes a single remote signing workflow.\n* **[Authorization Code Grant embedded signing example](#authorization-code-grant-embedded-signing-example)**–demonstrates how to implement Authorization Code Grant authentication. It includes a single embedded signing workflow.\n* **[Multiple code examples, Authorization Code Grant and JWT Grant](#installation-steps)**–includes the full range of examples and authentication types.\n\n***Installation and running instructions vary depending on the configuration. Follow the link that matches your project type to get started.***\n\nThis GitHub repo includes code examples for the [Web Forms API](https://developers.docusign.com/docs/web-forms-api/), [Docusign Admin API](https://developers.docusign.com/docs/admin-api/), [Click API](https://developers.docusign.com/docs/click-api/), [eSignature REST API](https://developers.docusign.com/docs/esign-rest-api/), [Monitor API](https://developers.docusign.com/docs/monitor-api/), and [Rooms API](https://developers.docusign.com/docs/rooms-api/). \n\n\n## Introduction\nThis repo is a Ruby on Rails application that supports the following authentication workflows:\n\n* Authentication with Docusign via [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode).\nWhen the token expires, the user is asked to re-authenticate. The refresh token is not used.\n\n* Authentication with Docusign via [JSON Web Token (JWT) Grant](https://developers.docusign.com/platform/auth/jwt/).\nWhen the token expires, it updates automatically.\n\n## eSignature API\n\nFor more information about the scopes used for obtaining authorization to use the eSignature API, see [Required scopes](https://developers.docusign.com/docs/esign-rest-api/esign101/auth#required-scopes).\n\nFor a list of code examples that use the eSignature API, see the [How-to guides overview](https://developers.docusign.com/docs/esign-rest-api/how-to/) on the Docusign Developer Center.\n\n\n## Rooms API\n\n**Note:** To use the Rooms API, you must also [create your Rooms developer account](https://developers.docusign.com/docs/rooms-api/rooms101/create-account). Examples 4 and 6 require that you have the Docusign Forms feature enabled in your Rooms for Real Estate account.\nFor more information about the scopes used for obtaining authorization to use the Rooms API, see [Required scopes](https://developers.docusign.com/docs/rooms-api/rooms101/auth/).\n\nFor a list of code examples that use the Rooms API, see the [How-to guides overview](https://developers.docusign.com/docs/rooms-api/how-to/) on the Docusign Developer Center.\n\n\n## Click API\nFor more information about the scopes used for obtaining authorization to use the Click API, see [Required scopes](https://developers.docusign.com/docs/click-api/click101/auth/#required-scopes)\n\nFor a list of code examples that use the Click API, see the [How-to guides overview](https://developers.docusign.com/docs/click-api/how-to/) on the Docusign Developer Center.\n\n\n## Monitor API\n\n**Note:** To use the Monitor API, you must also [enable Docusign Monitor for your organization](https://developers.docusign.com/docs/monitor-api/how-to/enable-monitor/).\n\nFor information about the scopes used for obtaining authorization to use the Monitor API, see the [scopes section](https://developers.docusign.com/docs/monitor-api/monitor101/auth/).\n\nFor a list of code examples that use the Monitor API, see the [How-to guides overview](https://developers.docusign.com/docs/monitor-api/how-to/) on the Docusign Developer Center.\n\n\n## Admin API\n\n**Note:** To use the Admin API, you must [create an organization](https://support.docusign.com/en/guides/org-admin-guide-create-org) in your Docusign developer account. Also, to run the Docusign CLM code example, [CLM must be enabled for your organization](https://support.docusign.com/en/articles/DocuSign-and-SpringCM).\n\nFor information about the scopes used for obtaining authorization to use the Admin API, see the [scopes section](https://developers.docusign.com/docs/admin-api/admin101/auth/).\n\nFor a list of code examples that use the Admin API, see the [How-to guides overview](https://developers.docusign.com/docs/admin-api/how-to/) on the Docusign Developer Center.\n\n## Installation\n\n### Prerequisites\n**Note:** If you downloaded this code using [Quickstart](https://developers.docusign.com/docs/esign-rest-api/quickstart/) from the Docusign Developer Center, skip items 1 and 2 as they were automatically performed for you.\n\n1. A free [Docusign developer account](https://www.docusign.com/developers/sandbox); create one if you don't already have one.\n1. A Docusign app and integration key that is configured for authentication to use either [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/) or [JWT Grant](https://developers.docusign.com/platform/auth/jwt/).\n\n   This [video](https://www.youtube.com/watch?v=eiRI4fe5HgM) demonstrates how to obtain an integration key.\n\n   To use [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/), you will need an integration key and a secret key. See [Installation steps](#installation-steps) for details.\n\n   To use [JWT Grant](https://developers.docusign.com/platform/auth/jwt/), you will need an integration key, an RSA key pair, and the User ID GUID of the impersonated user. See [Installation steps for JWT Grant authentication](#installation-steps-for-jwt-grant-authentication) for details.\n\n   For both authentication flows:\n\n   If you use this launcher on your own workstation, the integration key must include a redirect URI of\n\n   http://localhost:3000/auth/docusign/callback\n\n   If you host this launcher on a remote web server, set your redirect URI as\n\n   {base_url}/auth/docusign/callback\n\n   where {base_url} is the URL for the web app.\n\n1. [Ruby version 2.7.2](https://www.ruby-lang.org/en/downloads/) or later\n   1. Update the Gemfile to use later versions of Ruby.\n   1. Windows x64 only:\n      1. Ensure that your Ruby folder is appended with **-x64**, e.g. **Ruby27-x64**\n      2. Install Curl for Ruby: [Download libcurl.dll](https://curl.haxx.se/windows/)\n         Save **libcurl-x64.dll** as **libcurl.dll**\n         Place **libcurl.dll** in your Ruby folder, e.g. **C:\u0026#92;Ruby27-x64\u0026#92;bin**\n\n\n### Installation steps\n**Note:** If you downloaded this code using [Quickstart](https://developers.docusign.com/docs/esign-rest-api/quickstart/) from the Docusign Developer Center, skip step 4 as it was automatically performed for you.\n\n1. Extract the Quickstart ZIP file, or download or clone the code-examples-ruby repository.\n1. In your command-line environment, switch to the folder:\n   `cd \u003cQuickstart folder\u003e` or `cd code-examples-ruby`\n1. To install dependencies, run: `bundler install`\n1. To configure the launcher for [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/) authentication, create a copy of the file config/appsettings.example.yml and save the copy as config/appsettings.yml.\n   1. Add your integration key. On the [Apps and Keys](https://admindemo.docusign.com/authenticate?goTo=apiIntegratorKey) page, under **Apps and Integration Keys**, choose the app to use, then select **Actions** \u003e **Edit**. Under **General Info**, copy the **Integration Key** GUID and save it in appsettings.yml as your `integration_key`.\n   1. Generate a secret key, if you don’t already have one. Under **Authentication**, select **+ ADD SECRET KEY**. Copy the secret key and save it in appsettings.yml as your `integration_secret`.\n   1. Add the launcher’s redirect URI. Under **Additional settings**, select **+ ADD URI**, and set a redirect URI of http://localhost:3000/auth/docusign/callback. Select **SAVE**.\n   1. Set a name and email address for the signer. In appsettings.yml, save an email address as `signer_email` and a name as `signer_name`.\n**Note:** Protect your personal information. Please make sure that appsettings.yml will not be stored in your source code repository.\n1. Run the launcher: `rails s`\n1. Open a browser to http://localhost:3000\n\n\n### Installation steps for JWT Grant authentication\n**Note:** If you downloaded this code using [Quickstart](https://developers.docusign.com/docs/esign-rest-api/quickstart/) from the Docusign Developer Center, skip step 4 as it was automatically performed for you.\nAlso, in order to select JSON Web Token authentication in the launcher, in config/appsettings.yml, change `quickstart` to `false`.\n\n1. Extract the Quickstart ZIP file or download or clone the code-examples-ruby repository.\n1. In your command-line environment, switch to the folder:\n   `cd \u003cQuickstart folder\u003e` or `cd code-examples-ruby`\n1. Install the dependencies: `bundler install`\n1. To configure the launcher for [JWT Grant](https://developers.docusign.com/platform/auth/jwt/) authentication, create a copy of the file config/appsettings.example.yml and save the copy as config/appsettings.yml.\n   1. Add your User ID. On the [Apps and Keys](https://admindemo.docusign.com/authenticate?goTo=apiIntegratorKey) page, under **My Account Information**, copy the **User ID** GUID and save it in appsettings.yml as your `impersonated_user_guid`.\n   1. Add your integration key. On the [Apps and Keys](https://admindemo.docusign.com/authenticate?goTo=apiIntegratorKey) page, under **Apps and Integration Keys**, choose the app to use, then select **Actions** \u003e **Edit**. Under **General Info**, copy the **Integration Key** GUID and save it in appsettings.yml as your `jwt_integration_key`.\n   1. Generate an RSA key pair, if you don’t already have one. Under **Authentication**, select **+ GENERATE RSA**. Copy the private key and save it in a new file named config/docusign_private_key.txt.\n   1. Add the launcher’s redirect URI. Under **Additional settings**, select **+ ADD URI**, and set a redirect URI of http://localhost:3000/auth/docusign/callback. Select **SAVE**.\n   1. Set a name and email address for the signer. In appsettings.yml, save an email address as `signer_email` and a name as `signer_name`.\n**Note:** Protect your personal information. Please make sure that appsettings.yml will not be stored in your source code repository.\n1. Run the launcher: `rails s`\n1. Open a browser to http://localhost:3000\n1. If it is your first time using the app, grant consent by selecting **Accept**. On the black navigation bar, select **Logout**, then **Login**.\n1. From the picklist, select **JSON Web Token (JWT) grant** \u003e **Authenticate with Docusign**.\n1. Select your desired code example.\n\n## JWT grant remote signing and Authorization Code Grant embedded signing projects\nSee [Docusign Quickstart overview](https://developers.docusign.com/docs/esign-rest-api/quickstart/overview/) on the Docusign Developer Center for more information on how to run the JWT grant remote signing project and the Authorization Code Grant embedded signing project.\n\n### Authorization Code Grant embedded signing example:\nRun in Git Bash:\n```\n$ cd \u003cQuickstart folder\u003e/quick_acg\n$ bundler install\n$ rails s\n```\n\nOpen a browser to http://localhost:3000\n\n### JWT grant remote signing example:\nRun in Windows Command Prompt (CMD):\n```\n$ cd jwt_console_project\n$ ruby jwt_console.rb\n```\n\n### Troubleshooting Windows SSL issue\nWhen using the Ruby launcher on a Windows machine you may get the following error:\n\n**SSL peer certificate or SSH remote key was not OK**\n\nThis error occurs because you’re attempting to use the Ruby launcher with a self-signed certificate or without SSL/HTTP security. The API calls from Ruby SDKs are using a built-in Curl tool that is enforcing the SSL requirement. You can disable this security check to run the launcher in an insecure manner on your developer machine.\n\n```diff\n- It is highly recommended that you don’t disable this security check\n- in a production environment or in your integration.\n- This method is offered here solely as a means to enable you to\n- develop quickly by lowering the security bar on your local machine.\n```\nFind the root folder for your Ruby gems (in this case, a 64-bit version of Ruby 2.7.0):\n\nC:\\Ruby27-x64\\lib\\ruby\\gems\\2.7.0\\gems\\\n\nFind the relevant Docusign Ruby SDK you are using. The name always starts with “docusign”; for instance, Docusign Click SDK version 1.0.0:\n\nC:\\Ruby27-x64\\lib\\ruby\\gems\\2.7.0\\gems\\docusign_click-1.0.0\\lib\\docusign_click\n\nFind the **configuration.rb** file in that folder.\nModify the following two lines in the **configuration.rb** file, replacing `true` with `false`:\n\n      @verify_ssl = true\n      @verify_ssl_host = true\n\n\nOnce this is complete, you can run your Ruby on Rails application again and you should be able to make API calls on your localhost.\n\n### Troubleshooting macOS SSL issue\nWhen using the Ruby launcher on OSX you may get the following error:\n\n```\nFaraday::SSLError (SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate in certificate chain))\n```\nPlease update SSL certificates if rvm is your version manager. Or check [other steps for different scenarios](https://gemfury.com/help/could-not-verify-ssl-certificate/#updating-ssl-certificates).\n```\n$ rvm osx-ssl-certs status all\n$ rvm osx-ssl-certs update all\n```\n\n## Payments code example\nTo use the payments code example, create a test payment gateway on the [**Payments**](https://admindemo.docusign.com/authenticate?goTo=payments) page in your developer account. See [Configure a payment gateway](./PAYMENTS_INSTALLATION.md) for details.\n\nOnce you've created a payment gateway, save the **Gateway Account ID** GUID to appsettings.yml.\n\n## License and additional information\n\n### License\nThis repository uses the MIT License. See [LICENSE](./LICENSE) for details.\n\n\n### Pull Requests\nPull requests are welcomed. Pull requests will only be considered if their content\nuses the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocusign%2Fcode-examples-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocusign%2Fcode-examples-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocusign%2Fcode-examples-ruby/lists"}