Skip to content

Commit

Permalink
add ability to send an existing envelope
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Copeland <[email protected]>
  • Loading branch information
Derek Harrington authored and tcopeland committed Dec 12, 2017
1 parent fd36e37 commit 092d313
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.3.5 ??

* Implement DocusignRest::Client#send_envelope (Derek Harrington)

## v0.3.4 Nov 20 2017

* Add open (default 5 seconds) and read (default 10 seconds) timeouts (Tom Copeland)
Expand Down
23 changes: 22 additions & 1 deletion lib/docusign_rest/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,28 @@ def create_envelope_from_composite_template(options={})
JSON.parse(response.body)
end

# Public marks an envelope as sent
#
# envelope_id - ID of the envelope which you want to send
#
# Returns the response (success or failure).
def send_envelope(envelope_id)
content_type = { 'Content-Type' => 'application/json' }

post_body = {
status: 'sent'
}.to_json

uri = build_uri("/accounts/#{acct_id}/envelopes/#{envelope_id}")

http = initialize_net_http_ssl(uri)
request = Net::HTTP::Put.new(uri.request_uri, headers(content_type))
request.body = post_body
response = http.request(request)

JSON.parse(response.body)
end


# Public returns the names specified for a given email address (existing docusign user)
#
Expand Down Expand Up @@ -1185,7 +1207,6 @@ def get_envelope_statuses(options={})
JSON.parse(response.body)
end


# Public retrieves a png of a page of a document in an envelope
#
# envelope_id - ID of the envelope from which the doc will be retrieved
Expand Down

0 comments on commit 092d313

Please sign in to comment.