Skip to content

Conversation

@neilberkman
Copy link
Owner

This adds support for passing custom headers through API calls, which is required for certain DocuSign operations like working with locked envelopes.

The DocuSign API requires the X-DocuSign-Edit header with a lockToken when performing PUT operations on locked envelopes, but there was no way to pass this header through the generated API code.

Changes:

  • Add special handling for :headers option in RequestBuilder.add_optional_params/3
  • Headers option accepts a map of custom headers that get merged with defaults
  • Add comprehensive unit tests for custom headers functionality
  • Add integration tests using Bypass to verify headers are sent over HTTP

Usage example:
EnvelopeLocks.lock_put_envelope_lock( conn, account_id, envelope_id, body: lock_data, headers: %{"X-DocuSign-Edit" => ~s({"LockToken": "...", "LockDurationInSeconds": "600"})} )

Fixes #94

@neilberkman neilberkman force-pushed the claude/fix-custom-headers-support-011CUoZu799DMdc5dorB3C7g branch from e4df08d to 8e478f5 Compare November 4, 2025 22:13
This adds support for passing custom headers through API calls, which is
required for certain DocuSign operations like working with locked envelopes.

The DocuSign API requires the X-DocuSign-Edit header with a lockToken when
performing PUT operations on locked envelopes, but there was no way to pass
this header through the generated API code.

Changes:
- Add special handling for :headers option in RequestBuilder.add_optional_params/3
- Headers option accepts a map of custom headers that get merged with defaults
- Add comprehensive unit tests for custom headers functionality
- Add integration tests using Bypass to verify headers are sent over HTTP

Usage example:
  EnvelopeLocks.lock_put_envelope_lock(
    conn,
    account_id,
    envelope_id,
    body: lock_data,
    headers: %{"X-DocuSign-Edit" => ~s({"LockToken": "...", "LockDurationInSeconds": "600"})}
  )

Fixes #94
@neilberkman neilberkman force-pushed the claude/fix-custom-headers-support-011CUoZu799DMdc5dorB3C7g branch from 8527a49 to 049b1ce Compare November 4, 2025 22:30
@neilberkman neilberkman merged commit 762bebb into main Nov 4, 2025
6 checks passed
@neilberkman neilberkman deleted the claude/fix-custom-headers-support-011CUoZu799DMdc5dorB3C7g branch November 4, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to set lockToken

2 participants