Class: Echosign::Widget

Inherits:
Hash
  • Object
show all
Includes:
Validatable
Defined in:
lib/echosign/widget.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validatable

#require_exactly_one, #require_keys, #validate_field

Constructor Details

#initialize(user_id = nil, user_email = nil, params) ⇒ Widget

Widget initialization object

Parameters:

  • user_id (String) (defaults to: nil)

    The ID of the user on whose behalf widget is being created.

  • user_email (String) (defaults to: nil)

    The email address of the user on whose behalf widget is being created. If both X-User-Id and X-User-Email are provided then X-User-Id is given preference. If neither is specified then the user is inferred from the access token.

  • params (Hash)

    SYMBOL-referenced Hash containing: (REQUIRED)

  • param (Hash)

    a customizable set of options

Options Hash (params):

  • :name (String)

    The name of the widget that will be used to identify it, in emails and on the website (REQUIRED)

  • :fileInfos (Array)

    Populate with instances of Echosign::Fileinfo. A list of one or more files (or references to files) that will be used to create the widget. If more than one file is provided, they will be combined before the widget is created. Library documents are not permitted. Note: Only one of the four parameters in every Fileinfo object must be specified (REQUIRED)

  • :formFieldLayerTemplates (Array)

    Populate with instances of Echosign::Fileinfo. Specifies the form field layer template or source of form fields to apply on the files in this transaction. If specified, the FileInfo for this parameter must refer to a form field layer template via libraryDocumentId or libraryDocumentName, or if specified via transientDocumentId or documentURL, it must be of a supported file type. Note: Only one of the four parameters in every FileInfo object must be specified.

  • :widgetCompletionInfo (Echosign::WidgetCompletionInfo)

    URL and associated properties for the success page the user will be taken to after filling out the widget

  • :callbackInfo (String)

    A publicly accessible url to which EchoSign will perform an HTTP PUT operation with the final signed PDF file. HTTP authentication is supported using standard embedded syntax - i.e. username:[email protected]/path/to/file. EchoSign can also communicate with your system using HTTP GET, every time there is a new agreement event. Please contact [email protected] if you wish to use this option.

  • :securityOptions (Echosign::WidgetSecurityOption)

    Sets optional secondary security parameters for your widget

  • :locale (String)

    The locale associated with this widget - specifies the language for the signing page and emails, for example en_US or fr_FR. If none specified, defaults to the language configured for the widget creator

  • :counterSigners (Echosign::CounterSignerInfo)

    A list of one or more counter signers

  • :vaultingInfo (Echosign::WidgetVaultingInfo)

    Sets the vaulting properties that allows EchoSign to securely store documents with a vault provider

  • :mergeFieldInfo (Echosign::WidgetMergefieldInfo)

    Optional default values for fields to merge into the document. The values will be presented to the signers for editable fields; for read-only fields the provided values will not be editable during the signing process. Merging data into fields is currently not supported when used with libraryDocumentId or libraryDocumentName. Only file and url are curently supported

  • :widgetAuthFailureInfo (Echosign::WidgetCompletionInfo)

    URL and associated properties for the error page the user will be taken after failing to authenticate

  • :widgetSignerSecurityOptions (Echosign::WidgetSignerSecurityOption)

    Security options that apply to widget signers



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/echosign/widget.rb', line 60

