enhancementgood first issueintegrationnew-featurenew-integration
Metriche repository
- Star
- (1930 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Description
Add DocuSign integration to sync e-signature data including envelopes, signing events, templates, and document status into CORE.
Reference Implementations
Existing Integrations (use as templates)
integrations/github/- OAuth-based API integrationintegrations/linear/- Project management integrationintegrations/slack/- For reference
Required Files Structure
integrations/docusign/
├── src/
│ ├── index.ts # Main entry, OAuth spec
│ ├── schedule.ts # Sync logic
│ ├── utils.ts # DocuSign eSignature API utilities
│ ├── account-create.ts # OAuth setup
│ └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md
DocuSign eSignature REST API Integration
OAuth Setup
- Use OAuth 2.0 Authorization Code Grant flow
- Register app on DocuSign Developer Center (apps-d.docusign.com for sandbox)
- Authorization URL:
https://account-d.docusign.com/oauth/auth(sandbox) /https://account.docusign.com/oauth/auth(production) - Token URL:
https://account-d.docusign.com/oauth/token(sandbox) /https://account.docusign.com/oauth/token(production) - Required scopes:
signature,extended,impersonation(for JWT) - Also supports JWT Grant for server-to-server authentication
Key Endpoints
POST /v2.1/accounts/{accountId}/envelopes- Create and send envelopeGET /v2.1/accounts/{accountId}/envelopes- List envelopesGET /v2.1/accounts/{accountId}/envelopes/{envelopeId}- Get envelope detailsGET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/recipients- Get recipientsGET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents- Get documentsGET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/audit_events- Audit trailGET /v2.1/accounts/{accountId}/templates- List templatesGET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/notification- Notification settingsPOST /v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient- Embedded signing URL
Events to Track
- Envelopes - Envelope creation, sending, voiding, and completion
- Signing Events - Recipient viewed, signed, declined, or delegated
- Documents - Document uploads, downloads, and certificate of completion
- Templates - Template creation and usage
- Audit Trail - Complete audit history of envelope actions
- Notifications - Reminder and expiration events
Implementation Tasks
- Set up basic integration structure following
integrations/github/src/index.tspattern - Implement OAuth 2.0 flow in
account-create.ts(support both Auth Code and JWT Grant) - Create API utilities in
utils.tsfor envelopes, recipients, documents, and templates - Implement sync logic in
schedule.tsfor polling envelope status changes - Convert signing events to CORE activity format
- Add error handling and rate limiting
- Create integration documentation
- Add to
integrations/README.md
Technical Notes
- DocuSign has separate sandbox and production environments with different base URLs
- Supports both OAuth 2.0 Auth Code Grant (user-present) and JWT Grant (server-to-server)
- Quickstart available in 8 languages for fast bootstrapping
- Webhook/Connect feature available for real-time envelope status notifications
- Envelope status lifecycle: created -> sent -> delivered -> signed -> completed
- Consider using DocuSign Connect (webhooks) instead of polling for real-time updates
Resources
- DocuSign eSignature REST API
- API Reference
- eSignature REST API 101
- Quickstart Guide
- How-Tos & Code Examples
- DocuSign Developer Center
Labels
enhancement, integration, new-feature