Current section
Files
Jump to
Current section
Files
lib/docusign/api/envelope_publish.ex
# NOTE: This file is auto generated by OpenAPI Generator 7.12.0 (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule DocuSign.Api.EnvelopePublish do
@moduledoc """
API calls for all endpoints tagged `EnvelopePublish`.
"""
import DocuSign.RequestBuilder
alias DocuSign.Connection
alias DocuSign.Model.EnvelopePublishTransaction
alias DocuSign.Model.ErrorDetails
@doc """
Submits a batch of historical envelopes for republish to a webhook.
This endpoint submits a batch of existing envelopes to a webhook of your choice. Set the webhook address with the `urlToPublishTo` request body parameter. This endpoint does not call an existing Connect configuration or create a new Connect listener to monitor new activity. It simply uses an ad hoc configuration to submit existing envelopes. You must include all the configuration data in the request body. The envelope data will always be transmitted in JSON format. XML, Salesforce, and eOriginal configuration types are not supported. Your request should match the following format: ``` { \"envelopes\": [\"4280f274-xxxx-xxxx-xxxx-b218b7eeda08\", \"8373a938-xxxx-xxxx-xxxx-e992a2abae01\"], \"config\": { \"configurationType\":\"custom\", \"name\": \"Test\", \"urlToPublishTo\":\"YOUR-WEBHOOK-URL\", \"allowEnvelopePublish\": \"true\", \"enableLog\": \"true\", \"requiresAcknowledgement\": \"true\", \"IncludeHMAC\": \"true\", \"SignMessageWithX509Cert\": \"true\", \"deliveryMode\": \"SIM\", \"eventData\": { \"version\": \"restv2.1\", \"format\": \"json\", \"includedata\": [\"tabs\",\"payment_tabs\",\"custom_fields\",\"powerform\",\"recipients\",\"folders\",\"extensions\",\"attachments\", \"prefill_tabs\", \"documents\"] } } } ``` If the request succeeds, it returns a 201 (Created) HTTP response code and the response body property `processingStatus` will be set to `processing`. You can then view the status of each historical republish request in the [Bulk Actions Log](https://support.docusign.com/s/document-item?bundleId=pik1583277475390&topicId=nvf1648497452396.html).
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
- `:body` (ConnectHistoricalEnvelopeRepublish):
### Returns
- `{:ok, DocuSign.Model.EnvelopePublishTransaction.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec historical_envelope_publish_post_historical_envelope_publish_transaction(
Tesla.Env.client(),
String.t(),
keyword()
) ::
{:ok, EnvelopePublishTransaction.t()}
| {:ok, ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def historical_envelope_publish_post_historical_envelope_publish_transaction(connection, account_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:post)
|> url("/v2.1/accounts/#{account_id}/connect/envelopes/publish/historical")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{201, EnvelopePublishTransaction},
{400, ErrorDetails}
])
end
end