lib/docusign_rest/client.rb in docusign_rest-0.3.4 vs lib/docusign_rest/client.rb in docusign_rest-0.3.5
- old
+ new
@@ -966,11 +966,33 @@
response = http.request(request)
generate_log(request, response, uri)
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)
#
# email - the email of the recipient
# headers - optional hash of headers to merge into the existing
# required headers for a multipart request.
@@ -1182,10 +1204,9 @@
request = Net::HTTP::Get.new(uri.request_uri, headers(content_type))
response = http.request(request)
generate_log(request, response, uri)
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
# document_id - ID of the document to retrieve