Class: SignwellSDK::Resources::V1::BulkSends

Inherits:
Object
  • Object
show all
Defined in:
lib/signwell_sdk/resources/v1/bulk_sends.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ BulkSends

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of BulkSends.

Parameters:



192
193
194
# File 'lib/signwell_sdk/resources/v1/bulk_sends.rb', line 192

def initialize(client:)
  @client = client
end

Instance Method Details

#create(bulk_send_csv:, template_ids:, api_application_id: nil, apply_signing_order: nil, custom_requester_email: nil, custom_requester_name: nil, message: nil, name: nil, skip_row_errors: nil, subject: nil, request_options: {}) ⇒ nil

Some parameter documentations has been truncated, see Models::V1::BulkSendCreateParams for more details.

Creates a bulk send, and it validates the CSV file before creating the bulk send.

Parameters:

  • bulk_send_csv (String)

    A RFC 4648 base64 string of the template CSV file to be validated.

  • template_ids (Array<String>)

    Unique identifiers for a list of templates.

  • api_application_id (String)

    Unique identifier for API Application settings to use. API Applications are opti

  • apply_signing_order (Boolean)

    When set to ‘true` recipients will sign one at a time in the order of the `recip

  • custom_requester_email (String)

    Sets the custom requester email for the document. When set, this is the email us

  • custom_requester_name (String)

    Sets the custom requester name for the document. When set, this is the name used

  • message (String)

    Email message for the signature request that recipients will see. Defaults to th

  • name (String)

    The name of the Bulk Send. Will be used as the document name for each of the doc

  • skip_row_errors (Boolean)

    Whether to skip errors in the rows. Defaults to ‘false`.

  • subject (String)

    Email subject for the signature request that recipients will see. Defaults to th

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



40
41
42
43
44
45
46
47
48
49
# File 'lib/signwell_sdk/resources/v1/bulk_sends.rb', line 40

def create(params)
  parsed, options = SignwellSDK::V1::BulkSendCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v1/bulk_sends",
    body: parsed,
    model: NilClass,
    options: options
  )
end

#list(api_application_id: nil, limit: nil, page: nil, user_email: nil, request_options: {}) ⇒ nil

Some parameter documentations has been truncated, see Models::V1::BulkSendListParams for more details.

Returns information about the Bulk Send.

Parameters:

  • api_application_id (String)

    Unique identifier for API Application settings to use. API Applications are opti

  • limit (Integer)

    The number of documents to fetch. Defaults to 10, max is 50.

  • page (Integer)

    The page number for pagination. Defaults to the first page.

  • user_email (String)

    The email address of the user that sent the Bulk Send. Must have the ‘admin` or

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



91
92
93
94
95
96
97
98
99
100
# File 'lib/signwell_sdk/resources/v1/bulk_sends.rb', line 91

def list(params = {})
  parsed, options = SignwellSDK::V1::BulkSendListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/v1/bulk_sends",
    query: parsed,
    model: NilClass,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ nil

Returns information about the Bulk Send.

Parameters:

Returns:

  • (nil)

See Also:



62
63
64
65
66
67
68
69
# File 'lib/signwell_sdk/resources/v1/bulk_sends.rb', line 62

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["api/v1/bulk_sends/%1$s", id],
    model: NilClass,
    options: params[:request_options]
  )
end

#retrieve_csv_template(template_ids:, base64: nil, request_options: {}) ⇒ StringIO

Some parameter documentations has been truncated, see Models::V1::BulkSendRetrieveCsvTemplateParams for more details.

Fetches a CSV template that corresponds to the provided document template IDs. CSV templates are blank CSV files that have columns containing required and optional data that can be sent when creating a bulk send. Fields can be referenced by the field label. Example: [placeholder name]_[field label] could be something like customer_address or signer_company_name (if ‘Customer’ and ‘Signer’ were placeholder names for templates set up in SignWell).

Parameters:

  • template_ids (Array<String>)

    Specify one or more templates to generate a single blank CSV file that will cont

  • base64 (String)

    A RFC 4648 base64 string of the template CSV file to be validated.

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (StringIO)

See Also:



123
124
125
126
127
128
129
130
131
132
133
# File 'lib/signwell_sdk/resources/v1/bulk_sends.rb', line 123

def retrieve_csv_template(params)
  parsed, options = SignwellSDK::V1::BulkSendRetrieveCsvTemplateParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/v1/bulk_sends/csv_template",
    query: parsed,
    headers: {"accept" => "application/octet-stream"},
    model: StringIO,
    options: options
  )
end

#retrieve_documents(id, limit: nil, page: nil, request_options: {}) ⇒ nil

Returns information about the Bulk Send.

Parameters:

  • id (String)

    Unique identifier for a bulk send.

  • limit (Integer)

    The number of documents to fetch. Defaults to 10, max is 50.

  • page (Integer)

    The page number for pagination. Defaults to the first page.

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



150
151
152
153
154
155
156
157
158
159
# File 'lib/signwell_sdk/resources/v1/bulk_sends.rb', line 150

def retrieve_documents(id, params = {})
  parsed, options = SignwellSDK::V1::BulkSendRetrieveDocumentsParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["api/v1/bulk_sends/%1$s/documents", id],
    query: parsed,
    model: NilClass,
    options: options
  )
end

#validate_csv(bulk_send_csv:, template_ids:, request_options: {}) ⇒ nil

Some parameter documentations has been truncated, see Models::V1::BulkSendValidateCsvParams for more details.

Validates a Bulk Send CSV file before creating the Bulk Send. It will check the structure of the CSV and the data it contains, and return any errors found.

Parameters:

  • bulk_send_csv (String)

    A RFC 4648 base64 string of the template CSV file to be validated.

  • template_ids (Array<String>)

    Specify one or more templates to generate a single blank CSV file that will cont

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



178
179
180
181
182
183
184
185
186
187
# File 'lib/signwell_sdk/resources/v1/bulk_sends.rb', line 178

def validate_csv(params)
  parsed, options = SignwellSDK::V1::BulkSendValidateCsvParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v1/bulk_sends/validate_csv",
    body: parsed,
    model: NilClass,
    options: options
  )
end