├── .github └── workflows │ └── maven.yml ├── .gitignore ├── .metadata ├── .lock ├── .mylyn │ └── .taskListIndex │ │ ├── segments_1 │ │ └── write.lock ├── .plugins │ ├── org.eclipse.core.resources │ │ ├── .root │ │ │ ├── .indexes │ │ │ │ ├── history.version │ │ │ │ ├── properties.index │ │ │ │ └── properties.version │ │ │ └── 1.tree │ │ └── .safetable │ │ │ └── org.eclipse.core.resources │ ├── org.eclipse.core.runtime │ │ └── .settings │ │ │ ├── org.eclipse.core.resources.prefs │ │ │ ├── org.eclipse.epp.logging.aeri.ide.prefs │ │ │ ├── org.eclipse.jdt.ui.prefs │ │ │ ├── org.eclipse.m2e.discovery.prefs │ │ │ ├── org.eclipse.mylyn.context.core.prefs │ │ │ ├── org.eclipse.mylyn.monitor.ui.prefs │ │ │ ├── org.eclipse.mylyn.tasks.ui.prefs │ │ │ ├── org.eclipse.team.ui.prefs │ │ │ ├── org.eclipse.ui.editors.prefs │ │ │ ├── org.eclipse.ui.ide.prefs │ │ │ └── org.eclipse.ui.workbench.prefs │ ├── org.eclipse.e4.workbench │ │ └── workbench.xmi │ ├── org.eclipse.epp.logging.aeri.ide │ │ └── org.eclipse.epp.logging.aeri.ide.server │ │ │ ├── http-cache.lucene60 │ │ │ ├── segments_1 │ │ │ └── write.lock │ │ │ ├── local-history.lucene60 │ │ │ ├── _0.cfe │ │ │ ├── _0.cfs │ │ │ ├── _0.si │ │ │ ├── segments_1 │ │ │ └── write.lock │ │ │ └── server-config.json │ ├── org.eclipse.jdt.core │ │ ├── assumedExternalFilesCache │ │ ├── externalFilesCache │ │ ├── index.db │ │ ├── nonChainingJarsCache │ │ └── variablesAndContainers.dat │ ├── org.eclipse.jdt.ui │ │ ├── OpenTypeHistory.xml │ │ ├── QualifiedTypeNameHistory.xml │ │ └── dialog_settings.xml │ ├── org.eclipse.m2e.logback.configuration │ │ └── logback.1.8.2.20171007-0217.xml │ ├── org.eclipse.oomph.setup │ │ └── workspace.setup │ ├── org.eclipse.ui.intro │ │ └── introstate │ └── org.eclipse.ui.workbench │ │ ├── dialog_settings.xml │ │ └── workingsets.xml └── version.ini ├── .vscode ├── launch.json └── settings.json ├── JWT Console App ├── app.config.example ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── docusign │ └── JWTConsoleApp.java ├── LICENSE ├── PAYMENTS_INSTALLATION.md ├── Quick_ACG ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── docusign │ │ ├── App.java │ │ ├── DSConfiguration.java │ │ ├── OSDetector.java │ │ ├── WebSecurityConfig.java │ │ ├── controller │ │ └── eSignature │ │ │ └── examples │ │ │ └── AbstractEsignatureController.java │ │ └── core │ │ ├── controller │ │ └── IndexController.java │ │ └── model │ │ └── Session.java │ └── resources │ └── application.example.json ├── README.md ├── azure-pipelines.yml ├── checkstyle.xml ├── code-examples-java.iml ├── docs ├── Adding_examples.md ├── IntelliJ_import_highlight.jpg ├── ds-java-auth-final.zip ├── install_fig_1.png ├── install_fig_2.png ├── install_fig_7.png ├── lombok_errors.png └── stripe_skip_account_form_link.png ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── docusign │ │ ├── App.java │ │ ├── DSConfiguration.java │ │ ├── EG001ControllerEmbeddedSigning.java │ │ ├── HttpsConnectWebhookhMacValidation.java │ │ ├── JsonPropertySourceLoader.java │ │ ├── WebSecurityConfig.java │ │ ├── common │ │ ├── ApiIndex.java │ │ └── WorkArguments.java │ │ ├── controller │ │ ├── admin │ │ │ ├── examples │ │ │ │ ├── A001AddActiveUser.java │ │ │ │ ├── A002CreateActiveCLMESignUser.java │ │ │ │ ├── A003BulkExportUserData.java │ │ │ │ ├── A003aCheckRequestStatus.java │ │ │ │ ├── A004BulkImportUserData.java │ │ │ │ ├── A004CheckImportRequestStatus.java │ │ │ │ ├── A005AuditUsers.java │ │ │ │ ├── A006RetrieveDocuSignProfileByEmailAddress.java │ │ │ │ ├── A007RetrieveDocuSignProfileByUserID.java │ │ │ │ ├── A008UpdateUserProductPermissionProfile.java │ │ │ │ ├── A009DeleteUserProductPermissionProfile.java │ │ │ │ ├── A010DeleteUserDataFromOrganization.java │ │ │ │ ├── A011DeleteUserDataFromAccount.java │ │ │ │ ├── A012CloneAccount.java │ │ │ │ ├── A013CreateAccount.java │ │ │ │ └── AbstractAdminController.java │ │ │ └── services │ │ │ │ ├── AddActiveUserService.java │ │ │ │ ├── AuditUsersService.java │ │ │ │ ├── BulkExportUserDataService.java │ │ │ │ ├── BulkImportUserDataService.java │ │ │ │ ├── CheckImportRequestStatusService.java │ │ │ │ ├── CheckRequestStatusService.java │ │ │ │ ├── CloneAccountService.java │ │ │ │ ├── CreateAccountService.java │ │ │ │ ├── CreateActiveCLMESignUserService.java │ │ │ │ ├── DeleteUserProductPermissionProfileById.java │ │ │ │ ├── RetrieveDocuSignProfileByEmailAddress.java │ │ │ │ ├── RetrieveDocuSignProfileByUserId.java │ │ │ │ ├── UpdateUserProductPermissionProfileByEmail.java │ │ │ │ └── UserDataManagementService.java │ │ ├── click │ │ │ ├── examples │ │ │ │ ├── AbstractClickController.java │ │ │ │ ├── C001ControllerCreateClickwrap.java │ │ │ │ ├── C002ControllerActivateClickwrap.java │ │ │ │ ├── C003ControllerCreateNewVersionClickwrap.java │ │ │ │ ├── C004ControllerGetListClickwraps.java │ │ │ │ ├── C005ControllerGetClickwrapResponses.java │ │ │ │ ├── C006ControllerEmbedClickwrap.java │ │ │ │ └── ClickwrapHelper.java │ │ │ └── services │ │ │ │ ├── ActivateClickwrapService.java │ │ │ │ ├── CreateClickwrapService.java │ │ │ │ ├── CreateNewVersionClickwrapService.java │ │ │ │ ├── EmbedClickwrapService.java │ │ │ │ ├── GetClickwrapResponsesService.java │ │ │ │ └── GetListClickwrapsService.java │ │ ├── connect │ │ │ ├── examples │ │ │ │ ├── AbstractConnectController.java │ │ │ │ └── EG001ControllerValidateUsingHMAC.java │ │ │ └── services │ │ │ │ └── ValidateUsingHmacService.java │ │ ├── connectedFields │ │ │ ├── examples │ │ │ │ ├── AbstractConnectedFieldsController.java │ │ │ │ └── CF001SetConnectedFields.java │ │ │ └── services │ │ │ │ └── SetConnectedFieldsService.java │ │ ├── eSignature │ │ │ ├── examples │ │ │ │ ├── AbstractEsignatureController.java │ │ │ │ ├── DsModelUtils.java │ │ │ │ ├── EG002ControllerSigningViaEmail.java │ │ │ │ ├── EG003ControllerListEnvelopes.java │ │ │ │ ├── EG004ControllerEnvelopeInfo.java │ │ │ │ ├── EG005ControllerEnvelopeRecipients.java │ │ │ │ ├── EG006ControllerEnvelopeDocs.java │ │ │ │ ├── EG007ControllerEnvelopeGetDoc.java │ │ │ │ ├── EG008ControllerCreateTemplate.java │ │ │ │ ├── EG009ControllerUseTemplate.java │ │ │ │ ├── EG010ControllerSendBinaryDocs.java │ │ │ │ ├── EG011ControllerEmbeddedSending.java │ │ │ │ ├── EG012ControllerEmbeddedConsole.java │ │ │ │ ├── EG013ControllerAddDocToTemplate.java │ │ │ │ ├── EG014ControllerCollectPayment.java │ │ │ │ ├── EG015ControllerGetTabValues.java │ │ │ │ ├── EG016ControllerSetTabValues.java │ │ │ │ ├── EG017ControllerSetTemplateTabValues.java │ │ │ │ ├── EG018ControllerEnvelopeCustomFieldValues.java │ │ │ │ ├── EG019ControllerAccessCodeAuthentication.java │ │ │ │ ├── EG020ControllerPhoneAuthentication.java │ │ │ │ ├── EG022ControllerKBAAuthentication.java │ │ │ │ ├── EG023ControllerIdvAuthentication.java │ │ │ │ ├── EG024ControllerPermissionCreate.java │ │ │ │ ├── EG025ControllerPermissionSetUserGroups.java │ │ │ │ ├── EG026ControllerPermissionChangeSingleSetting.java │ │ │ │ ├── EG027ControllerPermissionDelete.java │ │ │ │ ├── EG028ControllerCreateBrand.java │ │ │ │ ├── EG029ControllerApplyBrandToEnvelope.java │ │ │ │ ├── EG030ControllerApplyBrandToTemplate.java │ │ │ │ ├── EG031ControllerBulkSendEnvelopes.java │ │ │ │ ├── EG032ControllerPauseSignatureWorkflow.java │ │ │ │ ├── EG033ControllerUnpauseSignatureWorkflow.java │ │ │ │ ├── EG034ControllerUseConditionalRecipients.java │ │ │ │ ├── EG035ControllerScheduledSending.java │ │ │ │ ├── EG036ControllerDelayedRouting.java │ │ │ │ ├── EG037ControllerSMSDelivery.java │ │ │ │ ├── EG038ControllerResponsiveSigning.java │ │ │ │ ├── EG039ControllerInPersonSigning.java │ │ │ │ ├── EG040ControllerSetDocumentVisibility.java │ │ │ │ ├── EG041ControllerCfrEmbeddedSigning.java │ │ │ │ ├── EG042ControllerDocumentGeneration.java │ │ │ │ ├── EG043ControllerSharedAccess.java │ │ │ │ ├── EG044ControllerFocusedView.java │ │ │ │ ├── EnvelopeHelpers.java │ │ │ │ └── ExampleException.java │ │ │ └── services │ │ │ │ ├── AccessCodeAuthenticationService.java │ │ │ │ ├── AddDocToTemplateService.java │ │ │ │ ├── ApplyBrandToEnvelopeService.java │ │ │ │ ├── ApplyBrandToTemplateService.java │ │ │ │ ├── BulkSendEnvelopesService.java │ │ │ │ ├── CfrEmbeddedSigningService.java │ │ │ │ ├── CollectPaymentService.java │ │ │ │ ├── CreateBrandService.java │ │ │ │ ├── CreateTemplateService.java │ │ │ │ ├── DelayedRoutingService.java │ │ │ │ ├── DocumentGenerationService.java │ │ │ │ ├── EmbeddedConsoleService.java │ │ │ │ ├── EmbeddedSendingService.java │ │ │ │ ├── EmbeddedSigningService.java │ │ │ │ ├── EnvelopeCustomFieldValuesService.java │ │ │ │ ├── EnvelopeDocsService.java │ │ │ │ ├── EnvelopeGetDocService.java │ │ │ │ ├── EnvelopeInfoService.java │ │ │ │ ├── EnvelopeRecipientsService.java │ │ │ │ ├── FocusedViewService.java │ │ │ │ ├── GetTabValuesService.java │ │ │ │ ├── IdvAuthenticationService.java │ │ │ │ ├── InPersonSigningService.java │ │ │ │ ├── KBAAuthenticationService.java │ │ │ │ ├── ListEnvelopesServices.java │ │ │ │ ├── PauseSignatureWorkflowService.java │ │ │ │ ├── PermissionChangeSingleSettingService.java │ │ │ │ ├── PermissionCreateService.java │ │ │ │ ├── PermissionDeleteService.java │ │ │ │ ├── PermissionSetUserGroupsService.java │ │ │ │ ├── PhoneAuthenticationService.java │ │ │ │ ├── ResponsiveSigningService.java │ │ │ │ ├── SMSDeliveryService.java │ │ │ │ ├── ScheduledSendlingService.java │ │ │ │ ├── SendBinaryDocsService.java │ │ │ │ ├── SetDocumentVisibilityService.java │ │ │ │ ├── SetTabValuesService.java │ │ │ │ ├── SetTemplateTabValuesService.java │ │ │ │ ├── SharedAccessService.java │ │ │ │ ├── SigningViaEmailService.java │ │ │ │ ├── UnpauseSignatureWorkflowService.java │ │ │ │ ├── UseConditionalRecipientsService.java │ │ │ │ └── UseTemplateService.java │ │ ├── monitor │ │ │ ├── examples │ │ │ │ ├── AbstractMonitorController.java │ │ │ │ └── M001GetMonitoringData.java │ │ │ └── services │ │ │ │ └── GetMonitoringDataService.java │ │ ├── notary │ │ │ ├── examples │ │ │ │ ├── AbstractNotaryController.java │ │ │ │ └── Neg004SendWithThirdPartyNotaryController.java │ │ │ └── services │ │ │ │ └── SendWithThirdPartyNotaryService.java │ │ ├── rooms │ │ │ ├── examples │ │ │ │ ├── AbstractRoomsController.java │ │ │ │ ├── R001ControllerCreateRoom.java │ │ │ │ ├── R002ControllerCreateRoomWithTemplate.java │ │ │ │ ├── R003ControllerExportingDataFromRoom.java │ │ │ │ ├── R004ControllerAddingFormsToRoom.java │ │ │ │ ├── R005ControllerGetRoomsWithFilters.java │ │ │ │ ├── R006ControllerCreateExternalFormFillSession.java │ │ │ │ ├── R007ControllerCreateFormGroup.java │ │ │ │ ├── R008ControllerGrantOfficeAccessToFormGroup.java │ │ │ │ └── R009ControllerAssignFormToFormGroup.java │ │ │ └── services │ │ │ │ ├── AddingFormsToRoomService.java │ │ │ │ ├── AssignFormToFormGroupService.java │ │ │ │ ├── CreateFormGroupService.java │ │ │ │ ├── CreateRoomService.java │ │ │ │ ├── CreateRoomWithTemplateService.java │ │ │ │ ├── ExportingDataFromRoomService.java │ │ │ │ ├── ExternalFormSessionService.java │ │ │ │ ├── GetAdminRolesService.java │ │ │ │ ├── GetFormSummaryListService.java │ │ │ │ ├── GetRoomsWithFiltersService.java │ │ │ │ └── GrantOfficeAccessToFormGroupService.java │ │ └── webForms │ │ │ ├── examples │ │ │ ├── AbstractWebFormsController.java │ │ │ └── WEB001ControllerCreateAndEmbedForm.java │ │ │ └── services │ │ │ └── CreateAndEmbedFormService.java │ │ └── core │ │ ├── common │ │ ├── DiffField.java │ │ ├── DocumentType.java │ │ ├── Languages.java │ │ └── Utils.java │ │ ├── controller │ │ ├── AbstractController.java │ │ ├── GlobalControllerAdvice.java │ │ └── IndexController.java │ │ ├── exception │ │ └── LauncherException.java │ │ ├── model │ │ ├── AccountRoleSettingsPatch.java │ │ ├── ApiType.java │ │ ├── ApiTypeItem.java │ │ ├── AuthType.java │ │ ├── AuthTypeItem.java │ │ ├── DoneExample.java │ │ ├── EnvelopeDocumentInfo.java │ │ ├── Locals.java │ │ ├── OptionItem.java │ │ ├── Session.java │ │ ├── User.java │ │ └── manifestModels │ │ │ ├── APIs.java │ │ │ ├── AdditionalPage.java │ │ │ ├── CodeExampleText.java │ │ │ ├── CustomErrorTexts.java │ │ │ ├── Forms.java │ │ │ ├── HelpingTexts.java │ │ │ ├── Inputs.java │ │ │ ├── LinkToAPIMethods.java │ │ │ ├── LoginPage.java │ │ │ ├── ManifestGroup.java │ │ │ ├── ManifestStructure.java │ │ │ ├── RedirectsToOtherCodeExamples.java │ │ │ ├── SelectAPIPage.java │ │ │ └── SupportingTexts.java │ │ ├── security │ │ ├── CustomAuthenticationFailureHandler.java │ │ ├── JWTOAuth2User.java │ │ ├── SecurityHelpers.java │ │ ├── acg │ │ │ └── ACGAuthenticationMethod.java │ │ └── jwt │ │ │ └── JWTAuthenticationMethod.java │ │ └── utils │ │ ├── AccountsConverter.java │ │ ├── DateUtils.java │ │ └── FileUtils.java ├── resources │ ├── META-INF │ │ └── spring.factories │ ├── Offer_Letter_Dynamic_Table.docx │ ├── TermsOfService.pdf │ ├── Welcome.txt │ ├── Welcome1.txt │ ├── World_Wide_Corp_Battle_Plan_Trafalgar.docx │ ├── World_Wide_Corp_Web_Form.pdf │ ├── World_Wide_Corp_fields.pdf │ ├── World_Wide_Corp_fields_shown.docx │ ├── World_Wide_Corp_lorem.pdf │ ├── World_Wide_Corp_salary.docx │ ├── application.example.json │ ├── applicationJsonMissingError.html │ ├── doc_1.html │ ├── log4jdbc.log4j2.properties │ ├── order_form.html │ ├── public │ │ └── assets │ │ │ ├── banner-code.png │ │ │ ├── css.css │ │ │ ├── eg_03.js │ │ │ ├── ejs.min.js │ │ │ ├── favicon.png │ │ │ ├── notify.min.js │ │ │ ├── render.js │ │ │ ├── search.js │ │ │ └── site.js │ ├── templates │ │ ├── candy-bonbon.ftl │ │ ├── candy-bonbon2.ftl │ │ └── order-form.ftl │ └── web-form-config.json └── webapp │ └── WEB-INF │ └── templates │ └── views │ ├── error.jsp │ ├── pages │ ├── admin │ │ └── examples │ │ │ ├── a001.jsp │ │ │ ├── a002.jsp │ │ │ ├── a003.jsp │ │ │ ├── a003a.jsp │ │ │ ├── a004.jsp │ │ │ ├── a004a.jsp │ │ │ ├── a005.jsp │ │ │ ├── a006.jsp │ │ │ ├── a007.jsp │ │ │ ├── a008.jsp │ │ │ ├── a009.jsp │ │ │ ├── a010.jsp │ │ │ ├── a011.jsp │ │ │ ├── a012.jsp │ │ │ └── a013.jsp │ ├── click │ │ └── examples │ │ │ ├── c001.jsp │ │ │ ├── c002.jsp │ │ │ ├── c003.jsp │ │ │ ├── c004.jsp │ │ │ ├── c005.jsp │ │ │ └── c006.jsp │ ├── connect │ │ └── examples │ │ │ └── con001.jsp │ ├── connectedfields │ │ └── examples │ │ │ └── cf001.jsp │ ├── ds_must_authenticate.jsp │ ├── ds_restart.jsp │ ├── ds_return.jsp │ ├── esignature │ │ ├── examples │ │ │ ├── eg001.jsp │ │ │ ├── eg002.jsp │ │ │ ├── eg003.jsp │ │ │ ├── eg004.jsp │ │ │ ├── eg005.jsp │ │ │ ├── eg006.jsp │ │ │ ├── eg007.jsp │ │ │ ├── eg008.jsp │ │ │ ├── eg009.jsp │ │ │ ├── eg010.jsp │ │ │ ├── eg011.jsp │ │ │ ├── eg012.jsp │ │ │ ├── eg013.jsp │ │ │ ├── eg014.jsp │ │ │ ├── eg015.jsp │ │ │ ├── eg016.jsp │ │ │ ├── eg017.jsp │ │ │ ├── eg018.jsp │ │ │ ├── eg019.jsp │ │ │ ├── eg020.jsp │ │ │ ├── eg022.jsp │ │ │ ├── eg023.jsp │ │ │ ├── eg024.jsp │ │ │ ├── eg025.jsp │ │ │ ├── eg026.jsp │ │ │ ├── eg027.jsp │ │ │ ├── eg028.jsp │ │ │ ├── eg029.jsp │ │ │ ├── eg030.jsp │ │ │ ├── eg031.jsp │ │ │ ├── eg032.jsp │ │ │ ├── eg033.jsp │ │ │ ├── eg034.jsp │ │ │ ├── eg035.jsp │ │ │ ├── eg036.jsp │ │ │ ├── eg037.jsp │ │ │ ├── eg038.jsp │ │ │ ├── eg039.jsp │ │ │ ├── eg040.jsp │ │ │ ├── eg041.jsp │ │ │ ├── eg042.jsp │ │ │ ├── eg043.jsp │ │ │ ├── eg044.jsp │ │ │ ├── embed.jsp │ │ │ └── quickEmbeddedSigning.jsp │ │ └── index.jsp │ ├── example_done.jsp │ ├── example_done_compare.jsp │ ├── example_pending.jsp │ ├── links_to_api_methods.jsp │ ├── monitor │ │ └── examples │ │ │ ├── m001.jsp │ │ │ └── m002.jsp │ ├── notary │ │ └── examples │ │ │ └── n004.jsp │ ├── rooms │ │ └── examples │ │ │ ├── r001.jsp │ │ │ ├── r002.jsp │ │ │ ├── r003.jsp │ │ │ ├── r004.jsp │ │ │ ├── r005.jsp │ │ │ ├── r006.jsp │ │ │ ├── r007.jsp │ │ │ ├── r008.jsp │ │ │ └── r009.jsp │ └── webforms │ │ └── examples │ │ ├── embed.jsp │ │ └── web001.jsp │ └── partials │ ├── foot.jsp │ └── head.jsp └── test └── java └── tests ├── Click ├── ActivateClickwrapTest.java └── CreateClickwrapTest.java ├── common ├── JWTLoginMethodTest.java └── TestConfig.java └── eSignature ├── AddDocToTemplateTest.java ├── ApplyBrandToEnvelopeTest.java ├── BulkSendEnvelopesTest.java ├── CreateBrandTest.java ├── CreateNewTemplateTest.java ├── EmbeddedSigningTest.java ├── PermissionCreateTest.java ├── SetTabValuesTest.java ├── SigningViaEmailTest.java └── UseTemplateTest.java /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | name: Java launcher 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v3 16 | - name: Set up JDK 11 17 | uses: actions/setup-java@v3 18 | with: 19 | java-version: '11' 20 | distribution: 'temurin' 21 | cache: maven 22 | - name: Check code with linters 23 | run: mvn -U checkstyle:check 24 | - name: Download dependancies 25 | env: 26 | CLIENT_ID: ${{ secrets.CLIENT_ID }} 27 | IMPERSONATED_USER_ID: ${{ secrets.IMPERSONATED_USER_ID }} 28 | PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} 29 | SIGNER_EMAIL: ${{ secrets.SIGNER_EMAIL }} 30 | SIGNER_NAME: ${{ secrets.SIGNER_NAME }} 31 | run: mvn install 32 | - name: Build with Maven 33 | env: 34 | CLIENT_ID: ${{ secrets.CLIENT_ID }} 35 | IMPERSONATED_USER_ID: ${{ secrets.IMPERSONATED_USER_ID }} 36 | PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} 37 | SIGNER_EMAIL: ${{ secrets.SIGNER_EMAIL }} 38 | SIGNER_NAME: ${{ secrets.SIGNER_NAME }} 39 | run: mvn -B package --file pom.xml 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # idea 2 | .idea/ 3 | #*.iml 4 | 5 | 6 | # target dir 7 | .settings/* 8 | target/* 9 | .classpath 10 | .project 11 | 12 | 13 | # Compiled class file 14 | *.class 15 | 16 | # Log file 17 | *.log 18 | 19 | # BlueJ files 20 | *.ctxt 21 | 22 | # Mobile Tools for Java (J2ME) 23 | .mtj.tmp/ 24 | 25 | # Package Files # 26 | *.jar 27 | *.war 28 | *.nar 29 | *.ear 30 | *.zip 31 | *.tar.gz 32 | *.rar 33 | 34 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 35 | hs_err_pid* 36 | 37 | # don't check configuration files/secrets 38 | 39 | private.key 40 | application.properties 41 | /target/ 42 | src/main/resources/application.json 43 | src/main/resources/application.properties 44 | src/main/java/com/docusign/admin/ 45 | 46 | # according to gitignore.io this shouldnt be shared 47 | .factorypath 48 | src/main/resources/ExportedUserData.csv 49 | app.config 50 | Quick_ACG/target/* 51 | JWT Console App/target/* 52 | Quick_ACG/src/main/resources/application.json 53 | 54 | -------------------------------------------------------------------------------- /.metadata/.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.lock -------------------------------------------------------------------------------- /.metadata/.mylyn/.taskListIndex/segments_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.mylyn/.taskListIndex/segments_1 -------------------------------------------------------------------------------- /.metadata/.mylyn/.taskListIndex/write.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.mylyn/.taskListIndex/write.lock -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index: -------------------------------------------------------------------------------- 1 | /org.eclipse.jdt.corestateVersionNumber30 -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.resources/.root/1.tree: -------------------------------------------------------------------------------- 1 | org.eclipse.jdt.core -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | version=1 3 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.epp.logging.aeri.ide.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resetSendMode=KEEP 3 | resetSendModeOn=0 4 | sendMode=NOTIFY 5 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs: -------------------------------------------------------------------------------- 1 | content_assist_proposals_background=255,255,255 2 | content_assist_proposals_foreground=0,0,0 3 | eclipse.preferences.version=1 4 | org.eclipse.jdt.ui.formatterprofiles.version=13 5 | spelling_locale_initialized=true 6 | useAnnotationsPrefPage=true 7 | useQuickDiffPrefPage=true 8 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.m2e.discovery.pref.projects= 3 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | mylyn.attention.migrated=true 3 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.mylyn.monitor.activity.tracking.enabled.checked=true 3 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | migrated.task.repositories.secure.store=true 3 | org.eclipse.mylyn.tasks.ui.filters.nonmatching=true 4 | org.eclipse.mylyn.tasks.ui.filters.nonmatching.encouraged=true 5 | org.eclipse.mylyn.tasks.ui.welcome.message=true 6 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.team.ui.first_time=false 3 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | overviewRuler_migration=migrated_3.1 3 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs: -------------------------------------------------------------------------------- 1 | PROBLEMS_FILTERS_MIGRATE=true 2 | eclipse.preferences.version=1 3 | platformState=1513356134945 4 | quickStart=false 5 | tipsAndTricks=true 6 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs: -------------------------------------------------------------------------------- 1 | //org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false 2 | PLUGINS_NOT_ACTIVATED_ON_STARTUP=;org.eclipse.m2e.discovery; 3 | eclipse.preferences.version=1 4 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/http-cache.lucene60/segments_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/http-cache.lucene60/segments_1 -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/http-cache.lucene60/write.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/http-cache.lucene60/write.lock -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/_0.cfe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/_0.cfe -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/_0.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/_0.cfs -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/_0.si: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/_0.si -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/segments_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/segments_1 -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/write.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/write.lock -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.jdt.core/index.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/.metadata/.plugins/org.eclipse.jdt.core/index.db -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat: -------------------------------------------------------------------------------- 1 | JRE_LIB JRE_SRCROOT 2 | JUNIT_HOMEJRE_SRCJUNIT_SRC_HOMEM2_REPO -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.8.2.20171007-0217.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %date [%thread] %-5level %logger{35} - %msg%n 5 | 6 | 7 | OFF 8 | 9 | 10 | 11 | 12 | ${org.eclipse.m2e.log.dir}/0.log 13 | 14 | ${org.eclipse.m2e.log.dir}/%i.log 15 | 1 16 | 10 17 | 18 | 19 | 100MB 20 | 21 | 22 | %date [%thread] %-5level %logger{35} - %msg%n 23 | 24 | 25 | 26 | 27 | 28 | WARN 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.ui.intro/introstate: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | -------------------------------------------------------------------------------- /.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.metadata/version.ini: -------------------------------------------------------------------------------- 1 | #Fri Jun 07 16:33:52 PDT 2019 2 | org.eclipse.core.runtime=2 3 | org.eclipse.platform=4.7.1.v20171009-0410 4 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "java", 9 | "name": "Launch App", 10 | "request": "launch", 11 | "mainClass": "com.docusign.App", 12 | "projectName": "code-examples-java" 13 | }, 14 | { 15 | "type": "java", 16 | "name": "Launch Java Program", 17 | "request": "launch", 18 | "mainClass": "" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.configuration.updateBuildConfiguration": "automatic", 3 | "java.compile.nullAnalysis.mode": "automatic" 4 | } -------------------------------------------------------------------------------- /JWT Console App/app.config.example: -------------------------------------------------------------------------------- 1 | clientId={INTEGRATION_KEY_JWT} 2 | userId={IMPERSONATED_USER_ID} 3 | rsaKeyFile=private.key -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2018 DocuSign, Inc. (https://www.docusign.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /PAYMENTS_INSTALLATION.md: -------------------------------------------------------------------------------- 1 | # Configure a payment gateway 2 | 3 | DocuSign offers built-in connections to multiple payment gateways. The payments code example uses a developer account via the Stripe gateway service. 4 | 5 | 6 | ## Create a Stripe payment gateway 7 | 8 | 1. Select the Stripe button on the [**Payments**](https://admindemo.docusign.com/authenticate?goTo=payments) page in your developer account. 9 | 10 | 1. For development, you can skip the Stripe account application by using the **Skip this account form** link at the top of the page.
11 | 12 | ![Skipping the Stripe account form](docs/stripe_skip_account_form_link.png) 13 | 14 | An enabled Stripe payment gateway is now associated with your DocuSign developer account and is shown under **Payment Gateway**. 15 | 16 | 1. Save the **Gateway Account ID** GUID to the code example launcher configuration file. 17 | 18 | 19 | ## Additional documentation 20 | * [Managing Payment Gateways](https://support.docusign.com/en/guides/managing-payment-gateways) 21 | * [How to send a request for payment](https://developers.docusign.com/docs/esign-rest-api/how-to/request-a-payment) 22 | -------------------------------------------------------------------------------- /Quick_ACG/src/main/java/com/docusign/OSDetector.java: -------------------------------------------------------------------------------- 1 | package com.docusign; 2 | 3 | /* 4 | * This class can be used to determine the user's operating system so that the 5 | * application can successfully open a web browser to run the examples. 6 | */ 7 | public class OSDetector 8 | { 9 | private static final boolean isWindows; 10 | private static final boolean isLinux; 11 | private static final boolean isMac; 12 | 13 | static 14 | { 15 | String os = System.getProperty("os.name").toLowerCase(); 16 | isWindows = os.contains("win"); 17 | isLinux = os.contains("nux") || os.contains("nix"); 18 | isMac = os.contains("mac"); 19 | } 20 | 21 | public static boolean isWindows() { return isWindows; } 22 | public static boolean isLinux() { return isLinux; } 23 | public static boolean isMac() { return isMac; } 24 | 25 | } -------------------------------------------------------------------------------- /Quick_ACG/src/main/java/com/docusign/core/model/Session.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model; 2 | 3 | import com.docusign.esign.client.auth.OAuth; 4 | import lombok.Data; 5 | import org.springframework.context.annotation.Scope; 6 | import org.springframework.context.annotation.ScopedProxyMode; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.web.context.WebApplicationContext; 9 | 10 | import java.io.Serializable; 11 | import java.util.List; 12 | import java.util.UUID; 13 | 14 | @Component 15 | @Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.TARGET_CLASS) 16 | @Data 17 | public class Session implements Serializable { 18 | private static final long serialVersionUID = 2695379118371574037L; 19 | 20 | public Long tokenExpirationTime; 21 | 22 | private String accountId; 23 | 24 | private String accountName; 25 | 26 | private String basePath; 27 | 28 | private String envelopeId; 29 | 30 | private String statusCFR; 31 | 32 | private Boolean isPKCEWorking = true; 33 | } 34 | -------------------------------------------------------------------------------- /Quick_ACG/src/main/resources/application.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "quickstart" :"{QUICKSTART_VALUE}", 3 | "quickACG": "{QUICK_ACG_VALUE}", 4 | "DS_SIGNER_NAME": "{SIGNER_NAME}", 5 | "DS_SIGNER_EMAIL": "{SIGNER_EMAIL}", 6 | "DS_APP_URL": "http://localhost:8080", 7 | "DS_TARGET_ACCOUNT_ID": "{IMPERSONATED_USER_ID}", 8 | "DS_BASE_PATH": "https://demo.docusign.net", 9 | "DS_ROOMS_BASE_PATH": "https://demo.rooms.docusign.com", 10 | "DS_CLICK_BASE_PATH": "https://demo.docusign.net", 11 | "DS_MONITOR_BASE_PATH": "https://lens-d.docusign.net", 12 | "DS_ADMIN_BASE_PATH": "https://api-d.docusign.net", 13 | 14 | "Gateway_Name": "{DS_PAYMENT_GATEWAY_NAME}", 15 | "Gateway_Account_Id": "{GATEWAY_ACCOUNT_ID}", 16 | "Gateway_Display_Name": "{DS_PAYMENT_GATEWAY_DISPLAY_NAME}", 17 | 18 | "authorization.code.grant.client.scope": "signature", 19 | "authorization.code.grant.sso.redirect-url": "&type=acg", 20 | "authorization.code.grant.client.client-id": "{INTEGRATION_KEY_AUTH_CODE}", 21 | "authorization.code.grant.client.client-secret": "{SECRET_KEY}", 22 | "authorization.code.grant.client.access-token-uri": "https://account-d.docusign.com/oauth/token", 23 | "authorization.code.grant.client.user-authorization-uri": "https://account-d.docusign.com/oauth/auth?prompt=login", 24 | 25 | "common.client.resource.user-info-uri": "https://account-d.docusign.com/oauth/userinfo", 26 | "com.docusign.github.example-uri": "https://github.com/docusign/code-examples-java/blob/master/src/main/java/", 27 | "com.docusign.documentation-path": "", 28 | 29 | "ESignatureManifest": "https://raw.githubusercontent.com/docusign/code-examples-csharp/master/manifest/eSignatureManifest.json", 30 | 31 | "server.tomcat.additional-tld-skip-patterns": "*jaxb*.jar", 32 | "server.servlet.session.tracking-modes": "cookie", 33 | "server.servlet.session.persistent": false, 34 | "server.error.include-stacktrace": "always", 35 | "server.error.whitelabel.enabled": false, 36 | 37 | "spring.session.store-type": "none", 38 | "spring.mvc.view.prefix": "/WEB-INF/templates/views/", 39 | "spring.mvc.view.suffix": ".jsp", 40 | "spring.jmx.enabled": false 41 | } -------------------------------------------------------------------------------- /docs/Adding_examples.md: -------------------------------------------------------------------------------- 1 | # Proposing and Adding Examples 2 | 3 | This page discusses how to add additional examples to this launcher. 4 | 5 | All contributions must use the MIT License. 6 | 7 | ## Discuss 8 | First, discuss your plans with the DevCenter Examples Manager 9 | (Larry Kluger) via apihelp@docusign.com. He'll assign you an example number. 10 | 11 | A new example can be added to any of the `eg-03-` series of 12 | launchers, except for the curl repo. 13 | 14 | After your new example has been accepted, the DevCenter team will 15 | arrange to have it ported to the other SDK examples. 16 | 17 | ### New examples should be not too big, and not too small 18 | Each example should cover a DocuSign feature "appropriately." 19 | 20 | For example, if a feature offers two options then consider 21 | having your example demonstrate both options. 22 | 23 | ### Self-contained 24 | Examples should be self-contained within the scope of the 25 | launcher. 26 | 27 | For example, if your example operates on a template, 28 | then either use the template created by Create a template, 29 | or modify the template created by Create a template (eg add a field), 30 | or programmatically create a new template. 31 | 32 | If you plan to change Create a template, first discuss with the 33 | Examples Manager via apihelp@docusign.com. 34 | 35 | Do not require a user to create or modify a template by 36 | using the Admin tool. 37 | -------------------------------------------------------------------------------- /docs/IntelliJ_import_highlight.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/docs/IntelliJ_import_highlight.jpg -------------------------------------------------------------------------------- /docs/ds-java-auth-final.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/docs/ds-java-auth-final.zip -------------------------------------------------------------------------------- /docs/install_fig_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/docs/install_fig_1.png -------------------------------------------------------------------------------- /docs/install_fig_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/docs/install_fig_2.png -------------------------------------------------------------------------------- /docs/install_fig_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/docs/install_fig_7.png -------------------------------------------------------------------------------- /docs/lombok_errors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/docs/lombok_errors.png -------------------------------------------------------------------------------- /docs/stripe_skip_account_form_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/docs/stripe_skip_account_form_link.png -------------------------------------------------------------------------------- /src/main/java/com/docusign/JsonPropertySourceLoader.java: -------------------------------------------------------------------------------- 1 | package com.docusign; 2 | 3 | import org.springframework.boot.env.YamlPropertySourceLoader; 4 | 5 | public class JsonPropertySourceLoader extends YamlPropertySourceLoader { 6 | @Override 7 | public String[] getFileExtensions() { 8 | return new String[]{"json"}; 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/java/com/docusign/common/ApiIndex.java: -------------------------------------------------------------------------------- 1 | package com.docusign.common; 2 | 3 | public enum ApiIndex { 4 | ESIGNATURE("/pages/esignature/index", "/restapi", "/eg001", "/eg"), 5 | ROOMS("/pages/rooms/index", "/restapi", "/r001", "/r"), 6 | CLICK("/pages/click/index", "/clickapi", "/c001", "/c"), 7 | MONITOR("/pages/monitor/index", "", "/m001", "/m"), 8 | ADMIN("/pages/admin/index", "/management", "/a001", "/a"), 9 | CONNECT("/pages/connect/index", "", "/con001", "/con"), 10 | NOTARY("/pages/notary/index", "/restapi", "/n004", "/n"), 11 | WEBFORMS("/pages/webforms/index", "/restapi", "/web001", "/web"), 12 | CONNECTEDFIELDS("/pages/connectedfields/index", "/restapi", "/cf001", "/cf"); 13 | 14 | private final String indexPath; 15 | 16 | private final String baseUrlSuffix; 17 | 18 | private final String firstExamplePath; 19 | 20 | private final String examplesPathCode; 21 | 22 | ApiIndex(final String indexPath, final String baseUrlSuffix, final String firstExamplePath, 23 | final String examplesPathCode) { 24 | this.indexPath = indexPath; 25 | this.baseUrlSuffix = baseUrlSuffix; 26 | this.firstExamplePath = firstExamplePath; 27 | this.examplesPathCode = examplesPathCode; 28 | } 29 | 30 | public String getBaseUrlSuffix() { 31 | return baseUrlSuffix; 32 | } 33 | 34 | public String getPathOfFirstExample() { 35 | return firstExamplePath; 36 | } 37 | 38 | public String getExamplesPathCode() { 39 | return examplesPathCode; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return this.indexPath; 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/examples/A005AuditUsers.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.admin.api.UsersApi; 5 | import com.docusign.admin.model.UserDrilldownResponse; 6 | import com.docusign.common.WorkArguments; 7 | import com.docusign.controller.admin.services.AuditUsersService; 8 | import com.docusign.core.model.DoneExample; 9 | import com.docusign.core.model.Session; 10 | import com.docusign.core.model.User; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.ModelMap; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | 15 | import javax.servlet.http.HttpServletResponse; 16 | import java.util.ArrayList; 17 | import java.util.UUID; 18 | 19 | /** 20 | * Create new user This example demonstrates how to create a new user with 21 | * methods from Admin API. 22 | */ 23 | @Controller 24 | @RequestMapping("/a005") 25 | public class A005AuditUsers extends AbstractAdminController { 26 | 27 | public A005AuditUsers(DSConfiguration config, Session session, User user) { 28 | super(config, "a005", user, session); 29 | } 30 | 31 | @Override 32 | protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws Exception { 33 | // Collect ids needed for the request 34 | UUID organizationId = this.getOrganizationId(this.user.getAccessToken(), this.session.getBasePath()); 35 | UUID accountId = this.getExistingAccountId(this.user.getAccessToken(), this.session.getBasePath(), organizationId); 36 | 37 | UsersApi usersApi = createUsersApi(this.user.getAccessToken(), this.session.getBasePath()); 38 | 39 | ArrayList resultsArr = AuditUsersService.auditUsers(usersApi, organizationId, accountId); 40 | 41 | // Process results 42 | DoneExample 43 | .createDefault(getTextForCodeExampleByApiType().ExampleName) 44 | .withMessage(getTextForCodeExampleByApiType().ResultsPageText) 45 | .withJsonObject(resultsArr).addToModel(model, config); 46 | return DONE_EXAMPLE_PAGE; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/examples/A006RetrieveDocuSignProfileByEmailAddress.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.admin.api.UsersApi; 5 | import com.docusign.admin.model.UsersDrilldownResponse; 6 | import com.docusign.common.WorkArguments; 7 | import com.docusign.controller.admin.services.RetrieveDocuSignProfileByEmailAddress; 8 | import com.docusign.core.model.DoneExample; 9 | import com.docusign.core.model.Session; 10 | import com.docusign.core.model.User; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.ModelMap; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | 15 | import javax.servlet.http.HttpServletResponse; 16 | import java.util.UUID; 17 | 18 | /** 19 | * Get a DocuSign user by the email address using the methods from Admin API. 20 | */ 21 | @Controller 22 | @RequestMapping("/a006") 23 | public class A006RetrieveDocuSignProfileByEmailAddress extends AbstractAdminController { 24 | 25 | public A006RetrieveDocuSignProfileByEmailAddress(DSConfiguration config, User user, Session session) { 26 | super(config, "a006", user, session); 27 | } 28 | 29 | @Override 30 | protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws Exception { 31 | UUID organizationId = this.getOrganizationId(this.user.getAccessToken(), this.session.getBasePath()); 32 | //ds-snippet-start:Admin6Step3 33 | UsersApi usersApi = createUsersApi(this.user.getAccessToken(), this.session.getBasePath()); 34 | UsersDrilldownResponse usersResponse = RetrieveDocuSignProfileByEmailAddress 35 | .getDocuSignProfileByEmailAddress(usersApi, organizationId, args.getEmail()); 36 | //ds-snippet-end:Admin6Step3 37 | DoneExample 38 | .createDefault(getTextForCodeExampleByApiType().ExampleName) 39 | .withMessage(getTextForCodeExampleByApiType().ResultsPageText) 40 | .withJsonObject(usersResponse.getUsers()).addToModel(model, config); 41 | 42 | return DONE_EXAMPLE_PAGE; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/examples/A007RetrieveDocuSignProfileByUserID.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.admin.api.UsersApi; 5 | import com.docusign.admin.model.UsersDrilldownResponse; 6 | import com.docusign.common.WorkArguments; 7 | import com.docusign.controller.admin.services.RetrieveDocuSignProfileByUserId; 8 | import com.docusign.core.model.DoneExample; 9 | import com.docusign.core.model.Session; 10 | import com.docusign.core.model.User; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.ModelMap; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | 15 | import javax.servlet.http.HttpServletResponse; 16 | import java.util.UUID; 17 | 18 | /** 19 | * Get a DocuSign user by the user ID using the methods from Admin API. 20 | */ 21 | @Controller 22 | @RequestMapping("/a007") 23 | public class A007RetrieveDocuSignProfileByUserID extends AbstractAdminController { 24 | 25 | public A007RetrieveDocuSignProfileByUserID(DSConfiguration config, User user, Session session) { 26 | super(config, "a007", user, session); 27 | } 28 | 29 | @Override 30 | protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws Exception { 31 | UUID organizationId = this.getOrganizationId(this.user.getAccessToken(), this.session.getBasePath()); 32 | //ds-snippet-start:Admin7Step3 33 | UsersApi usersApi = createUsersApi(this.user.getAccessToken(), this.session.getBasePath()); 34 | 35 | UsersDrilldownResponse usersResponse = RetrieveDocuSignProfileByUserId. 36 | getDocuSignProfileByUserId(usersApi, organizationId, args.getUserId()); 37 | //ds-snippet-end:Admin7Step3 38 | 39 | DoneExample 40 | .createDefault(getTextForCodeExampleByApiType().ExampleName) 41 | .withMessage(getTextForCodeExampleByApiType().ResultsPageText) 42 | .withJsonObject(usersResponse).addToModel(model, config); 43 | 44 | return DONE_EXAMPLE_PAGE; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/examples/A011DeleteUserDataFromAccount.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.admin.api.AccountsApi; 5 | import com.docusign.admin.model.IndividualUserDataRedactionResponse; 6 | import com.docusign.common.WorkArguments; 7 | import com.docusign.controller.admin.services.UserDataManagementService; 8 | import com.docusign.core.model.DoneExample; 9 | import com.docusign.core.model.Session; 10 | import com.docusign.core.model.User; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.ModelMap; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | 15 | import javax.servlet.http.HttpServletResponse; 16 | import java.util.UUID; 17 | 18 | /** 19 | * This example demonstrates how to delete user data from account. 20 | */ 21 | @Controller 22 | @RequestMapping("/a011") 23 | public class A011DeleteUserDataFromAccount extends AbstractAdminController { 24 | 25 | public A011DeleteUserDataFromAccount(DSConfiguration config, Session session, User user) { 26 | super(config, "a011", user, session); 27 | } 28 | 29 | @Override 30 | protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws Exception { 31 | String accessToken = this.user.getAccessToken(); 32 | String basePath = this.session.getBasePath(); 33 | 34 | UUID organizationId = this.getOrganizationId(accessToken, basePath); 35 | UUID existingAccountId = this.getExistingAccountId(accessToken, basePath, organizationId); 36 | AccountsApi accountsApi = createAccountsApi(accessToken, basePath); 37 | 38 | IndividualUserDataRedactionResponse userDataRedactionResponse = (new UserDataManagementService()).deleteUserDataFromAccountByUserId( 39 | accountsApi, 40 | args.getUserId(), 41 | existingAccountId); 42 | 43 | DoneExample.createDefault(getTextForCodeExampleByApiType().ExampleName) 44 | .withMessage(getTextForCodeExampleByApiType().ResultsPageText) 45 | .withJsonObject(userDataRedactionResponse) 46 | .addToModel(model, config); 47 | 48 | return DONE_EXAMPLE_PAGE; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/services/AddActiveUserService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.services; 2 | 3 | import com.docusign.admin.api.UsersApi; 4 | import com.docusign.admin.model.*; 5 | 6 | import java.util.ArrayList; 7 | import java.util.UUID; 8 | 9 | public class AddActiveUserService { 10 | //ds-snippet-start:Admin1Step5 11 | public static NewUserResponse createNewActiveUser( 12 | String groupId, 13 | String profileId, 14 | String email, 15 | String userName, 16 | String firstName, 17 | String lastName, 18 | UsersApi usersApi, 19 | UUID organizationId, 20 | UUID accountId) throws Exception 21 | { 22 | java.util.List groups = new ArrayList<>(); 23 | groups.add(new GroupRequest().id(Long.valueOf(groupId))); 24 | 25 | // Fill the request with data from the form 26 | NewUserRequest accountUserRequest = new NewUserRequest() 27 | .defaultAccountId(accountId) 28 | .addAccountsItem( 29 | new NewUserRequestAccountProperties() 30 | .id(accountId) 31 | .permissionProfile( 32 | new PermissionProfileRequest() 33 | .id(Long.valueOf(profileId)) 34 | ) 35 | .groups(groups) 36 | ) 37 | .email(email) 38 | .userName(userName) 39 | .firstName(firstName) 40 | .lastName(lastName) 41 | .autoActivateMemberships(true); 42 | //ds-snippet-end:Admin1Step5 43 | 44 | //ds-snippet-start:Admin1Step6 45 | return usersApi.createUser(organizationId, accountUserRequest); 46 | //ds-snippet-end:Admin1Step6 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/services/BulkImportUserDataService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.services; 2 | 3 | import com.docusign.admin.api.BulkImportsApi; 4 | import com.docusign.admin.model.OrganizationImportResponse; 5 | 6 | import java.nio.charset.StandardCharsets; 7 | import java.util.UUID; 8 | 9 | public class BulkImportUserDataService { 10 | private static final String BULK_IMPORT_TEXT = "AccountID,UserName,UserEmail,PermissionSet\n%s,FirstLast1,User1java@example.com,DS Admin\n%s,FirstLast2,User2java@example.com,DS Sender"; 11 | 12 | public static OrganizationImportResponse bulkImportUserData( 13 | BulkImportsApi bulkImportsApi, 14 | UUID organizationId, 15 | UUID accountId 16 | ) throws Exception { 17 | // Make sure you're using a verified domain for auto-activation to work properly 18 | //ds-snippet-start:Admin4Step3 19 | String csvUserData = String.format(BULK_IMPORT_TEXT, accountId, accountId); 20 | byte[] csvDataInBytes = csvUserData.getBytes(StandardCharsets.UTF_8); 21 | 22 | return bulkImportsApi.createBulkImportSingleAccountAddUsersRequest(organizationId, accountId, csvDataInBytes); 23 | //ds-snippet-end:Admin4Step3 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/services/CheckImportRequestStatusService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.services; 2 | 3 | import com.docusign.admin.api.BulkImportsApi; 4 | import com.docusign.admin.model.OrganizationImportResponse; 5 | 6 | import java.util.UUID; 7 | 8 | public class CheckImportRequestStatusService { 9 | public static OrganizationImportResponse checkRequestStatus( 10 | BulkImportsApi bulkImportsApi, 11 | UUID organizationId, 12 | UUID importId 13 | ) throws Exception { 14 | // Step 4a start 15 | return bulkImportsApi.getBulkUserImportRequest(organizationId, importId); 16 | // Step 4a end 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/services/CheckRequestStatusService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.services; 2 | 3 | import com.docusign.admin.api.BulkExportsApi; 4 | import com.docusign.admin.model.OrganizationExportResponse; 5 | 6 | import java.util.UUID; 7 | 8 | public class CheckRequestStatusService { 9 | public static OrganizationExportResponse checkRequestStatus( 10 | BulkExportsApi bulkExportsApi, 11 | UUID organizationId, 12 | UUID exportId 13 | ) throws Exception { 14 | return bulkExportsApi.getUserListExport(organizationId, exportId); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/services/DeleteUserProductPermissionProfileById.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.services; 2 | 3 | import com.docusign.admin.api.ProductPermissionProfilesApi; 4 | import com.docusign.admin.model.RemoveUserProductsResponse; 5 | import com.docusign.admin.model.UserProductProfileDeleteRequest; 6 | 7 | import java.util.Collections; 8 | import java.util.UUID; 9 | 10 | public class DeleteUserProductPermissionProfileById { 11 | public static RemoveUserProductsResponse deleteUserProductPermissionProfile( 12 | ProductPermissionProfilesApi productPermissionProfilesApi, 13 | UUID productId, 14 | String emailAddress, 15 | UUID organizationId, 16 | UUID accountId 17 | ) throws Exception { 18 | 19 | //ds-snippet-start:Admin9Step4 20 | var userProductProfileDeleteRequest = new UserProductProfileDeleteRequest(); 21 | userProductProfileDeleteRequest.setProductIds(Collections.singletonList(productId)); 22 | userProductProfileDeleteRequest.setUserEmail(emailAddress); 23 | //ds-snippet-end:Admin9Step4 24 | 25 | return productPermissionProfilesApi.removeUserProductPermission( 26 | organizationId, 27 | accountId, 28 | userProductProfileDeleteRequest); 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/services/RetrieveDocuSignProfileByEmailAddress.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.services; 2 | 3 | import com.docusign.admin.api.UsersApi; 4 | import com.docusign.admin.model.UsersDrilldownResponse; 5 | 6 | import java.util.UUID; 7 | 8 | public class RetrieveDocuSignProfileByEmailAddress { 9 | public static UsersDrilldownResponse getDocuSignProfileByEmailAddress( 10 | UsersApi usersApi, 11 | UUID organizationId, 12 | String emailAddress 13 | ) throws Exception { 14 | var userOptions = usersApi.new GetUserDSProfilesByEmailOptions(); 15 | userOptions.setEmail(emailAddress); 16 | return usersApi.getUserDSProfilesByEmail(organizationId, userOptions); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/services/RetrieveDocuSignProfileByUserId.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.services; 2 | 3 | import com.docusign.admin.api.UsersApi; 4 | import com.docusign.admin.model.UsersDrilldownResponse; 5 | 6 | import java.util.UUID; 7 | 8 | public class RetrieveDocuSignProfileByUserId { 9 | public static UsersDrilldownResponse getDocuSignProfileByUserId( 10 | UsersApi usersApi, 11 | UUID organizationId, 12 | UUID userId 13 | ) throws Exception { 14 | return usersApi.getUserDSProfile(organizationId, userId); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/admin/services/UpdateUserProductPermissionProfileByEmail.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.admin.services; 2 | 3 | import com.docusign.admin.api.ProductPermissionProfilesApi; 4 | import com.docusign.admin.model.ProductPermissionProfileRequest; 5 | import com.docusign.admin.model.UserProductPermissionProfilesRequest; 6 | import com.docusign.admin.model.UserProductPermissionProfilesResponse; 7 | 8 | import java.util.UUID; 9 | 10 | public class UpdateUserProductPermissionProfileByEmail { 11 | public static UserProductPermissionProfilesResponse updateUserProductPermissionProfile( 12 | ProductPermissionProfilesApi productPermissionProfilesApi, 13 | String permissionProfileId, 14 | UUID productId, 15 | String emailAddress, 16 | UUID organizationId, 17 | UUID accountId 18 | ) throws Exception { 19 | //ds-snippet-start:Admin8Step3 20 | var productPermissionProfileRequest = new ProductPermissionProfileRequest(); 21 | productPermissionProfileRequest.setPermissionProfileId(permissionProfileId); 22 | productPermissionProfileRequest.setProductId(productId); 23 | 24 | var userProductPermissionProfilesRequest = new UserProductPermissionProfilesRequest(); 25 | userProductPermissionProfilesRequest.email(emailAddress); 26 | userProductPermissionProfilesRequest.addProductPermissionProfilesItem(productPermissionProfileRequest); 27 | //ds-snippet-end:Admin8Step3 28 | 29 | //ds-snippet-start:Admin8Step4 30 | return productPermissionProfilesApi.addUserProductPermissionProfilesByEmail( 31 | organizationId, 32 | accountId, 33 | userProductPermissionProfilesRequest); 34 | //ds-snippet-end:Admin8Step4 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/click/examples/AbstractClickController.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.click.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.click.api.AccountsApi; 5 | import com.docusign.click.client.ApiClient; 6 | import com.docusign.click.client.auth.OAuth; 7 | import com.docusign.core.controller.AbstractController; 8 | import org.springframework.http.HttpHeaders; 9 | import org.springframework.stereotype.Controller; 10 | 11 | /** 12 | * Abstract base class for all Click controllers. 13 | */ 14 | @Controller 15 | public abstract class AbstractClickController extends AbstractController { 16 | 17 | private static final String EXAMPLE_PAGES_PATH = "pages/click/examples/"; 18 | 19 | public AbstractClickController(DSConfiguration config, String exampleName) { 20 | super(config, exampleName); 21 | } 22 | 23 | /** 24 | * Creates new instance of the Click API client. 25 | * 26 | * @param basePath URL to Click REST API 27 | * @param userAccessToken user's access token 28 | * @return an instance of the {@link ApiClient} 29 | */ 30 | protected static ApiClient createApiClient(String basePath, String userAccessToken) { 31 | //ds-snippet-start:ClickJavaStep2 32 | ApiClient apiClient = new ApiClient(basePath); 33 | apiClient.addDefaultHeader(HttpHeaders.AUTHORIZATION, BEARER_AUTHENTICATION + userAccessToken); 34 | apiClient.addAuthorization("docusignAccessCode", new OAuth()); 35 | return apiClient; 36 | //ds-snippet-end:ClickJavaStep2 37 | } 38 | 39 | /** 40 | * Creates a new instance of the ClickApi. This method 41 | * creates an instance of the ApiClient class silently. 42 | * 43 | * @param basePath URL to Click REST API 44 | * @param userAccessToken user's access token 45 | * @return an instance of the {@link AccountsApi} 46 | */ 47 | protected static AccountsApi createAccountsApiClient(String basePath, String userAccessToken) { 48 | ApiClient apiClient = createApiClient(basePath, userAccessToken); 49 | return new AccountsApi(apiClient); 50 | } 51 | 52 | protected String getExamplePagesPath() { 53 | return AbstractClickController.EXAMPLE_PAGES_PATH; 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/click/examples/C004ControllerGetListClickwraps.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.click.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.click.api.AccountsApi; 5 | import com.docusign.click.client.ApiException; 6 | import com.docusign.click.model.ClickwrapVersionsResponse; 7 | import com.docusign.common.WorkArguments; 8 | import com.docusign.controller.click.services.GetListClickwrapsService; 9 | import com.docusign.core.model.DoneExample; 10 | import com.docusign.core.model.Session; 11 | import com.docusign.core.model.User; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.ui.ModelMap; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | 16 | import javax.servlet.http.HttpServletResponse; 17 | 18 | /** 19 | * Get a list of clickwraps. 20 | */ 21 | @Controller 22 | @RequestMapping("/c004") 23 | public class C004ControllerGetListClickwraps extends AbstractClickController { 24 | 25 | private final Session session; 26 | 27 | private final User user; 28 | 29 | public C004ControllerGetListClickwraps(DSConfiguration config, Session session, User user) { 30 | super(config, "c004"); 31 | this.session = session; 32 | this.user = user; 33 | } 34 | 35 | @Override 36 | protected Object doWork(WorkArguments args, ModelMap model, 37 | HttpServletResponse response) throws ApiException { 38 | // Step 2: Construct your API headers 39 | AccountsApi accountsApi = createAccountsApiClient(this.session.getBasePath(), this.user.getAccessToken()); 40 | 41 | ClickwrapVersionsResponse clickwrapsResponse = GetListClickwrapsService.getListClickwrap( 42 | accountsApi, 43 | this.session.getAccountId()); 44 | 45 | DoneExample.createDefault(this.title) 46 | .withJsonObject(clickwrapsResponse) 47 | .withMessage(getTextForCodeExampleByApiType().ResultsPageText) 48 | .addToModel(model, config); 49 | return DONE_EXAMPLE_PAGE; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/click/examples/ClickwrapHelper.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.click.examples; 2 | 3 | import com.docusign.click.model.Document; 4 | import com.docusign.core.utils.FileUtils; 5 | import org.apache.commons.io.FilenameUtils; 6 | 7 | import java.io.IOException; 8 | import java.util.Base64; 9 | 10 | public class ClickwrapHelper { 11 | 12 | public static final String STATUS_ACTIVE = "active"; 13 | 14 | /** 15 | * Loads document from a file and creates a document object that represents 16 | * loaded document. 17 | * 18 | * @param fileName name of the file to load document; the extension of the 19 | * loading file determines an extension of the created document 20 | * @param docName the name of the document; it may be differ from the file 21 | * @param order order of the created document 22 | * @return the {@link Document} object 23 | * @throws IOException if document cannot be loaded due to some reason 24 | */ 25 | public Document createDocumentFromFile(String fileName, String docName, Integer order) throws IOException { 26 | byte[] buffer = new FileUtils().readFile(fileName); 27 | String extension = FilenameUtils.getExtension(fileName); 28 | return createDocument(buffer, docName, extension, order); 29 | } 30 | 31 | /** 32 | * Creates a document object from the raw data. 33 | * 34 | * @param data the raw data 35 | * @param documentName the name of the document; it may be differ from the file 36 | * @param fileExtension the extension of the creating file 37 | * @param order order of the created document 38 | * @return the {@link Document} object 39 | */ 40 | static Document createDocument(byte[] data, String documentName, String fileExtension, Integer order) { 41 | Document document = new Document(); 42 | document.setDocumentBase64(Base64.getEncoder().encodeToString(data)); 43 | document.setDocumentName(documentName); 44 | document.setFileExtension(fileExtension); 45 | document.setOrder(order); 46 | return document; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/click/services/ActivateClickwrapService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.click.services; 2 | 3 | import com.docusign.click.api.AccountsApi; 4 | import com.docusign.click.client.ApiException; 5 | import com.docusign.click.model.ClickwrapRequest; 6 | import com.docusign.click.model.ClickwrapVersionSummaryResponse; 7 | import com.docusign.click.model.ClickwrapVersionsResponse; 8 | import com.docusign.controller.click.examples.ClickwrapHelper; 9 | 10 | 11 | public final class ActivateClickwrapService { 12 | public static ClickwrapVersionSummaryResponse activateClickwrap( 13 | AccountsApi accountsApi, 14 | String accountId, 15 | String clickwrapId, 16 | String clickwrapVersionNumber) throws ApiException { 17 | //ds-snippet-start:Click2Step3 18 | ClickwrapRequest clickwrapRequest = new ClickwrapRequest().status(ClickwrapHelper.STATUS_ACTIVE); 19 | //ds-snippet-end:Click2Step3 20 | 21 | //ds-snippet-start:Click2Step4 22 | return accountsApi.updateClickwrapVersion( 23 | accountId, 24 | clickwrapId, 25 | clickwrapVersionNumber, 26 | clickwrapRequest); 27 | //ds-snippet-end:Click2Step4 28 | } 29 | 30 | public static ClickwrapVersionsResponse getClickwrapsByStatus( 31 | AccountsApi accountsApi, 32 | String accountId, 33 | String status 34 | ) throws ApiException { 35 | AccountsApi.GetClickwrapsOptions options = accountsApi.new GetClickwrapsOptions(); 36 | options.setStatus(status); 37 | return accountsApi.getClickwraps(accountId, options); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/click/services/CreateClickwrapService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.click.services; 2 | 3 | import com.docusign.click.api.AccountsApi; 4 | import com.docusign.click.client.ApiException; 5 | import com.docusign.click.model.ClickwrapRequest; 6 | import com.docusign.click.model.ClickwrapVersionSummaryResponse; 7 | import com.docusign.click.model.DisplaySettings; 8 | import com.docusign.click.model.Document; 9 | import com.docusign.controller.click.examples.ClickwrapHelper; 10 | 11 | import java.io.IOException; 12 | 13 | public final class CreateClickwrapService { 14 | //ds-snippet-start:Click1Step3 15 | public static ClickwrapRequest createClickwrapRequest( 16 | String clickwrapName, 17 | String fileName, 18 | String documentName, 19 | Integer documentOrder 20 | ) throws IOException { 21 | Document document = new ClickwrapHelper().createDocumentFromFile(fileName, documentName, documentOrder); 22 | DisplaySettings displaySettings = new DisplaySettings() 23 | .displayName("Terms of Service") 24 | .consentButtonText("I Agree") 25 | .downloadable(true) 26 | .format("modal") 27 | .mustRead(true) 28 | .requireAccept(true) 29 | .documentDisplay("document"); 30 | 31 | return new ClickwrapRequest() 32 | .addDocumentsItem(document) 33 | .clickwrapName(clickwrapName) 34 | .requireReacceptance(true) 35 | .displaySettings(displaySettings); 36 | } 37 | //ds-snippet-end:Click1Step3 38 | 39 | public static ClickwrapVersionSummaryResponse createClickwrap( 40 | AccountsApi accountsApi, 41 | String accountId, 42 | ClickwrapRequest clickwrapRequest 43 | ) throws IOException, ApiException { 44 | return accountsApi.createClickwrap( 45 | accountId, 46 | clickwrapRequest); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/click/services/CreateNewVersionClickwrapService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.click.services; 2 | 3 | import com.docusign.click.api.AccountsApi; 4 | import com.docusign.click.client.ApiException; 5 | import com.docusign.click.model.ClickwrapRequest; 6 | import com.docusign.click.model.ClickwrapVersionSummaryResponse; 7 | import com.docusign.click.model.DisplaySettings; 8 | import com.docusign.click.model.Document; 9 | import com.docusign.controller.click.examples.ClickwrapHelper; 10 | 11 | import java.io.IOException; 12 | 13 | public final class CreateNewVersionClickwrapService { 14 | public static ClickwrapVersionSummaryResponse createNewVersionClickwrap( 15 | AccountsApi accountsApi, 16 | ClickwrapRequest clickwrapRequest, 17 | String accountId, 18 | String clickwrapId 19 | ) throws ApiException { 20 | // Step 4: Call the v1 Click API 21 | //ds-snippet-start:Click3Step4 22 | return accountsApi.createClickwrapVersion( 23 | accountId, 24 | clickwrapId, 25 | clickwrapRequest); 26 | //ds-snippet-end:Click3Step4 27 | } 28 | 29 | //ds-snippet-start:Click3Step3 30 | public static ClickwrapRequest createClickwrapRequest( 31 | String fileName, 32 | String documentName, 33 | Integer documentOrder, 34 | String clickwrapName 35 | ) throws IOException { 36 | Document document = new ClickwrapHelper().createDocumentFromFile(fileName, documentName, documentOrder); 37 | DisplaySettings displaySettings = new DisplaySettings() 38 | .displayName(clickwrapName) 39 | .consentButtonText("I Agree") 40 | .downloadable(true) 41 | .format("modal") 42 | .mustRead(true) 43 | .requireAccept(true) 44 | .documentDisplay("document"); 45 | 46 | return new ClickwrapRequest() 47 | .addDocumentsItem(document) 48 | .clickwrapName(clickwrapName) 49 | .requireReacceptance(true) 50 | .status(ClickwrapHelper.STATUS_ACTIVE) 51 | .displaySettings(displaySettings); 52 | } 53 | //ds-snippet-end:Click3Step3 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/click/services/EmbedClickwrapService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.click.services; 2 | 3 | import com.docusign.click.api.AccountsApi; 4 | import com.docusign.click.client.ApiException; 5 | import com.docusign.click.client.ApiResponse; 6 | import com.docusign.click.model.ClickwrapVersionsResponse; 7 | import com.docusign.click.model.UserAgreementRequest; 8 | import com.docusign.click.model.UserAgreementResponse; 9 | 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | public final class EmbedClickwrapService { 14 | public static String createAgreementUrl( 15 | AccountsApi accountsApi, 16 | String accountId, 17 | String clickwrapId, 18 | String fullName, 19 | String email, 20 | String company, 21 | String title, 22 | String date 23 | ) throws ApiException { 24 | 25 | //ds-snippet-start:Click6Step3 26 | UserAgreementRequest userAgreementRequest = new UserAgreementRequest(); 27 | userAgreementRequest.setClientUserId(email); 28 | Map documentData = new HashMap(); 29 | documentData.put("fullName", fullName); 30 | documentData.put("email", email); 31 | documentData.put("company", company); 32 | documentData.put("title", title); 33 | documentData.put("date", date); 34 | userAgreementRequest.setDocumentData(documentData); 35 | //ds-snippet-end:Click6Step3 36 | //ds-snippet-start:Click6Step4 37 | ApiResponse response = accountsApi.createHasAgreedWithHttpInfo(accountId, clickwrapId, userAgreementRequest); 38 | 39 | if (response.getStatusCode() == 201) { 40 | return response.getData().getAgreementUrl(); 41 | } 42 | return "Already Agreed"; 43 | //ds-snippet-end:Click6Step4 44 | } 45 | 46 | public static ClickwrapVersionsResponse getActiveClickwraps( 47 | AccountsApi accountsApi, 48 | String accountId 49 | ) throws ApiException { 50 | AccountsApi.GetClickwrapsOptions options = accountsApi.new GetClickwrapsOptions(); 51 | options.setStatus("active"); 52 | return accountsApi.getClickwraps(accountId, options); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/click/services/GetClickwrapResponsesService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.click.services; 2 | 3 | import com.docusign.click.api.AccountsApi; 4 | import com.docusign.click.client.ApiException; 5 | import com.docusign.click.model.ClickwrapAgreementsResponse; 6 | 7 | public final class GetClickwrapResponsesService { 8 | public static ClickwrapAgreementsResponse getClickwrapResponses( 9 | AccountsApi accountsApi, 10 | String accountId, 11 | String clickwrapId 12 | ) throws ApiException { 13 | // Step 3: Call the v1 Click API 14 | return accountsApi.getClickwrapAgreements(accountId, clickwrapId); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/click/services/GetListClickwrapsService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.click.services; 2 | 3 | import com.docusign.click.api.AccountsApi; 4 | import com.docusign.click.client.ApiException; 5 | import com.docusign.click.model.ClickwrapVersionsResponse; 6 | 7 | public final class GetListClickwrapsService { 8 | public static ClickwrapVersionsResponse getListClickwrap( 9 | AccountsApi accountsApi, 10 | String accountId 11 | ) throws ApiException { 12 | // Step 3: Call the v1 Click API 13 | //ds-snippet-start:Click4Step3 14 | return accountsApi.getClickwraps(accountId); 15 | //ds-snippet-end:Click4Step3 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/connect/examples/AbstractConnectController.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.connect.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.core.controller.AbstractController; 5 | import org.springframework.stereotype.Controller; 6 | 7 | /** 8 | * Abstract base class for all Connect controllers. 9 | */ 10 | @Controller 11 | public abstract class AbstractConnectController extends AbstractController { 12 | 13 | private static final String EXAMPLE_PAGES_PATH = "pages/connect/examples/"; 14 | 15 | public AbstractConnectController(DSConfiguration config, String exampleName) { 16 | super(config, exampleName); 17 | } 18 | 19 | protected String getExamplePagesPath() { 20 | return AbstractConnectController.EXAMPLE_PAGES_PATH; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/connect/examples/EG001ControllerValidateUsingHMAC.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.connect.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.common.WorkArguments; 5 | import com.docusign.controller.connect.services.ValidateUsingHmacService; 6 | import com.docusign.core.model.DoneExample; 7 | import com.docusign.esign.client.ApiException; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.ModelMap; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | 12 | import javax.servlet.http.HttpServletResponse; 13 | import java.io.IOException; 14 | import java.security.InvalidKeyException; 15 | import java.security.NoSuchAlgorithmException; 16 | 17 | @Controller 18 | @RequestMapping("/con001") 19 | public class EG001ControllerValidateUsingHMAC extends AbstractConnectController { 20 | 21 | public EG001ControllerValidateUsingHMAC(DSConfiguration config) { 22 | super(config, "con001"); 23 | } 24 | 25 | @Override 26 | protected Object doWork(WorkArguments args, ModelMap model, 27 | HttpServletResponse response) throws ApiException, IOException, NoSuchAlgorithmException, InvalidKeyException { 28 | String hashedOutput = new ValidateUsingHmacService().computeHash( 29 | args.getHmacSecret(), 30 | args.getJsonPayload().getBytes() 31 | ); 32 | 33 | DoneExample.createDefault(getTextForCodeExampleByApiType().ExampleName) 34 | .withMessage(getTextForCodeExampleByApiType().ResultsPageText 35 | .replaceFirst("\\{0}", hashedOutput) 36 | ) 37 | .addToModel(model, config); 38 | return DONE_EXAMPLE_PAGE; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/connect/services/ValidateUsingHmacService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.connect.services; 2 | 3 | import javax.crypto.Mac; 4 | import javax.crypto.spec.SecretKeySpec; 5 | import java.io.UnsupportedEncodingException; 6 | import java.security.InvalidKeyException; 7 | import java.security.MessageDigest; 8 | import java.security.NoSuchAlgorithmException; 9 | import java.util.Base64; 10 | 11 | public final class ValidateUsingHmacService { 12 | public static String computeHash(String secret, byte[] payload) 13 | throws InvalidKeyException, NoSuchAlgorithmException, UnsupportedEncodingException { 14 | String digest = "HmacSHA256"; 15 | Mac mac = Mac.getInstance(digest); 16 | mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), digest)); 17 | return Base64.getEncoder().encodeToString(mac.doFinal(payload)); 18 | } 19 | 20 | public static boolean isValid(String secret, byte[] payload, String verify) 21 | throws InvalidKeyException, NoSuchAlgorithmException, UnsupportedEncodingException { 22 | String computedHash = computeHash(secret, payload); 23 | return MessageDigest.isEqual(computedHash.getBytes("UTF-8"), 24 | verify.getBytes("UTF-8")); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/examples/EG003ControllerListEnvelopes.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.common.WorkArguments; 5 | import com.docusign.controller.eSignature.services.ListEnvelopesServices; 6 | import com.docusign.core.model.DoneExample; 7 | import com.docusign.core.model.Session; 8 | import com.docusign.core.model.User; 9 | import com.docusign.esign.api.EnvelopesApi; 10 | import com.docusign.esign.client.ApiException; 11 | import com.docusign.esign.model.EnvelopesInformation; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.ui.ModelMap; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | 16 | import javax.servlet.http.HttpServletResponse; 17 | 18 | 19 | /** 20 | * List envelopes in the user's account.
21 | * List the envelopes created in the last 30 days. This example demonstrates 22 | * how to query DocuSign about envelopes sent by the current user. 23 | */ 24 | @Controller 25 | @RequestMapping("/eg003") 26 | public class EG003ControllerListEnvelopes extends AbstractEsignatureController { 27 | 28 | public EG003ControllerListEnvelopes(DSConfiguration config, Session session, User user) { 29 | super(config, "eg003", session, user); 30 | } 31 | 32 | @Override 33 | protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws ApiException { 34 | //ds-snippet-start:eSign3Step2 35 | EnvelopesApi envelopesApi = createEnvelopesApi(session.getBasePath(), user.getAccessToken()); 36 | EnvelopesInformation envelopesInformation = ListEnvelopesServices.listEnvelopes( 37 | envelopesApi, 38 | session.getAccountId()); 39 | //ds-snippet-end:eSign3Step2 40 | 41 | DoneExample.createDefault(getTextForCodeExampleByApiType().ExampleName) 42 | .withMessage(getTextForCodeExampleByApiType().ResultsPageText) 43 | .withJsonObject(envelopesInformation) 44 | .addToModel(model, config); 45 | return DONE_EXAMPLE_PAGE; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/examples/EG010ControllerSendBinaryDocs.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.common.WorkArguments; 5 | import com.docusign.controller.eSignature.services.SendBinaryDocsService; 6 | import com.docusign.core.model.DoneExample; 7 | import com.docusign.core.model.Session; 8 | import com.docusign.core.model.User; 9 | import org.json.JSONObject; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.ModelMap; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | import javax.servlet.http.HttpServletResponse; 15 | import java.io.IOException; 16 | 17 | 18 | /** 19 | * Send an envelope using binary document transfer.
20 | * The envelope includes a pdf, doc, and HTML document. Multipart data transfer 21 | * is used to send the documents in binary format to DocuSign. 22 | */ 23 | @Controller 24 | @RequestMapping("/eg010") 25 | public class EG010ControllerSendBinaryDocs extends AbstractEsignatureController { 26 | 27 | public EG010ControllerSendBinaryDocs(DSConfiguration config, Session session, User user) { 28 | super(config, "eg010", session, user); 29 | } 30 | 31 | @Override 32 | protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws IOException { 33 | String responseString = SendBinaryDocsService.sendBinaryDocs( 34 | args, 35 | args.getSignerName(), 36 | args.getSignerEmail(), 37 | args.getCcName(), 38 | args.getCcEmail(), 39 | session.getBasePath(), 40 | session.getAccountId(), 41 | user.getAccessToken() 42 | ); 43 | JSONObject obj = new JSONObject(responseString); 44 | String envelopeId = obj.getString("envelopeId"); 45 | session.setEnvelopeId(envelopeId); 46 | 47 | DoneExample.createDefault(getTextForCodeExampleByApiType().ExampleName) 48 | .withMessage(getTextForCodeExampleByApiType().ResultsPageText 49 | .replaceFirst("\\{0}", envelopeId) 50 | ) 51 | .addToModel(model, config); 52 | return DONE_EXAMPLE_PAGE; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/examples/ExampleException.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.examples; 2 | 3 | /** 4 | * Unchecked exception caused by examples. 5 | */ 6 | public class ExampleException extends RuntimeException { 7 | 8 | private static final long serialVersionUID = 1L; 9 | 10 | /** 11 | * Constructs a new exception with the specified detail message and cause. 12 | * 13 | * @param message the detail message, which is kept as member 14 | * @param cause the cause, which is saved as member 15 | */ 16 | public ExampleException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/AccessCodeAuthenticationService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.controller.eSignature.examples.EnvelopeHelpers; 4 | import com.docusign.esign.api.EnvelopesApi; 5 | import com.docusign.esign.client.ApiException; 6 | import com.docusign.esign.model.*; 7 | 8 | import java.io.IOException; 9 | import java.util.Collections; 10 | 11 | public final class AccessCodeAuthenticationService { 12 | private static final String DOCUMENT_FILE_NAME = "World_Wide_Corp_lorem.pdf"; 13 | 14 | private static final String DOCUMENT_NAME = "Lorem"; 15 | 16 | public static EnvelopeSummary accessCodeAuthentication( 17 | EnvelopesApi envelopesApi, 18 | String accountId, 19 | EnvelopeDefinition envelope 20 | ) throws ApiException { 21 | //ds-snippet-start:eSign19Step4 22 | return envelopesApi.createEnvelope(accountId, envelope); 23 | //ds-snippet-end:eSign19Step4 24 | } 25 | 26 | //ds-snippet-start:eSign19Step3 27 | public static EnvelopeDefinition createEnvelope( 28 | String signerName, 29 | String signerEmail, 30 | String accessCode 31 | ) throws IOException { 32 | Document doc = EnvelopeHelpers.createDocumentFromFile(DOCUMENT_FILE_NAME, DOCUMENT_NAME, "1"); 33 | 34 | Signer signer = KBAAuthenticationService.setSignHereAndSignerForEnvelope(signerName, signerEmail); 35 | signer.setAccessCode(accessCode); 36 | 37 | Recipients recipients = new Recipients(); 38 | recipients.setSigners(Collections.singletonList(signer)); 39 | 40 | EnvelopeDefinition envelope = new EnvelopeDefinition(); 41 | envelope.setEmailSubject("Please Sign"); 42 | envelope.setDocuments(Collections.singletonList(doc)); 43 | envelope.setEnvelopeIdStamping("true"); 44 | envelope.setEmailBlurb("Sample text for email body"); 45 | envelope.setStatus(EnvelopeHelpers.ENVELOPE_STATUS_SENT); 46 | envelope.setRecipients(recipients); 47 | 48 | return envelope; 49 | } 50 | //ds-snippet-end:eSign19Step3 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/ApplyBrandToTemplateService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.controller.eSignature.examples.EnvelopeHelpers; 4 | import com.docusign.esign.api.EnvelopesApi; 5 | import com.docusign.esign.client.ApiException; 6 | import com.docusign.esign.model.EnvelopeDefinition; 7 | import com.docusign.esign.model.EnvelopeSummary; 8 | import com.docusign.esign.model.TemplateRole; 9 | 10 | import java.util.Arrays; 11 | 12 | public final class ApplyBrandToTemplateService { 13 | public static EnvelopeSummary applyBrandToTemplate( 14 | EnvelopesApi envelopesApi, 15 | String accountId, 16 | EnvelopeDefinition envelope 17 | ) throws ApiException { 18 | //ds-snippet-start:eSign30Step4 19 | return envelopesApi.createEnvelope(accountId, envelope); 20 | //ds-snippet-end:eSign30Step4 21 | } 22 | 23 | public static EnvelopeDefinition makeEnvelope( 24 | String signerEmail, 25 | String signerName, 26 | String ccEmail, 27 | String ccName, 28 | String templateId, 29 | String brandId 30 | ) { 31 | TemplateRole signer = new TemplateRole() 32 | .email(signerEmail) 33 | .name(signerName) 34 | .roleName(EnvelopeHelpers.SIGNER_ROLE_NAME); 35 | 36 | TemplateRole cc = new TemplateRole() 37 | .email(ccEmail) 38 | .name(ccName) 39 | .roleName(EnvelopeHelpers.CC_ROLE_NAME); 40 | 41 | return new EnvelopeDefinition() 42 | .templateId(templateId) 43 | .templateRoles(Arrays.asList(signer, cc)) 44 | .brandId(brandId) 45 | .status(EnvelopeHelpers.ENVELOPE_STATUS_SENT); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/CreateBrandService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.esign.api.AccountsApi; 4 | import com.docusign.esign.client.ApiException; 5 | import com.docusign.esign.model.Brand; 6 | import com.docusign.esign.model.BrandsResponse; 7 | 8 | import java.util.List; 9 | 10 | public final class CreateBrandService { 11 | public static BrandsResponse createBrand( 12 | AccountsApi accountsApi, 13 | String brandName, 14 | String language, 15 | String accountId 16 | ) throws ApiException { 17 | Brand brand = new Brand() 18 | .brandName(brandName) 19 | .defaultBrandLanguage(language) 20 | .brandLanguages(List.of(language)); 21 | 22 | // Step 4. Call the eSignature REST API 23 | //ds-snippet-start:eSign28Step4 24 | return accountsApi.createBrand(accountId, brand); 25 | //ds-snippet-end:eSign28Step4 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/EmbeddedConsoleService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.esign.api.EnvelopesApi; 4 | import com.docusign.esign.client.ApiException; 5 | import com.docusign.esign.model.ConsoleViewRequest; 6 | import com.docusign.esign.model.ViewUrl; 7 | 8 | public final class EmbeddedConsoleService { 9 | public static ViewUrl createConsoleView( 10 | EnvelopesApi envelopesApi, 11 | String dsReturnUrl, 12 | String envelopeId, 13 | String startingView, 14 | String accountId) throws ApiException { 15 | // Step 1. Create the Console / Web UI view. 16 | // Set the URL where you want the recipient to go once they are finished in 17 | // the Web UI. There are cases where a user will never click "FINISH" within 18 | // the Web UI, you cannot assume control will be passed back to your application. 19 | //ds-snippet-start:eSign12Step2 20 | ConsoleViewRequest viewRequest = new ConsoleViewRequest(); 21 | viewRequest.setReturnUrl(dsReturnUrl); 22 | if ("envelope".equalsIgnoreCase(startingView) && envelopeId != null) { 23 | viewRequest.setEnvelopeId(envelopeId); 24 | } 25 | 26 | // Step 2. Call the CreateSenderView API 27 | return envelopesApi.createConsoleView(accountId, viewRequest); 28 | //ds-snippet-end:eSign12Step2 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/EnvelopeCustomFieldValuesService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.esign.api.EnvelopesApi; 4 | import com.docusign.esign.client.ApiException; 5 | import com.docusign.esign.model.CustomFieldsEnvelope; 6 | 7 | public final class EnvelopeCustomFieldValuesService { 8 | public static CustomFieldsEnvelope envelopeCustomFieldValues( 9 | EnvelopesApi envelopesApi, 10 | String accountId, 11 | String envelopeId 12 | ) throws ApiException { 13 | return envelopesApi.listCustomFields(accountId, envelopeId); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/EnvelopeDocsService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.esign.api.EnvelopesApi; 4 | import com.docusign.esign.client.ApiException; 5 | import com.docusign.esign.model.EnvelopeDocumentsResult; 6 | 7 | public final class EnvelopeDocsService { 8 | public static EnvelopeDocumentsResult envelopeDocs( 9 | EnvelopesApi envelopesApi, 10 | String accountId, 11 | String envelopeId 12 | ) throws ApiException { 13 | // Step 1. List the envelope's documents 14 | return envelopesApi.listDocuments(accountId, envelopeId); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/EnvelopeGetDocService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.esign.api.EnvelopesApi; 4 | import com.docusign.esign.client.ApiException; 5 | import org.apache.commons.io.FilenameUtils; 6 | 7 | public final class EnvelopeGetDocService { 8 | 9 | public static byte[] envelopeGetDoc( 10 | EnvelopesApi envelopesApi, 11 | String accountId, 12 | String envelopeId, 13 | String documentId 14 | ) throws ApiException { 15 | //ds-snippet-start:eSign7Step3 16 | return envelopesApi.getDocument(accountId, envelopeId, documentId); 17 | //ds-snippet-end:eSign7Step3 18 | } 19 | 20 | public static String addExtension(String fileName, String extension) { 21 | if (FilenameUtils.isExtension(fileName, extension)) { 22 | return fileName; 23 | } 24 | return String.join(".", fileName, extension); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/EnvelopeInfoService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.esign.api.EnvelopesApi; 4 | import com.docusign.esign.client.ApiException; 5 | import com.docusign.esign.model.Envelope; 6 | 7 | //ds-snippet-start:eSign4Step2 8 | public final class EnvelopeInfoService { 9 | public static Envelope envelopeInfo( 10 | EnvelopesApi envelopesApi, 11 | String accountId, 12 | String envelopeId 13 | ) throws ApiException { 14 | return envelopesApi.getEnvelope(accountId, envelopeId); 15 | } 16 | } 17 | //ds-snippet-end:eSign4Step2 18 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/EnvelopeRecipientsService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.esign.api.EnvelopesApi; 4 | import com.docusign.esign.client.ApiException; 5 | import com.docusign.esign.model.Recipients; 6 | 7 | public final class EnvelopeRecipientsService { 8 | public static Recipients envelopeRecipients( 9 | EnvelopesApi envelopesApi, 10 | String accountId, 11 | String envelopeId 12 | ) throws ApiException { 13 | return envelopesApi.listRecipients(accountId, envelopeId); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/GetTabValuesService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.esign.api.EnvelopesApi; 4 | import com.docusign.esign.client.ApiException; 5 | import com.docusign.esign.model.EnvelopeFormData; 6 | 7 | public final class GetTabValuesService { 8 | public static EnvelopeFormData getTabValues( 9 | EnvelopesApi envelopesApi, 10 | String accountId, 11 | String envelopeId 12 | ) throws ApiException { 13 | return envelopesApi.getFormData(accountId, envelopeId); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/ListEnvelopesServices.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.core.utils.DateUtils; 4 | import com.docusign.esign.api.EnvelopesApi; 5 | import com.docusign.esign.client.ApiException; 6 | import com.docusign.esign.model.EnvelopesInformation; 7 | 8 | import java.time.LocalDate; 9 | 10 | public final class ListEnvelopesServices { 11 | private static final int FROM_DATE_OFFSET_DAYS = 30; 12 | 13 | public static EnvelopesInformation listEnvelopes(EnvelopesApi envelopesApi, String accountId) throws ApiException { 14 | EnvelopesApi.ListStatusChangesOptions options = envelopesApi.new ListStatusChangesOptions(); 15 | LocalDate date = LocalDate.now().minusDays(FROM_DATE_OFFSET_DAYS); 16 | options.setFromDate(DateUtils.DATE_WITH_LINES.format(date)); 17 | return envelopesApi.listStatusChanges(accountId, options); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/PermissionCreateService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.controller.eSignature.examples.DsModelUtils; 4 | import com.docusign.core.model.AccountRoleSettingsPatch; 5 | import com.docusign.esign.api.AccountsApi; 6 | import com.docusign.esign.client.ApiException; 7 | import com.docusign.esign.model.AccountRoleSettings; 8 | import com.docusign.esign.model.PermissionProfile; 9 | import com.google.gson.Gson; 10 | 11 | public class PermissionCreateService { 12 | public static PermissionProfile createNewProfile( 13 | AccountsApi accountsApi, 14 | String accountId, 15 | String permissionProfileName 16 | ) throws ApiException { 17 | // Step 3. Construct your request body 18 | // We're extending the AccountSettings class with AccountSettingsPatch to include the signingUIVersion which is missing in the swagger spec at this time. 19 | //ds-snippet-start:eSign24Step3 20 | Gson gson = new Gson(); 21 | String signingUiVersion = "1"; 22 | AccountRoleSettings settings = DsModelUtils.createDefaultRoleSettings(); 23 | AccountRoleSettingsPatch newSettings = gson.fromJson(gson.toJson(settings), AccountRoleSettingsPatch.class); 24 | newSettings.signingUiVersion(signingUiVersion); 25 | PermissionProfile profile = new PermissionProfile() 26 | .permissionProfileName(permissionProfileName) 27 | .settings(newSettings); 28 | //ds-snippet-end:eSign24Step3 29 | 30 | // Step 4. Call the eSignature REST API 31 | //ds-snippet-start:eSign24Step4 32 | return accountsApi.createPermissionProfile(accountId, profile); 33 | //ds-snippet-end:eSign24Step4 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/PermissionDeleteService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | 4 | import com.docusign.esign.api.AccountsApi; 5 | import com.docusign.esign.client.ApiException; 6 | 7 | public final class PermissionDeleteService { 8 | public static void permissionDelete( 9 | AccountsApi accountsApi, 10 | String accountId, 11 | String curProfileId 12 | ) throws ApiException { 13 | accountsApi.deletePermissionProfile(accountId, curProfileId); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/PermissionSetUserGroupsService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.esign.api.GroupsApi; 4 | import com.docusign.esign.client.ApiClient; 5 | import com.docusign.esign.client.ApiException; 6 | import com.docusign.esign.model.Group; 7 | import com.docusign.esign.model.GroupInformation; 8 | 9 | import java.util.List; 10 | 11 | public final class PermissionSetUserGroupsService { 12 | public static GroupInformation permissionSetUserGroups( 13 | ApiClient apiClient, 14 | String groupId, 15 | String profileId, 16 | String accountId 17 | ) throws ApiException { 18 | GroupsApi groupsApi = new GroupsApi(apiClient); 19 | 20 | // Step 3: Perform request 21 | Group newGroup = new Group() 22 | .groupId(groupId) 23 | .permissionProfileId(profileId); 24 | GroupInformation groupInformation = new GroupInformation() 25 | .groups(List.of(newGroup)); 26 | return groupsApi.updateGroups(accountId, groupInformation); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/eSignature/services/UnpauseSignatureWorkflowService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.eSignature.services; 2 | 3 | import com.docusign.controller.eSignature.examples.EnvelopeHelpers; 4 | import com.docusign.esign.api.EnvelopesApi; 5 | import com.docusign.esign.client.ApiException; 6 | import com.docusign.esign.model.Envelope; 7 | import com.docusign.esign.model.EnvelopeUpdateSummary; 8 | import com.docusign.esign.model.Workflow; 9 | 10 | public class UnpauseSignatureWorkflowService { 11 | public static EnvelopeUpdateSummary unpauseSignatureWorkflow( 12 | EnvelopesApi envelopesApi, 13 | String accountId, 14 | String envelopeId 15 | ) throws ApiException { 16 | // Step 3: Construct your envelope JSON body 17 | //ds-snippet-start:eSign33Step3 18 | Workflow workflow = new Workflow(); 19 | workflow.setWorkflowStatus(EnvelopeHelpers.WORKFLOW_STATUS_IN_PROGRESS); 20 | 21 | Envelope envelope = new Envelope(); 22 | envelope.setWorkflow(workflow); 23 | 24 | EnvelopesApi.UpdateOptions updateOptions = envelopesApi.new UpdateOptions(); 25 | updateOptions.setResendEnvelope("true"); 26 | //ds-snippet-end:eSign33Step3 27 | 28 | // Step 4: Call the eSignature REST API 29 | //ds-snippet-start:eSign33Step4 30 | return envelopesApi.update( 31 | accountId, 32 | envelopeId, 33 | envelope, 34 | updateOptions 35 | ); 36 | //ds-snippet-end:eSign33Step4 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/notary/examples/Neg004SendWithThirdPartyNotaryController.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.notary.examples; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.http.HttpServletResponse; 6 | 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.ModelMap; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import com.docusign.DSConfiguration; 11 | import com.docusign.common.WorkArguments; 12 | import com.docusign.core.model.DoneExample; 13 | import com.docusign.core.model.Session; 14 | import com.docusign.core.model.User; 15 | import com.docusign.esign.api.EnvelopesApi; 16 | import com.docusign.esign.client.ApiException; 17 | import com.docusign.controller.notary.services.SendWithThirdPartyNotaryService; 18 | 19 | @Controller 20 | @RequestMapping("/n004") 21 | public class Neg004SendWithThirdPartyNotaryController extends AbstractNotaryController { 22 | 23 | public Neg004SendWithThirdPartyNotaryController(DSConfiguration config, Session session, User user) { 24 | super(config, "n004", session, user); 25 | } 26 | 27 | @Override 28 | protected Object doWork( 29 | WorkArguments args, 30 | ModelMap model, 31 | HttpServletResponse response) 32 | throws ApiException, IOException, com.docusign.webforms.client.ApiException { 33 | EnvelopesApi envelopesApi = createEnvelopesApi(session.getBasePath(), user.getAccessToken()); 34 | 35 | // Call the Examples API method to create and send an notary envelope via email 36 | var envelopeId = SendWithThirdPartyNotaryService.sendWithNotary( 37 | args.getSignerEmail(), 38 | args.getSignerName(), 39 | this.session.getAccountId(), 40 | envelopesApi, 41 | args); 42 | 43 | DoneExample.createDefault(getTextForCodeExampleByApiType().ExampleName) 44 | .withMessage(getTextForCodeExampleByApiType().ResultsPageText 45 | .replaceFirst("\\{0}", envelopeId)) 46 | .addToModel(model, config); 47 | return DONE_EXAMPLE_PAGE; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/examples/R007ControllerCreateFormGroup.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.examples; 2 | 3 | import com.docusign.DSConfiguration; 4 | import com.docusign.common.WorkArguments; 5 | import com.docusign.controller.rooms.services.CreateFormGroupService; 6 | import com.docusign.core.model.DoneExample; 7 | import com.docusign.core.model.Session; 8 | import com.docusign.core.model.User; 9 | import com.docusign.rooms.api.FormGroupsApi; 10 | import com.docusign.rooms.client.ApiException; 11 | import com.docusign.rooms.model.FormGroup; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.ui.ModelMap; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | 16 | import javax.servlet.http.HttpServletResponse; 17 | import java.io.IOException; 18 | 19 | /** 20 | * Creating create a form group. 21 | */ 22 | @Controller 23 | @RequestMapping("/r007") 24 | public class R007ControllerCreateFormGroup extends AbstractRoomsController { 25 | 26 | public R007ControllerCreateFormGroup(DSConfiguration config, Session session, User user) { 27 | super(config, "r007"); 28 | this.session = session; 29 | this.user = user; 30 | } 31 | 32 | @Override 33 | // ***DS.snippet.0.start 34 | protected Object doWork(WorkArguments args, ModelMap model, 35 | HttpServletResponse response) throws IOException, ApiException { 36 | 37 | //ds-snippet-start:Rooms7Step2 38 | FormGroupsApi formGroupsApi = createFormGroupsApi( 39 | this.session.getBasePath(), this.user.getAccessToken() 40 | ); 41 | //ds-snippet-end:Rooms7Step2 42 | 43 | FormGroup formGroup = CreateFormGroupService.createFormGroup( 44 | formGroupsApi, 45 | this.session.getAccountId(), 46 | args.getFormGroupName()); 47 | 48 | DoneExample.createDefault(this.title) 49 | .withJsonObject(formGroup) 50 | .withMessage(getTextForCodeExampleByApiType().ResultsPageText 51 | .replaceFirst("\\{0}", formGroup.getName())) 52 | .addToModel(model, config); 53 | return DONE_EXAMPLE_PAGE; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/AddingFormsToRoomService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.RoomsApi; 4 | import com.docusign.rooms.client.ApiException; 5 | import com.docusign.rooms.model.FormForAdd; 6 | import com.docusign.rooms.model.RoomDocument; 7 | 8 | import java.util.UUID; 9 | 10 | public final class AddingFormsToRoomService { 11 | public static RoomDocument addFormsToRoom( 12 | RoomsApi roomsApi, 13 | String accountId, 14 | UUID formId, 15 | Integer roomId 16 | ) throws ApiException { 17 | FormForAdd formForAdd = new FormForAdd().formId(formId); 18 | return roomsApi.addFormToRoom(accountId, roomId, formForAdd); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/AssignFormToFormGroupService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.FormGroupsApi; 4 | import com.docusign.rooms.client.ApiException; 5 | import com.docusign.rooms.model.FormGroupFormToAssign; 6 | 7 | import java.util.UUID; 8 | 9 | public final class AssignFormToFormGroupService { 10 | public static FormGroupFormToAssign assignFormToFormGroup( 11 | FormGroupsApi formGroupsApi, 12 | String accountId, 13 | UUID formId, 14 | UUID formGroupId 15 | ) throws ApiException { 16 | //ds-snippet-start:Rooms9Step5 17 | FormGroupFormToAssign formGroupFormToAssignRequest = new FormGroupFormToAssign() 18 | .formId(formId); 19 | //ds-snippet-end:Rooms9Step5 20 | 21 | return formGroupsApi.assignFormGroupForm( 22 | accountId, formGroupId, formGroupFormToAssignRequest); 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/CreateFormGroupService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.FormGroupsApi; 4 | import com.docusign.rooms.client.ApiException; 5 | import com.docusign.rooms.model.FormGroup; 6 | import com.docusign.rooms.model.FormGroupForCreate; 7 | 8 | public final class CreateFormGroupService { 9 | public static FormGroup createFormGroup( 10 | FormGroupsApi formGroupsApi, 11 | String accountId, 12 | String formGroupName 13 | ) throws ApiException { 14 | //ds-snippet-start:Rooms7Step3 15 | FormGroupForCreate formGroupForCreate = new FormGroupForCreate() 16 | .name(formGroupName); 17 | //ds-snippet-end:Rooms7Step3 18 | 19 | //ds-snippet-start:Rooms7Step4 20 | return formGroupsApi.createFormGroup(accountId, formGroupForCreate); 21 | //ds-snippet-end:Rooms7Step4 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/CreateRoomService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.RoomsApi; 4 | import com.docusign.rooms.client.ApiException; 5 | import com.docusign.rooms.model.FieldDataForCreate; 6 | import com.docusign.rooms.model.Room; 7 | import com.docusign.rooms.model.RoomForCreate; 8 | 9 | //ds-snippet-start:Rooms1Step4 10 | public final class CreateRoomService { 11 | public static Room createRoomFromModel( 12 | RoomsApi roomsApi, 13 | String accountId, 14 | RoomForCreate roomForCreate 15 | ) throws ApiException { 16 | return roomsApi.createRoom(accountId, roomForCreate); 17 | } 18 | //ds-snippet-end:Rooms1Step4 19 | 20 | public static RoomForCreate createRoomModel(Integer roleId, String roomName) { 21 | return new RoomForCreate() 22 | .name(roomName) 23 | .roleId(roleId) 24 | .transactionSideId("listbuy") 25 | .fieldData( 26 | new FieldDataForCreate() 27 | .putDataItem("address1", "123 EZ Street") 28 | .putDataItem("address2", "unit 10") 29 | .putDataItem("city", "Galaxian") 30 | .putDataItem("state", "US-HI") 31 | .putDataItem("postalCode", "11112") 32 | .putDataItem("companyRoomStatus", "5") 33 | .putDataItem( 34 | "comments", 35 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.") 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/CreateRoomWithTemplateService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.RoomsApi; 4 | import com.docusign.rooms.client.ApiException; 5 | import com.docusign.rooms.model.FieldDataForCreate; 6 | import com.docusign.rooms.model.Room; 7 | import com.docusign.rooms.model.RoomForCreate; 8 | 9 | public final class CreateRoomWithTemplateService { 10 | public static Room createRoomFromModel( 11 | RoomsApi roomsApi, 12 | String accountId, 13 | RoomForCreate roomForCreate 14 | ) throws ApiException { 15 | return roomsApi.createRoom(accountId, roomForCreate); 16 | } 17 | 18 | public static RoomForCreate createRoom(Integer roleId, String roomName, Integer templateId) { 19 | //ds-snippet-start:Rooms2Step5 20 | return new RoomForCreate() 21 | .name(roomName) 22 | .roleId(roleId) 23 | .templateId(templateId) 24 | .fieldData( 25 | new FieldDataForCreate() 26 | .putDataItem("address1", "123 EZ Street") 27 | .putDataItem("address2", "unit 10") 28 | .putDataItem("city", "Galaxian") 29 | .putDataItem("state", "US-HI") 30 | .putDataItem("postalCode", "11112") 31 | .putDataItem("companyRoomStatus", "5") 32 | .putDataItem("comments", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.") 33 | ); 34 | //ds-snippet-end:Rooms2Step5 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/ExportingDataFromRoomService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.RoomsApi; 4 | import com.docusign.rooms.client.ApiException; 5 | import com.docusign.rooms.model.FieldData; 6 | 7 | public final class ExportingDataFromRoomService { 8 | public static FieldData exportDataFromRoom( 9 | RoomsApi roomsApi, 10 | String accountId, 11 | Integer roomId 12 | ) throws ApiException { 13 | return roomsApi.getRoomFieldData(accountId, roomId); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/ExternalFormSessionService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.ExternalFormFillSessionsApi; 4 | import com.docusign.rooms.api.RoomsApi; 5 | import com.docusign.rooms.client.ApiException; 6 | import com.docusign.rooms.model.ExternalFormFillSession; 7 | import com.docusign.rooms.model.ExternalFormFillSessionForCreate; 8 | import com.docusign.rooms.model.RoomDocumentList; 9 | import com.docusign.rooms.model.RoomSummaryList; 10 | 11 | public class ExternalFormSessionService { 12 | public RoomDocumentList getDocuments( 13 | RoomsApi roomsApi, 14 | String accountId, 15 | Integer roomId 16 | ) throws ApiException { 17 | return roomsApi.getDocuments( 18 | accountId, 19 | roomId); 20 | } 21 | 22 | public RoomSummaryList getRooms( 23 | RoomsApi roomsApi, 24 | String accountId 25 | ) throws ApiException { 26 | return roomsApi.getRooms(accountId); 27 | } 28 | 29 | public ExternalFormFillSession createSession( 30 | ExternalFormFillSessionsApi externalFormFillSessionsApi, 31 | String accountId, 32 | ExternalFormFillSessionForCreate sessionForCreate 33 | ) throws ApiException { 34 | return externalFormFillSessionsApi.createExternalFormFillSession(accountId, sessionForCreate); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/GetAdminRolesService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.RolesApi; 4 | import com.docusign.rooms.client.ApiException; 5 | import com.docusign.rooms.model.RoleSummary; 6 | import com.docusign.rooms.model.RoleSummaryList; 7 | 8 | public final class GetAdminRolesService { 9 | public static RoleSummary getAdminRole(RolesApi rolesApi, String accountId) 10 | throws ApiException { 11 | RoleSummaryList roleSummaryList = rolesApi.getRoles(accountId); 12 | return roleSummaryList.getRoles() 13 | .stream() 14 | .filter(RoleSummary::isIsDefaultForAdmin) 15 | .findFirst() 16 | .get(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/GetFormSummaryListService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.FormLibrariesApi; 4 | import com.docusign.rooms.client.ApiException; 5 | import com.docusign.rooms.model.FormLibrarySummary; 6 | import com.docusign.rooms.model.FormLibrarySummaryList; 7 | import com.docusign.rooms.model.FormSummary; 8 | import com.docusign.rooms.model.FormSummaryList; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | 14 | public final class GetFormSummaryListService { 15 | public static List getFormSummaryList( 16 | FormLibrariesApi formLibrariesApi, 17 | String accountId 18 | ) throws ApiException { 19 | FormLibrarySummaryList formLibrarySummaryList = formLibrariesApi.getFormLibraries(accountId); 20 | 21 | List forms = new ArrayList<>(); 22 | int counter = 0; // Counter variable 23 | 24 | for (FormLibrarySummary formLibrarySummary : formLibrarySummaryList.getFormsLibrarySummaries()) { 25 | FormSummaryList formSummaryList = formLibrariesApi.getFormLibraryForms( 26 | accountId, 27 | formLibrarySummary.getFormsLibraryId()); 28 | forms.addAll(formSummaryList.getForms()); 29 | counter += formSummaryList.getForms().size(); 30 | 31 | if (counter >= 3) { 32 | break; 33 | } 34 | } 35 | 36 | return forms; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/GetRoomsWithFiltersService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.RoomsApi; 4 | import com.docusign.rooms.client.ApiException; 5 | import com.docusign.rooms.model.RoomSummaryList; 6 | 7 | public final class GetRoomsWithFiltersService { 8 | public static RoomSummaryList getRoomsWithFilters( 9 | RoomsApi roomsApi, 10 | String accountId, 11 | String startDate, 12 | String endDate 13 | ) throws ApiException { 14 | // Step 3. Prepare your request parameters 15 | //ds-snippet-start:Rooms5Step3 16 | RoomsApi.GetRoomsOptions options = roomsApi.new GetRoomsOptions(); 17 | options.setFieldDataChangedStartDate(startDate); 18 | options.setFieldDataChangedEndDate(endDate); 19 | //ds-snippet-end:Rooms5Step3 20 | 21 | //Call the v2 Rooms API 22 | return roomsApi.getRooms(accountId, options); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/controller/rooms/services/GrantOfficeAccessToFormGroupService.java: -------------------------------------------------------------------------------- 1 | package com.docusign.controller.rooms.services; 2 | 3 | import com.docusign.rooms.api.FormGroupsApi; 4 | import com.docusign.rooms.client.ApiException; 5 | 6 | import java.util.UUID; 7 | 8 | public final class GrantOfficeAccessToFormGroupService { 9 | public static void grantOfficeAccessToFormGroup( 10 | FormGroupsApi formGroupsApi, 11 | String accountId, 12 | UUID formGroupId, 13 | Integer officeId 14 | ) throws ApiException { 15 | formGroupsApi.grantOfficeAccessToFormGroup( 16 | accountId, 17 | formGroupId, 18 | officeId); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/common/DocumentType.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.common; 2 | 3 | import jakarta.ws.rs.core.MediaType; 4 | 5 | /** 6 | * This enumeration represents supported document types for signing. 7 | */ 8 | public enum DocumentType { 9 | HTML("html", MediaType.TEXT_HTML), 10 | DOCX("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"), 11 | PDF("pdf", "application/pdf"); 12 | 13 | private final String defaultFileExtention; 14 | 15 | private final String mime; 16 | 17 | DocumentType(String defaultFileExtention, String mime) { 18 | this.defaultFileExtention = defaultFileExtention; 19 | this.mime = mime; 20 | } 21 | 22 | public String getDefaultFileExtention() { 23 | return defaultFileExtention; 24 | } 25 | 26 | public String getMime() { 27 | return mime; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/exception/LauncherException.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.exception; 2 | 3 | public class LauncherException extends Exception { 4 | 5 | private static final long serialVersionUID = -609744571799853289L; 6 | 7 | public LauncherException(String message) { 8 | super(message); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/AccountRoleSettingsPatch.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model; 2 | 3 | import com.docusign.esign.model.AccountRoleSettings; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | public class AccountRoleSettingsPatch extends AccountRoleSettings { 7 | 8 | @JsonProperty("signingUiVersion") 9 | private String signingUiVersion = ""; 10 | 11 | public AccountRoleSettings signingUiVersion(String signingUiVersion) { 12 | this.signingUiVersion = signingUiVersion; 13 | return this; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/ApiTypeItem.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model; 2 | 3 | import java.util.EnumSet; 4 | import java.util.List; 5 | import java.util.stream.Collectors; 6 | 7 | public class ApiTypeItem { 8 | 9 | private String key; 10 | 11 | private String value; 12 | 13 | public ApiTypeItem(String key, String value) { 14 | this.key = key; 15 | this.value = value; 16 | } 17 | 18 | public static ApiTypeItem convert(ApiType apiType) { 19 | return new ApiTypeItem(apiType.name(), apiType.value); 20 | } 21 | 22 | public static ApiType convert(ApiTypeItem apiType) { 23 | return ApiType.valueOf(apiType.key); 24 | } 25 | 26 | public static List list() { 27 | return EnumSet.allOf(ApiType.class).stream() 28 | .map(ApiTypeItem::convert) 29 | .collect(Collectors.toList()); 30 | } 31 | 32 | public String getKey() { 33 | return key; 34 | } 35 | 36 | public void setKey(String key) { 37 | this.key = key; 38 | } 39 | 40 | public String getValue() { 41 | return value; 42 | } 43 | 44 | public void setValue(String value) { 45 | this.value = value; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/AuthType.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model; 2 | 3 | public enum AuthType { 4 | //Authorization Code Grant 5 | AGC("Authorization Code Grant"), 6 | //JWT Code Grant 7 | JWT("JSON Web Token Grant"); 8 | 9 | final String value; 10 | 11 | AuthType(String value) { 12 | this.value = value; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/AuthTypeItem.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model; 2 | 3 | import java.util.EnumSet; 4 | import java.util.List; 5 | import java.util.stream.Collectors; 6 | 7 | public class AuthTypeItem { 8 | 9 | private String key; 10 | 11 | private String value; 12 | 13 | public AuthTypeItem(String key, String value) { 14 | this.key = key; 15 | this.value = value; 16 | } 17 | 18 | public static AuthTypeItem convert(AuthType authType) { 19 | return new AuthTypeItem(authType.name(), authType.value); 20 | } 21 | 22 | public static AuthType convert(AuthTypeItem authType) { 23 | return AuthType.valueOf(authType.key); 24 | } 25 | 26 | public static List list() { 27 | return EnumSet.allOf(AuthType.class).stream() 28 | .map(AuthTypeItem::convert) 29 | .collect(Collectors.toList()); 30 | } 31 | 32 | public String getKey() { 33 | return key; 34 | } 35 | 36 | public void setKey(String key) { 37 | this.key = key; 38 | } 39 | 40 | public String getValue() { 41 | return value; 42 | } 43 | 44 | public void setValue(String value) { 45 | this.value = value; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/EnvelopeDocumentInfo.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model; 2 | 3 | import lombok.Value; 4 | 5 | import java.io.Serializable; 6 | 7 | 8 | @Value 9 | public class EnvelopeDocumentInfo implements Serializable { 10 | private static final long serialVersionUID = 8423772017910727550L; 11 | 12 | private String name; 13 | 14 | private String type; 15 | 16 | private String documentId; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/Locals.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model; 2 | 3 | import com.docusign.DSConfiguration; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | public class Locals { 10 | private DSConfiguration dsConfig; 11 | 12 | private Session session; 13 | 14 | private User user; 15 | 16 | private String messages; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/OptionItem.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | 7 | @Data 8 | @AllArgsConstructor 9 | public class OptionItem { 10 | private String text; 11 | 12 | private String documentId; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/Session.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model; 2 | 3 | import com.docusign.esign.client.auth.OAuth; 4 | import lombok.Data; 5 | import org.springframework.context.annotation.Scope; 6 | import org.springframework.context.annotation.ScopedProxyMode; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.web.context.WebApplicationContext; 9 | 10 | import java.io.Serializable; 11 | import java.util.List; 12 | import java.util.UUID; 13 | 14 | @Component 15 | @Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.TARGET_CLASS) 16 | @Data 17 | public class Session implements Serializable { 18 | private static final long serialVersionUID = 2695379118371574037L; 19 | 20 | public UUID bulkListId; 21 | 22 | public Long tokenExpirationTime; 23 | 24 | private String accountId; 25 | 26 | private String createdUserId; 27 | 28 | private String accountName; 29 | 30 | private String basePath; 31 | 32 | private String roomsBasePath; 33 | 34 | private String envelopeId; 35 | 36 | private String templateId; 37 | 38 | private String templateName; 39 | 40 | private String statusCFR; 41 | 42 | private List envelopeDocuments; 43 | 44 | private String permissionProfileId; 45 | 46 | private String permissionProfileName; 47 | 48 | private String apiIndexPath; 49 | 50 | private AuthType authTypeSelected = AuthType.AGC; 51 | 52 | private boolean refreshToken; 53 | 54 | private String clickwrapId; 55 | 56 | private String clickwrapVersionNumber; 57 | 58 | private String exportId; 59 | 60 | private String importId; 61 | 62 | private String webformTemplateId; 63 | 64 | private String emailAddress; 65 | 66 | private UUID orgId; 67 | 68 | private OAuth.Account oauthAccount; 69 | 70 | private String monitorExampleRedirect; 71 | 72 | private String workflowId; 73 | 74 | private String extensionApps; 75 | 76 | private String instanceId; 77 | 78 | private Boolean isPKCEWorking = true; 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/User.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model; 2 | 3 | import lombok.Data; 4 | import org.springframework.context.annotation.Scope; 5 | import org.springframework.context.annotation.ScopedProxyMode; 6 | import org.springframework.stereotype.Component; 7 | import org.springframework.web.context.WebApplicationContext; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | @Component 13 | @Scope(value = WebApplicationContext.SCOPE_SESSION, 14 | proxyMode = ScopedProxyMode.TARGET_CLASS) 15 | @Data 16 | public class User implements Serializable { 17 | private static final long serialVersionUID = 8959083682339598499L; 18 | 19 | private String name; 20 | 21 | private String accessToken; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/APIs.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | @Getter 10 | @Setter 11 | public class APIs { 12 | public String Name; 13 | 14 | public List Groups = new ArrayList(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/AdditionalPage.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class AdditionalPage { 9 | public String Name; 10 | 11 | public String ResultsPageText; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/CodeExampleText.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | @Getter 10 | @Setter 11 | public class CodeExampleText { 12 | public int ExampleNumber; 13 | 14 | public String ExampleName; 15 | 16 | public String CFREnabled; 17 | 18 | public String ExampleDescription; 19 | 20 | public String Notes; 21 | 22 | public String ResultsPageText; 23 | 24 | public String SkipForLanguages; 25 | 26 | public List LinksToAPIMethod = new ArrayList<>(); 27 | 28 | public List CustomErrorTexts = new ArrayList<>(); 29 | 30 | public List RedirectsToOtherCodeExamples = new ArrayList<>(); 31 | 32 | public List Forms = new ArrayList<>(); 33 | 34 | public List AdditionalPage = new ArrayList<>(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/CustomErrorTexts.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class CustomErrorTexts { 9 | public String ErrorMessageCheck; 10 | 11 | public String ErrorMessage; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/Forms.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | @Getter 10 | @Setter 11 | public class Forms { 12 | public String FormName; 13 | 14 | public List Inputs = new ArrayList<>(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/HelpingTexts.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class HelpingTexts { 9 | public String EmailWontBeShared; 10 | 11 | public String SaveAgentActivationCode; 12 | 13 | public String PhoneNumberWontBeShared; 14 | 15 | public String CCEmailShouldDifferFromSigner; 16 | 17 | public String AccessCodeText; 18 | 19 | public String CountryCodeText; 20 | 21 | public String ChooseDateInTheFuture; 22 | 23 | public String PhoneNumberWillBeNotified; 24 | 25 | public String EmailAddressOfUserToDelete; 26 | 27 | public String UserIDOfUserToDelete; 28 | 29 | public String DynamicContentValue; 30 | 31 | public String DynamicContentNote; 32 | 33 | public String EmbedClickwrapURL; 34 | 35 | public String NOTAGREED; 36 | 37 | public String AGREED; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/Inputs.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class Inputs { 9 | public String InputName; 10 | 11 | public String InputPlaceholder; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/LinkToAPIMethods.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class LinkToAPIMethods { 9 | public String Path; 10 | 11 | public String PathName; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/LoginPage.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class LoginPage { 9 | public String LoginHeader; 10 | 11 | public String LoginButton; 12 | 13 | public String LoginHelperText; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/ManifestGroup.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | @Getter 10 | @Setter 11 | public class ManifestGroup { 12 | public List Examples = new ArrayList<>(); 13 | 14 | public String Name; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/ManifestStructure.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | @Getter 10 | @Setter 11 | public class ManifestStructure { 12 | public SupportingTexts SupportingTexts; 13 | 14 | public List APIs = new ArrayList(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/RedirectsToOtherCodeExamples.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class RedirectsToOtherCodeExamples { 9 | public Integer CodeExampleToRedirectTo; 10 | 11 | public String RedirectText; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/SelectAPIPage.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class SelectAPIPage { 9 | public String SelectAPIHeader; 10 | 11 | public String SelectAPIButton; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/model/manifestModels/SupportingTexts.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.model.manifestModels; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class SupportingTexts { 9 | public String HomePageText; 10 | 11 | public String ContactSupportToEnableFeature; 12 | 13 | public String ViewSourceFile; 14 | 15 | public String APIMethodUsed; 16 | 17 | public String APIMethodUsedPlural; 18 | 19 | public String SubmitButton; 20 | 21 | public String ContinueButton; 22 | 23 | public String HomeButton; 24 | 25 | public String LoginButton; 26 | 27 | public String LogoutButton; 28 | 29 | public String SearchFailed; 30 | 31 | public String ChangeAPITypeButton; 32 | 33 | public String WelcomeText; 34 | 35 | public String CFRError; 36 | 37 | public String IdenticalEmailsNotAllowedErrorMessage; 38 | 39 | public LoginPage LoginPage; 40 | 41 | public SelectAPIPage SelectAPIPage; 42 | 43 | public HelpingTexts HelpingTexts; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/security/CustomAuthenticationFailureHandler.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.security; 2 | 3 | import org.springframework.security.core.AuthenticationException; 4 | import org.springframework.security.web.authentication.AuthenticationFailureHandler; 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | import java.io.IOException; 9 | 10 | public class CustomAuthenticationFailureHandler implements AuthenticationFailureHandler { 11 | 12 | @Override 13 | public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, 14 | AuthenticationException exception) throws IOException, ServletException { 15 | String code = request.getParameter("code"); 16 | String state = request.getParameter("state"); 17 | 18 | if (code != null) { 19 | response.sendRedirect("/pkce?code=" + code + "&state=" + state); 20 | } else { 21 | response.sendRedirect("/login?error=true"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/utils/AccountsConverter.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.utils; 2 | 3 | import com.docusign.esign.client.auth.OAuth; 4 | 5 | import java.util.LinkedHashMap; 6 | import java.util.Map; 7 | 8 | public final class AccountsConverter { 9 | 10 | public static Map convert(OAuth.Account account) { 11 | Map res = new LinkedHashMap<>(); 12 | res.put("account_id", account.getAccountId()); 13 | res.put("is_default", account.getIsDefault()); 14 | res.put("account_name", account.getAccountName()); 15 | res.put("base_uri", account.getBaseUri()); 16 | return res; 17 | } 18 | 19 | public static OAuth.Account convert(Map account) { 20 | OAuth.Account res = new OAuth.Account(); 21 | res.setAccountId((String) account.get("account_id")); 22 | res.setIsDefault(String.valueOf(account.get("is_default"))); 23 | res.setAccountName((String) account.get("account_name")); 24 | res.setBaseUri((String) account.get("base_uri")); 25 | return res; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/utils/DateUtils.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.utils; 2 | 3 | import java.time.format.DateTimeFormatter; 4 | 5 | public class DateUtils { 6 | public static final DateTimeFormatter DATE_WITH_SLASH = DateTimeFormatter.ofPattern("yyyy/MM/dd"); 7 | 8 | public static final DateTimeFormatter DATE_WITH_LINES = DateTimeFormatter.ofPattern("yyyy-MM-dd"); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/core/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.docusign.core.utils; 2 | 3 | import org.springframework.util.StreamUtils; 4 | 5 | import java.io.FileNotFoundException; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | 9 | public class FileUtils { 10 | /** 11 | * Loads a file content and copy it into a byte array. 12 | * 13 | * @param path the absolute path within the class path 14 | * @return the new byte array that has been loaded from the file 15 | * @throws IOException in case of I/O errors 16 | */ 17 | public byte[] readFile(String path) throws IOException { 18 | InputStream inputStream = getClass().getClassLoader().getResourceAsStream(path); 19 | if (inputStream == null) { 20 | throw new FileNotFoundException("File not found: " + path); 21 | } 22 | 23 | return StreamUtils.copyToByteArray(inputStream); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.env.PropertySourceLoader=\ 2 | com.docusign.JsonPropertySourceLoader -------------------------------------------------------------------------------- /src/main/resources/Offer_Letter_Dynamic_Table.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/src/main/resources/Offer_Letter_Dynamic_Table.docx -------------------------------------------------------------------------------- /src/main/resources/TermsOfService.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/src/main/resources/TermsOfService.pdf -------------------------------------------------------------------------------- /src/main/resources/Welcome.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome to the DocuSign Recruiting Event 6 | 7 | 8 | Please Sign in! 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/Welcome1.txt: -------------------------------------------------------------------------------- 1 | Thanks for reviewing this! 2 | 3 | We'll move forward as soon as we hear back. -------------------------------------------------------------------------------- /src/main/resources/World_Wide_Corp_Battle_Plan_Trafalgar.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/src/main/resources/World_Wide_Corp_Battle_Plan_Trafalgar.docx -------------------------------------------------------------------------------- /src/main/resources/World_Wide_Corp_Web_Form.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/src/main/resources/World_Wide_Corp_Web_Form.pdf -------------------------------------------------------------------------------- /src/main/resources/World_Wide_Corp_fields.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/src/main/resources/World_Wide_Corp_fields.pdf -------------------------------------------------------------------------------- /src/main/resources/World_Wide_Corp_fields_shown.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/src/main/resources/World_Wide_Corp_fields_shown.docx -------------------------------------------------------------------------------- /src/main/resources/World_Wide_Corp_lorem.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/src/main/resources/World_Wide_Corp_lorem.pdf -------------------------------------------------------------------------------- /src/main/resources/World_Wide_Corp_salary.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/src/main/resources/World_Wide_Corp_salary.docx -------------------------------------------------------------------------------- /src/main/resources/doc_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

World Wide Corp

9 |

Order Processing Division

12 |

Ordered by {USER_FULLNAME}

13 |

Email: {USER_EMAIL}

14 |

Copy to: {CC_NAME}, {CC_EMAIL}

15 |

16 | Candy bonbon pastry jujubes lollipop wafer biscuit biscuit. Topping brownie sesame snaps sweet roll pie. Croissant danish biscuit soufflé caramels jujubes jelly. Dragée danish caramels lemon drops dragée. Gummi bears cupcake biscuit tiramisu sugar plum pastry. Dragée gummies applicake pudding liquorice. Donut jujubes oat cake jelly-o. Dessert bear claw chocolate cake gummies lollipop sugar plum ice cream gummies cheesecake. 17 |

18 | 19 |

Agreed: **signature_1**/

20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/resources/log4jdbc.log4j2.properties: -------------------------------------------------------------------------------- 1 | log4jdbc.dump.sql.maxlinelength=0 2 | log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator -------------------------------------------------------------------------------- /src/main/resources/public/assets/banner-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/src/main/resources/public/assets/banner-code.png -------------------------------------------------------------------------------- /src/main/resources/public/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/code-examples-java/cf83a8e52d9ca3d361da13ca600e8739e124884d/src/main/resources/public/assets/favicon.png -------------------------------------------------------------------------------- /src/main/resources/public/assets/render.js: -------------------------------------------------------------------------------- 1 | // var templates = {}; 2 | // 3 | // function render(template, model, url) { 4 | // var compiledTemplate; 5 | // if (templates[url] === undefined) { 6 | // compiledTemplate = ejs.compile(template); 7 | // templates[url] = compiledTemplate; 8 | // } 9 | // else { 10 | // compiledTemplate = templates[url]; 11 | // } 12 | // return compiledTemplate(toJsonObject(model)); 13 | // } 14 | // 15 | // // Create a real JSON object from the model Map
 16 | // function toJsonObject(model) { 17 | // var o = {}; 18 | // for (var k in model) { 19 | // // Convert Iterable like List to real JSON array 20 | // if (model[k] instanceof Java.type("java.lang.Iterable")) { 21 | // o[k] = Java.from(model[k]); 22 | // } 23 | // else { 24 | // o[k] = model[k]; 25 | // } 26 | // } 27 | // return o; 28 | // } 29 | 30 | function render(template, model) { 31 | 32 | // Create a real Javascript Object from the model Map 33 | var data = {}; 34 | for (var k in model) { 35 | // Convert Java Iterable and List to real Javascript arrays 36 | if (model[k] instanceof Java.type("java.lang.Iterable")) { 37 | data[k] = Java.from(model[k]); 38 | } else { 39 | data[k] = model[k]; 40 | } 41 | } 42 | return new EJS({text: template}).render(data); 43 | } -------------------------------------------------------------------------------- /src/main/resources/public/assets/site.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | $("#Products").on("change", function () { 3 | $list = $("#PermissionProfilesFiltered"); 4 | $.ajax({ 5 | url: "/a008/getPermissionProfiles", 6 | type: "GET", 7 | data: { productId: $("#Products").val() }, 8 | traditional: true, 9 | dataType: "json", 10 | success: function (result) { 11 | console.log(result) 12 | $list.empty(); 13 | $.each(result, function (i, item) { 14 | console.log(item) 15 | $list.append(''); 16 | }); 17 | }, 18 | error: function () { 19 | console.warn("Issues with calling the getPermissionProfiles endpoint. Please, check the solution."); 20 | } 21 | }); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/main/resources/templates/candy-bonbon.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

World Wide Corp

8 |

Order Processing Division

9 |

Ordered by ${args.signerName}

10 |

Email: ${args.signerEmail}

11 |

Copy to: ${args.ccName}, ${args.ccEmail}

12 |

13 | Candy bonbon pastry jujubes lollipop wafer biscuit biscuit. Topping brownie sesame snaps sweet roll pie. 14 | Croissant danish biscuit soufflé caramels jujubes jelly. Dragée danish caramels lemon drops dragée. 15 | Gummi bears cupcake biscuit tiramisu sugar plum pastry. Dragée gummies applicake pudding liquorice. 16 | Donut jujubes oat cake jelly-o. Dessert bear claw chocolate cake gummies lollipop sugar plum ice 17 | cream gummies cheesecake.

18 | 19 |

Agreed: **signature_1**

20 | 21 | " -------------------------------------------------------------------------------- /src/main/resources/templates/candy-bonbon2.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

World Wide Corp

8 |

Order Processing Division

9 |

Ordered by ${args.signerName}

10 |

Email: ${args.signerEmail}

11 |

Copy to: ${args.ccName}, ${args.ccEmail}

12 |

Item: ${args.item}, quantity: ${args.quantity} at market price.

13 |

14 | Candy bonbon pastry jujubes lollipop wafer biscuit biscuit. Topping brownie sesame snaps sweet roll pie. 15 | Croissant danish biscuit soufflé caramels jujubes jelly. Dragée danish caramels lemon drops dragée. 16 | Gummi bears cupcake biscuit tiramisu sugar plum pastry. Dragée gummies applicake pudding liquorice. 17 | Donut jujubes oat cake jelly-o. Dessert bear claw chocolate cake gummies lollipop sugar plum ice 18 | cream gummies cheesecake.

19 | 20 |

Agreed: **signature_1**

21 | 22 | " -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/error.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 3 | 4 | 5 | <%-- Used for consent redirect sequence --%> 6 | 7 | 8 | <%-- using ' ' instead of ':' to prevent issue with delimiter and redirect url --%> 9 | 10 | 11 | 12 | 13 | 14 |

Problem: an error occurred

15 | 16 |

Error information:

17 |

Message: ${done.message}

18 |

${done.fixingInstructions}

19 |
20 | 21 |

Oops, we have encountered a problem.

22 |

Message: ${done.message}

23 |

Dump: ${done.stackTracePrinted}

24 | 25 |

Please check your account configuration. If you are unable to resolve the problem, open a new issue on GitHub.

26 |
27 | 28 |

${launcherTexts.getContinueButton()}

29 | 30 | 31 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/admin/examples/a003.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 |

3. ${example.getExampleName()}

5 |

${example.getExampleDescription()}

6 | 7 |

Documentation about this example.

8 |
9 | 10 | 11 | 12 |

13 | ${viewSourceFile} 14 |

15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/admin/examples/a003a.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 |

3a. ${example.getExampleName()}

5 |

${example.getAdditionalPage().get(0).getResultsPageText()}

6 | 7 |

Documentation about this example.

8 |
9 | 10 | 11 | 12 |

13 | ${viewSourceFile} 14 |

15 | 16 | 17 | 18 |
19 | 20 | 21 |
22 |
23 | 24 |

25 | Problem: please first bulk export user data using Send an envelope with a remote (email) signer and cc recipient..
26 | Thank you. 27 |

28 |
29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/admin/examples/a004.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 |

4. ${example.getExampleName()}

5 |

${example.getExampleDescription()}

6 | 7 |

Documentation about this example.

8 |
9 | 10 | 11 | 12 |

13 | ${viewSourceFile} 14 |

15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/admin/examples/a004a.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 |

4a. ${example.getExampleName()}

5 |

${example.getAdditionalPage().get(0).getResultsPageText()}

6 | 7 |

Documentation about this example.

8 |
9 | 10 | 11 | 12 |

13 | ${viewSourceFile} 14 |

15 | 16 | 17 | 18 |
19 | 20 | 21 |
22 |
23 | 24 |

25 | Problem: please first bulk import user data example 4.
26 | Thank you. 27 |

28 |
29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/admin/examples/a005.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 | 5 |

5. ${example.getExampleName()}

6 |

${example.getExampleDescription()}

7 | 8 | 9 | 10 |

Documentation about this example.

11 |
12 | 13 | 14 | 15 |

16 | ${viewSourceFile} 17 |

18 | 19 |
20 | 21 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/admin/examples/a006.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 | 5 | 6 | 7 |

6. ${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 | 10 |

Documentation about this example.

11 |
12 | 13 | 14 | 15 |

16 | ${viewSourceFile} 17 |

18 | 19 |
20 |
21 | 24 | 25 | 31 | 32 | 33 | ${launcherTexts.getHelpingTexts().getEmailWontBeShared()} 34 | 35 | 36 |
37 | 38 | 39 |
40 |
41 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/admin/examples/a007.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 | 5 | 6 | 7 |

7. ${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 | 10 | 11 |

Documentation about this example.

12 |
13 | 14 | 15 | 16 |

17 | ${viewSourceFile} 18 |

19 | 20 |
21 |
22 | 25 | 26 | 33 | 34 |
35 | 36 | 37 |
38 |
39 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/admin/examples/a009.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

9. ${example.getExampleName()}

10 |

${example.getExampleDescription()}

11 | 12 | 13 |

Documentation about this example.

14 |
15 | 16 | 17 | 18 |

19 | ${viewSourceFile} 20 |

21 | 22 | 23 | 24 |

${example.getForms().get(formNumber).getFormName().replaceFirst("\\{0}", emailAddress)}

25 | 26 |
27 |
28 | 31 | 32 | 37 |
38 | 39 | 40 | 41 |
42 |
43 | 44 |

45 | ${example.getRedirectsToOtherCodeExamples().get(redirectNumber).getRedirectText().replaceFirst("\\{0}", redirectToSecondCodeExample)} 46 |

47 |
48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/admin/examples/a010.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 | 5 | 6 | 7 |

10. ${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 | 10 | 11 |

Documentation about this example.

12 |
13 | 14 | 15 | 16 |

17 | ${viewSourceFile} 18 |

19 | 20 |
21 |
22 | 25 | 26 | 29 | 30 | 31 | ${launcherTexts.getHelpingTexts().getEmailAddressOfUserToDelete()} 32 | 33 |
34 | 35 | 36 | 37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/admin/examples/a011.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 | 5 | 6 | 7 |

11. ${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 | 10 | 11 |

Documentation about this example.

12 |
13 | 14 | 15 | 16 |

17 | ${viewSourceFile} 18 |

19 | 20 |
21 |
22 | 25 | 26 | 30 | 31 | 32 | ${launcherTexts.getHelpingTexts().getUserIDOfUserToDelete()} 33 | 34 |
35 | 36 | 37 | 38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/click/examples/c001.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 |

${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 | 10 |

11 | ${viewSourceFile} 12 |

13 | 14 |
15 |
16 | 19 | 20 | 26 |
27 | 28 | 29 |
30 | 31 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/click/examples/c002.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

${example.getExampleName()}

10 |

${example.getExampleDescription()}

11 | 12 | 13 |

14 | ${viewSourceFile} 15 |

16 | 17 | 18 | 19 |

${example.getForms().get(formNumber).getFormName()}

20 |
21 |
22 | 25 | 26 | 31 |
32 | 33 | 34 |
35 |
36 | 37 |

38 | ${example.getRedirectsToOtherCodeExamples().get(redirectNumber).getRedirectText().replaceFirst("\\{0}", redirectToFirstCodeExample)} 39 |

40 |
41 |
42 | 43 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/click/examples/c004.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |

${example.getExampleName()}

5 |

${example.getExampleDescription()}

6 | 7 | 8 |

9 | ${viewSourceFile} 10 |

11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/click/examples/c005.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

${example.getExampleName()}

10 |

${example.getExampleDescription()}

11 | 12 | 13 |

14 | ${viewSourceFile} 15 |

16 | 17 | 18 | 19 |

${example.getForms().get(formNumber).getFormName()}

20 |
21 |
22 | 25 | 26 | 31 |
32 | 33 | 34 |
35 |
36 | 37 |

38 | ${example.getRedirectsToOtherCodeExamples().get(redirectNumber).getRedirectText().replaceFirst("\\{0}", redirectToFirstCodeExample)} 39 |

40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/connect/examples/con001.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 |

Documentation about this example.

12 |
13 | 14 | 15 | 16 |

17 | ${viewSourceFile} 18 |

19 | 20 |

21 | Prerequisites: See How to validate a webhook message using HMAC. 22 |

23 | 24 |
25 |
26 | 29 | 30 | 35 |
36 |
37 | 40 | 41 | 47 |
48 | 49 | 50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/ds_must_authenticate.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |
5 | ${launcherTexts.getLoginPage().getLoginHeader()} 6 |
7 |
8 | 13 |
14 |

15 | 16 |

17 | 18 |
19 |
20 |

${launcherTexts.getLoginPage().getLoginHelperText()}

21 |
22 | 23 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/ds_restart.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |
5 |
6 |

Please restart the app to finish switching to a new API.

7 |

8 | Quit the current app with Control + C, then run 9 | mvn package followed by 10 | java -Dspring.profiles.active=dev -jar target/code-examples-java-1.0-SNAPSHOT.war 11 | again or rerun it using the Run button in IntelliJ Ultimate or Eclipse. 12 |

13 | 14 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/ds_return.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |

Returned data from Docusign!

5 |

Data:

6 | 7 | 8 |

event: ${event}. This event parameter is supplied by Docusign via the redirect URL. 9 | Since it could have been spoofed, don't make business decisions based on 10 | its value. Instead, query DocuSign as appropriate.

11 |
12 | 13 | 14 |

envelopeId: ${qpEnvelopeId}. The envelopeId parameter is supplied by Docusign.

15 |
16 | 17 | 18 |

state: ${state}. This example state was sent to DocuSign and has now been received back. 19 | It is usually better to store state in your web framework's session.

20 |
21 | 22 | 23 |

${launcherTexts.getContinueButton()}

24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg003.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |

${example.getExampleName()}

5 |

${example.getExampleDescription()}

6 | 7 |

Documentation about this example.

8 |
9 | 10 | 11 | 12 |

13 | ${viewSourceFile} 14 |

15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg004.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 | 12 |

Documentation about this example.

13 |
14 | 15 | 16 | 17 | 18 |

19 | ${viewSourceFile} 20 |

21 | 22 | 23 | 24 |

25 | ${example.getForms().get(formNumber).getFormName()} 26 |

27 | 28 |
29 | 30 | 31 |
32 |
33 | 34 |

${example.getRedirectsToOtherCodeExamples().get(redirectNumber).getRedirectText().replaceFirst("\\{0}", redirectToSecondCodeExample)}

35 | 36 |
37 | 38 |
39 |
40 |
41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg005.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 | 12 |

Documentation about this example.

13 |
14 | 15 | 16 | 17 |

18 | ${viewSourceFile} 19 |

20 | 21 | 22 | 23 |

24 | ${example.getForms().get(formNumber).getFormName()} 25 |

26 | 27 |
28 | 29 | 30 |
31 |
32 | 33 |

${example.getRedirectsToOtherCodeExamples().get(redirectNumber).getRedirectText().replaceFirst("\\{0}", redirectToSecondCodeExample)}

34 | 35 |
36 | 37 |
38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg006.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 |

Documentation about this example.

12 |
13 | 14 | 15 | 16 | 17 |

18 | ${viewSourceFile} 19 |

20 | 21 | 22 | 23 |

24 | ${example.getForms().get(formNumber).getFormName()} 25 |

26 | 27 |
28 | 29 | 30 |
31 |
32 | 33 |

${example.getRedirectsToOtherCodeExamples().get(redirectNumber).getRedirectText().replaceFirst("\\{0}", redirectToSecondCodeExample)}

34 | 35 |
36 | 37 |
38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg008.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |

${example.getExampleName()}

5 |

${example.getExampleDescription()}

6 | 7 |

Documentation about this example.

8 |
9 | 10 | 11 | 12 | 13 |

14 | ${viewSourceFile} 15 |

16 | 17 |
18 | 19 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg012.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

${example.getExampleName()}

10 |

${example.getExampleDescription()}

11 | 12 | 13 |

Documentation about this example.

14 |
15 | 16 | 17 | 18 | 19 |

20 | ${viewSourceFile} 21 |

22 | 23 |

${example.getRedirectsToOtherCodeExamples().get(redirectNumber).getRedirectText().replaceFirst("\\{0}", redirectToSecondCodeExample)}

24 |
25 | 26 | 27 |
28 |
29 | 32 | 33 | 39 |
40 | 41 | 42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg015.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 | 12 |

Documentation about this example.

13 |
14 | 15 | 16 | 17 |

18 | ${viewSourceFile} 19 |

20 | 21 | 22 | 23 |

${example.getForms().get(formNumber).getFormName()}

24 | 25 |
26 | 27 | 28 |
29 |
30 | 31 |

${example.getRedirectsToOtherCodeExamples().get(redirectNumber).getRedirectText().replaceFirst("\\{0}", redirectToNinthCodeExample)}

32 | 33 |
34 | 35 |
36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg018.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 | 12 |

Documentation about this example.

13 |
14 | 15 | 16 | 17 |

18 | ${viewSourceFile} 19 |

20 | 21 | 22 | 23 |

24 | ${example.getForms().get(formNumber).getFormName().replaceFirst("\\{0}", redirectTo16CodeExample)} 25 |

26 |
27 | 28 | 29 |
30 |
31 | 32 |

${example.getRedirectsToOtherCodeExamples().get(redirectNumber).getRedirectText().replaceFirst("\\{0}", redirectTo16CodeExample)}

33 | 34 |
35 | 36 |
37 |
38 |
39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg022.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 | 12 |

Documentation about this example.

13 |
14 | 15 | 16 | 17 |

18 | ${viewSourceFile} 19 |

20 | 21 | 22 |
23 |
24 | 27 | 28 | 35 | 36 | 37 | ${launcherTexts.getHelpingTexts().getEmailWontBeShared()} 38 | 39 |
40 |
41 | 44 | 45 | 51 |
52 | 53 | 54 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg023.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 | 12 |

Documentation about this example.

13 |
14 | 15 | 16 | 17 |

18 | ${viewSourceFile} 19 |

20 | 21 |
22 |
23 | 26 | 27 | 34 | 35 | 36 | ${launcherTexts.getHelpingTexts().getEmailWontBeShared()} 37 | 38 |
39 |
40 | 43 | 44 | 50 |
51 | 52 | 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg024.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 |

${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 | 10 | 11 |

Documentation about this example.

12 |
13 | 14 | 15 | 16 |

17 | ${viewSourceFile} 18 |

19 | 20 | 21 |
22 |
23 | 26 | 27 | 34 |
35 | 36 | 37 |
38 | 39 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg025.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 | 12 |

Documentation about this example.

13 |
14 | 15 | 16 | 17 |

18 | ${viewSourceFile} 19 |

20 | 21 | 22 |
23 |
24 | 27 | 28 | 33 |
34 | 35 |
36 | 39 | 40 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg026.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 |

${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 | 10 | 11 |

Documentation about this example.

12 |
13 | 14 | 15 | 16 |

17 | ${viewSourceFile} 18 |

19 | 20 | 21 |
22 |
23 | 26 | 27 | 34 |
35 | 36 | 37 | 38 |
39 | 40 | 49 | 50 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg027.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 |

${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 |

${example.getNotes()}

10 | 11 | 12 |

Documentation about this example.

13 |
14 | 15 | 16 | 17 |

18 | ${viewSourceFile} 19 |

20 | 21 | 22 |
23 |
24 | 27 | 28 | 33 |
34 | 35 | 36 | 37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg028.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 | 12 |

Documentation about this example.

13 |
14 | 15 | 16 | 17 |

18 | ${viewSourceFile} 19 |

20 | 21 | 22 |
23 |

24 | ${example.getForms().get(formNumber).getFormName()} 25 |

26 |
27 | 30 | 31 | 38 |
39 |
40 | 43 | 44 | 49 |
50 | 51 | 52 |
53 | 54 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg033.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |

${example.getExampleName()}

5 |

${example.getExampleDescription()}

6 | 7 | 8 |

Documentation about this example.

9 |
10 | 11 | 12 | 13 |

14 | ${viewSourceFile} 15 |

16 | 17 | 18 |
19 | 20 | 21 |
22 | 23 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg039.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 |

${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 | 10 |

Documentation about this example.

11 |
12 | 13 | 14 | 15 |

16 | ${viewSourceFile} 17 |

18 | 19 |
20 |
21 | 24 | 25 | 31 |
32 | 33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/example_done.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |

${done.name}

5 |

${done.message}

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

16 | ${formattedJson} 17 |

18 |
19 | 20 |

21 |

${done.json}
22 |

23 |
24 |
25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 | 41 |
42 |
43 | 44 | 45 | 46 |

${launcherTexts.getContinueButton()}

47 |
48 | 49 |

${launcherTexts.getContinueButton()}

50 |
51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/example_done_compare.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |

${done.name}

5 |

${done.message}

6 | 7 | 8 |
Changed fields
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
Property nameOld valueNew value
${item.name}${item.leftValue}${item.rightValue}
24 |
25 | 26 |

${launcherTexts.getContinueButton()}

27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/example_pending.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |

${done.name}

5 |

${done.message}

6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/links_to_api_methods.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 |

4 | 5 | 6 | 7 | ${launcherTexts.getAPIMethodUsed()} 8 | 9 | 10 | ${launcherTexts.getAPIMethodUsedPlural()} 11 | 12 | 13 | 14 | 15 | ${link.getPathName()} 16 | 17 | 18 | 19 | . 20 | 21 | 22 | and 23 | 24 | 25 | , 26 | 27 | 28 | 29 | 30 |

31 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/monitor/examples/m001.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 2 | 3 | 4 |

1. ${example.getExampleName()}

5 |

${example.getExampleDescription()}

6 | 7 |

Documentation about this example.

8 |
9 | 10 | 11 | 12 |

13 | ${viewSourceFile} 14 |

15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/monitor/examples/m002.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

2. ${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 |

12 | ${viewSourceFile} 13 |

14 | 15 |

16 | ${example.getForms().get(formNumber).getFormName()} 17 |

18 | 19 |
20 | 21 |
22 | 25 | 26 | 32 |
33 |
34 | 37 | 38 | 44 |
45 | 46 | 47 |
48 | 49 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/notary/examples/n004.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 | 11 |

Documentation about this example.

12 |
13 | 14 | 15 | 16 |

17 | ${viewSourceFile} 18 |

19 | 20 |
21 |
22 | 25 | 26 | 29 | 30 | 31 | ${launcherTexts.getHelpingTexts().getEmailWontBeShared()} 32 | 33 |
34 |
35 | 38 | 39 | 42 |
43 | 44 | 45 |
46 | 47 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/rooms/examples/r001.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 |

${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 | 10 |

11 | ${viewSourceFile} 12 |

13 | 14 | 15 |
16 |
17 | 20 | 21 | 27 |
28 | 29 | 30 |
31 | 32 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/rooms/examples/r003.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

${example.getExampleName()}

10 |

${example.getExampleDescription()}

11 |

12 | ${viewSourceFile} 13 |

14 | 15 | 16 | 17 | 18 |

19 | ${example.getRedirectsToOtherCodeExamples().get(redirectNumber).getRedirectText().replaceFirst("\\{0}", redirectToFirstCodeExample)} 20 |

21 |
22 | 23 |
24 |
25 | 28 | 29 | 34 |
35 | 36 | 37 |
38 |
39 |
40 | 41 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/rooms/examples/r005.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 |

${example.getExampleName()}

9 |

${example.getExampleDescription()}

10 |

11 | ${viewSourceFile} 12 |

13 | 14 | 15 |
16 | 17 |
18 | 21 | 22 | 28 |
29 |
30 | 33 | 34 | 40 |
41 | 42 | 43 | 44 |
45 | 46 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/rooms/examples/r007.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 |

${example.getExampleName()}

8 |

${example.getExampleDescription()}

9 |

10 | ${viewSourceFile} 11 |

12 | 13 | 14 |
15 |
16 | 19 | 20 | 26 |
27 | 28 | 29 |
30 | 31 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/pages/webforms/examples/web001.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 |

${example.getExampleName()}

5 | 6 | 7 |

${example.getExampleDescription()}

8 |

9 | API methods used: 10 | 11 | Templates::list 12 | , and 13 | 14 | Templates::create 15 | . 16 |

17 |

18 | ${viewSourceFile} 19 |

20 |
21 | 22 | 23 |
24 |
25 | 26 | 27 | 28 |

${page.getResultsPageText().replaceFirst("\\{0}", "src/main/resources")}

29 |
30 |
31 |
32 | 33 | 34 |
35 |
36 |
37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/templates/views/partials/foot.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 14 | 17 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
38 |   locals:
39 |             ${locals}
40 |   
41 |
42 | 43 | 44 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/test/java/tests/eSignature/CreateBrandTest.java: -------------------------------------------------------------------------------- 1 | package tests.eSignature; 2 | 3 | import com.docusign.controller.eSignature.services.CreateBrandService; 4 | import com.docusign.core.model.ApiType; 5 | import com.docusign.esign.api.AccountsApi; 6 | import com.docusign.esign.client.ApiClient; 7 | import com.docusign.esign.client.ApiException; 8 | import com.docusign.esign.model.BrandsResponse; 9 | import org.junit.jupiter.api.Assertions; 10 | import org.junit.jupiter.api.Test; 11 | import org.springframework.http.HttpHeaders; 12 | import tests.common.JWTLoginMethodTest; 13 | import tests.common.TestConfig; 14 | 15 | import java.io.IOException; 16 | import java.nio.charset.StandardCharsets; 17 | import java.util.Random; 18 | 19 | public final class CreateBrandTest { 20 | private static final String BEARER_AUTHENTICATION = "Bearer "; 21 | 22 | private static final String basePathAddition = "/restapi"; 23 | 24 | private final ApiClient apiClient; 25 | 26 | private final AccountsApi accountsApi; 27 | 28 | private final TestConfig testConfig; 29 | 30 | public CreateBrandTest() throws IOException { 31 | JWTLoginMethodTest.RequestJWTUserToken_CorrectInputValues_ReturnOAuthToken(ApiType.ESIGNATURE); 32 | this.testConfig = TestConfig.getInstance(); 33 | 34 | this.apiClient = new ApiClient(testConfig.getBasePath() + basePathAddition); 35 | apiClient.addDefaultHeader(HttpHeaders.AUTHORIZATION, BEARER_AUTHENTICATION + testConfig.getAccessToken()); 36 | this.accountsApi = new AccountsApi(apiClient); 37 | } 38 | 39 | @Test 40 | public void CreateBrand_CorrectInputValues_ReturnsBrandsResponse() throws ApiException { 41 | // Arrange 42 | byte[] array = new byte[8]; 43 | new Random().nextBytes(array); 44 | var brandName = new String(array, StandardCharsets.UTF_8); 45 | var defaultBrandLanguage = "en"; 46 | 47 | // Act 48 | BrandsResponse brand = CreateBrandService.createBrand( 49 | this.accountsApi, 50 | brandName, 51 | defaultBrandLanguage, 52 | testConfig.getAccountId()); 53 | 54 | // Assert 55 | Assertions.assertNotNull(brand); 56 | Assertions.assertNotNull(brand.getBrands()); 57 | } 58 | } 59 | --------------------------------------------------------------------------------