def initialize(user_id = nil, user_email = nil, params)
  require_keys([:name, :fileInfos, :signatureFlow], params)
  @user_id = user_id
  @user_email = user_email

  # {
  #   "widgetCreationInfo": {
  #     "widgetCompletionInfo": {
  #       "deframe": false,
  #       "delay": 0,
  #       "url": ""
  #     },
  #     "widgetAuthFailureInfo": {
  #       "deframe": false,
  #       "delay": 0,
  #       "url": ""
  #     },
  #     "mergeFieldInfo": [
  #       {
  #         "fieldName": "",
  #         "defaultValue": ""
  #       }
  #     ],
  #     "formFieldLayerTemplates": [
  #       {
  #         "transientDocumentId": "",
  #         "libraryDocumentId": "",
  #         "libraryDocumentName": "",
  #         "documentURL": {
  #           "name": "",
  #           "url": "",
  #           "mimeType": ""
  #         }
  #       }
  #     ],
  #     "securityOptions": {
  #       "passwordProtection": {
  #         "ALL_USERS": "enum",
  #         "EXTERNAL_USERS": "enum",
  #         "NONE": "enum",
  #         "INTERNAL_USERS": "enum"
  #       },
  #       "kbaProtection": {
  #         "ALL_USERS": "enum",
  #         "EXTERNAL_USERS": "enum",
  #         "NONE": "enum",
  #         "INTERNAL_USERS": "enum"
  #       },
  #       "webIdentityProtection": {
  #         "ALL_USERS": "enum",
  #         "EXTERNAL_USERS": "enum",
  #         "NONE": "enum",
  #         "INTERNAL_USERS": "enum"
  #       },
  #       "protectOpen": false,
  #       "internalPassword": "",
  #       "externalPassword": "",
  #       "openPassword": ""
  #     },
  #     "fileInfos": [
  #       {
  #         "transientDocumentId": "",
  #         "libraryDocumentId": "",
  #         "libraryDocumentName": "",
  #         "documentURL": {
  #           "name": "",
  #           "url": "",
  #           "mimeType": ""
  #         }
  #       }
  #     ],
  #     "counterSignerSetInfos": [
  #       {
  #         "counterSignerSetRole": {
  #           "SIGNER": "enum",
  #           "DELEGATE_TO_SIGNER": "enum",
  #           "DELEGATE_TO_APPROVER": "enum",
  #           "APPROVER": "enum"
  #         },
  #         "counterSignerSetMemberInfos": [
  #           {
  #             "securityOptions": [
  #               {
  #                 "authenticationMethod": {
  #                   "PHONE": "enum",
  #                   "INHERITED_FROM_DOCUMENT": "enum",
  #                   "KBA": "enum",
  #                   "WEB_IDENTITY": "enum",
  #                   "PASSWORD": "enum",
  #                   "NONE": "enum"
  #                 },
  #                 "phoneInfos": [
  #                   {
  #                     "phone": "",
  #                     "countryCode": ""
  #                   }
  #                 ],
  #                 "password": ""
  #               }
  #             ],
  #             "email": ""
  #           }
  #         ]
  #       }
  #     ],
  #     "callbackInfo": "",
  #     "widgetSignerSecurityOptions": {
  #       "authenticationMethod": {
  #         "PHONE": "enum",
  #         "INHERITED_FROM_DOCUMENT": "enum",
  #         "KBA": "enum",
  #         "WEB_IDENTITY": "enum",
  #         "PASSWORD": "enum",
  #         "NONE": "enum"
  #       },
  #       "phoneInfos": [
  #         {
  #           "phone": "",
  #           "countryCode": ""
  #         }
  #       ],
  #       "password": ""
  #     },
  #     "name": "",
  #     "locale": "",
  #     "vaultingInfo": {
  #       "enabled": false
  #     },
  #     "signatureFlow": ""
  #   }
  # }

  merge!({
           widgetCreationInfo: {
             name: params[:name],
             fileInfos: params[:fileInfos],
             signatureFlow: params[:signatureFlow],
             widgetCompletion_Info: params[:widget_completion_info]
           }
         })
end

Instance Attribute Details

#user_emailObject (readonly)

Returns the value of attribute user_email.



12
13
14
# File 'lib/echosign/widget.rb', line 12

def user_email
  @user_email
end

#user_idObject (readonly)

Returns the value of attribute user_id.



12
13
14
# File 'lib/echosign/widget.rb', line 12

def user_id
  @user_id
end