docusign_esign.apis.power_forms_api
Docusign eSignature REST API
The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign. # noqa: E501
OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git
1# coding: utf-8 2 3""" 4 Docusign eSignature REST API 5 6 The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign. # noqa: E501 7 8 OpenAPI spec version: v2.1 9 Contact: devcenter@docusign.com 10 Generated by: https://github.com/swagger-api/swagger-codegen.git 11""" 12 13 14from __future__ import absolute_import 15 16import sys 17import os 18import re 19 20# python 2 and python 3 compatibility library 21from six import iteritems 22 23from ..client.configuration import Configuration 24from ..client.api_client import ApiClient 25 26 27class PowerFormsApi(object): 28 """ 29 NOTE: This class is auto generated by the swagger code generator program. 30 Do not edit the class manually. 31 Ref: https://github.com/swagger-api/swagger-codegen 32 """ 33 34 def __init__(self, api_client=None): 35 config = Configuration() 36 if api_client: 37 self.api_client = api_client 38 else: 39 if not config.api_client: 40 config.api_client = ApiClient() 41 self.api_client = config.api_client 42 43 def create_power_form(self, account_id, **kwargs): 44 """ 45 Creates a new PowerForm. 46 This method creates a new PowerForm. You create a PowerForm from an existing DocuSign [template](/docs/esign-rest-api/reference/templates/templates/create/), based on the `templateId` in the request body. PowerForms that you create from a template are referred to as *web PowerForms*. **Note:** The DocuSign Admin console also supports creating a PowerForm by uploading a PDF file that has active form fields (referred to as a *PDF PowerForm*). However, PDF PowerForms are deprecated and are not supported in the API. **Note:** A PowerForm can have only one sender. (Because PowerForms are not necessarily sent by email, this user is also referred to as the PowerForm *initiator*.) If you need to associate multiple senders with a PowerForm, create multiple copies of the PowerForm by using the same template (one copy for each sender). By default, the sender is the PowerForm Administrator who creates the PowerForm. ### Signing modes You can use one of the following signing modes for a PowerForm: **`email`** This mode verifies the recipient's identity by using email authentication before the recipient can sign a document. The recipient enters their email address on the landing page and then clicks **Begin Signing** to begin the signing process. The system then sends an email message with a validation code to the recipient. If the recipient does not provide a valid email address, they do not receive the email message containing the access code and are not able to open and sign the document. Alternatively, you can make the process easier for signers by using email authentication only and omitting the access code. To do this, you append the `activateonly` flag to the PowerForm URL and set it to true by passing in the value `1`. When the flag is active, the first recipient receives an email with a link that initiates the signing session without having to enter access code. Example: `activateonly=1` **`direct`** This mode does not require any verification. After a recipient enters their email address on the landing page and clicks **Begin Signing,** a new browser tab opens and the recipient can immediately begin the signing process. Because the `direct` signing mode does not verify the recipient's identity by using email authentication, we strongly recommend that you use this mode only when the PowerForm is accessible behind a secure portal where the recipient's identity is already authenticated, or where another form of authentication is specified for the recipient in the DocuSign template (for example, an access code, phone authentication, or ID check). **Note:** In the account settings, `enablePowerFormDirect` must be **true** to use `direct` as the `signingMode`. ### Redirect URLs You can control the URL to which signers are redirected after signing your PowerForm. However, the URL is specified elsewhere, outside of the PowerForm creation process. For details, see [How do I specify a URL to redirect to when a PowerForm is completed?](https://support.docusign.com/en/articles/How-do-I-specify-a-URL-to-redirect-to-when-a-Powerform-is-completed). ### More information For more information about creating PowerForms, see [Create a PowerForm](https://support.docusign.com/en/guides/ndse-user-guide-create-a-powerform). 47 This method makes a synchronous HTTP request by default. To make an 48 asynchronous HTTP request, please define a `callback` function 49 to be invoked when receiving the response. 50 >>> def callback_function(response): 51 >>> pprint(response) 52 >>> 53 >>> thread = api.create_power_form(account_id, callback=callback_function) 54 55 :param callback function: The callback function 56 for asynchronous request. (optional) 57 :param str account_id: The external account number (int) or account ID Guid. (required) 58 :param PowerForm power_form: 59 :return: PowerForm 60 If the method is called asynchronously, 61 returns the request thread. 62 """ 63 kwargs['_return_http_data_only'] = True 64 if kwargs.get('callback'): 65 return self.create_power_form_with_http_info(account_id, **kwargs) 66 else: 67 (data) = self.create_power_form_with_http_info(account_id, **kwargs) 68 return data 69 70 def create_power_form_with_http_info(self, account_id, **kwargs): 71 """ 72 Creates a new PowerForm. 73 This method creates a new PowerForm. You create a PowerForm from an existing DocuSign [template](/docs/esign-rest-api/reference/templates/templates/create/), based on the `templateId` in the request body. PowerForms that you create from a template are referred to as *web PowerForms*. **Note:** The DocuSign Admin console also supports creating a PowerForm by uploading a PDF file that has active form fields (referred to as a *PDF PowerForm*). However, PDF PowerForms are deprecated and are not supported in the API. **Note:** A PowerForm can have only one sender. (Because PowerForms are not necessarily sent by email, this user is also referred to as the PowerForm *initiator*.) If you need to associate multiple senders with a PowerForm, create multiple copies of the PowerForm by using the same template (one copy for each sender). By default, the sender is the PowerForm Administrator who creates the PowerForm. ### Signing modes You can use one of the following signing modes for a PowerForm: **`email`** This mode verifies the recipient's identity by using email authentication before the recipient can sign a document. The recipient enters their email address on the landing page and then clicks **Begin Signing** to begin the signing process. The system then sends an email message with a validation code to the recipient. If the recipient does not provide a valid email address, they do not receive the email message containing the access code and are not able to open and sign the document. Alternatively, you can make the process easier for signers by using email authentication only and omitting the access code. To do this, you append the `activateonly` flag to the PowerForm URL and set it to true by passing in the value `1`. When the flag is active, the first recipient receives an email with a link that initiates the signing session without having to enter access code. Example: `activateonly=1` **`direct`** This mode does not require any verification. After a recipient enters their email address on the landing page and clicks **Begin Signing,** a new browser tab opens and the recipient can immediately begin the signing process. Because the `direct` signing mode does not verify the recipient's identity by using email authentication, we strongly recommend that you use this mode only when the PowerForm is accessible behind a secure portal where the recipient's identity is already authenticated, or where another form of authentication is specified for the recipient in the DocuSign template (for example, an access code, phone authentication, or ID check). **Note:** In the account settings, `enablePowerFormDirect` must be **true** to use `direct` as the `signingMode`. ### Redirect URLs You can control the URL to which signers are redirected after signing your PowerForm. However, the URL is specified elsewhere, outside of the PowerForm creation process. For details, see [How do I specify a URL to redirect to when a PowerForm is completed?](https://support.docusign.com/en/articles/How-do-I-specify-a-URL-to-redirect-to-when-a-Powerform-is-completed). ### More information For more information about creating PowerForms, see [Create a PowerForm](https://support.docusign.com/en/guides/ndse-user-guide-create-a-powerform). 74 This method makes a synchronous HTTP request by default. To make an 75 asynchronous HTTP request, please define a `callback` function 76 to be invoked when receiving the response. 77 >>> def callback_function(response): 78 >>> pprint(response) 79 >>> 80 >>> thread = api.create_power_form_with_http_info(account_id, callback=callback_function) 81 82 :param callback function: The callback function 83 for asynchronous request. (optional) 84 :param str account_id: The external account number (int) or account ID Guid. (required) 85 :param PowerForm power_form: 86 :return: PowerForm 87 If the method is called asynchronously, 88 returns the request thread. 89 """ 90 91 all_params = ['account_id', 'power_form'] 92 all_params.append('callback') 93 all_params.append('_return_http_data_only') 94 all_params.append('_preload_content') 95 all_params.append('_request_timeout') 96 97 params = locals() 98 for key, val in iteritems(params['kwargs']): 99 if key not in all_params: 100 raise TypeError( 101 "Got an unexpected keyword argument '%s'" 102 " to method create_power_form" % key 103 ) 104 params[key] = val 105 del params['kwargs'] 106 # verify the required parameter 'account_id' is set 107 if ('account_id' not in params) or (params['account_id'] is None): 108 raise ValueError("Missing the required parameter `account_id` when calling `create_power_form`") 109 110 111 collection_formats = {} 112 113 resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json') 114 path_params = {} 115 if 'account_id' in params: 116 path_params['accountId'] = params['account_id'] 117 118 query_params = {} 119 120 header_params = {} 121 122 form_params = [] 123 local_var_files = {} 124 125 body_params = None 126 if 'power_form' in params: 127 body_params = params['power_form'] 128 # HTTP header `Accept` 129 header_params['Accept'] = self.api_client.\ 130 select_header_accept(['application/json']) 131 132 # Authentication setting 133 auth_settings = [] 134 135 return self.api_client.call_api(resource_path, 'POST', 136 path_params, 137 query_params, 138 header_params, 139 body=body_params, 140 post_params=form_params, 141 files=local_var_files, 142 response_type='PowerForm', 143 auth_settings=auth_settings, 144 callback=params.get('callback'), 145 _return_http_data_only=params.get('_return_http_data_only'), 146 _preload_content=params.get('_preload_content', True), 147 _request_timeout=params.get('_request_timeout'), 148 collection_formats=collection_formats) 149 150 def delete_power_form(self, account_id, power_form_id, **kwargs): 151 """ 152 Delete a PowerForm. 153 This method deletes a PowerForm. 154 This method makes a synchronous HTTP request by default. To make an 155 asynchronous HTTP request, please define a `callback` function 156 to be invoked when receiving the response. 157 >>> def callback_function(response): 158 >>> pprint(response) 159 >>> 160 >>> thread = api.delete_power_form(account_id, power_form_id, callback=callback_function) 161 162 :param callback function: The callback function 163 for asynchronous request. (optional) 164 :param str account_id: The external account number (int) or account ID Guid. (required) 165 :param str power_form_id: (required) 166 :return: None 167 If the method is called asynchronously, 168 returns the request thread. 169 """ 170 kwargs['_return_http_data_only'] = True 171 if kwargs.get('callback'): 172 return self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs) 173 else: 174 (data) = self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs) 175 return data 176 177 def delete_power_form_with_http_info(self, account_id, power_form_id, **kwargs): 178 """ 179 Delete a PowerForm. 180 This method deletes a PowerForm. 181 This method makes a synchronous HTTP request by default. To make an 182 asynchronous HTTP request, please define a `callback` function 183 to be invoked when receiving the response. 184 >>> def callback_function(response): 185 >>> pprint(response) 186 >>> 187 >>> thread = api.delete_power_form_with_http_info(account_id, power_form_id, callback=callback_function) 188 189 :param callback function: The callback function 190 for asynchronous request. (optional) 191 :param str account_id: The external account number (int) or account ID Guid. (required) 192 :param str power_form_id: (required) 193 :return: None 194 If the method is called asynchronously, 195 returns the request thread. 196 """ 197 198 all_params = ['account_id', 'power_form_id'] 199 all_params.append('callback') 200 all_params.append('_return_http_data_only') 201 all_params.append('_preload_content') 202 all_params.append('_request_timeout') 203 204 params = locals() 205 for key, val in iteritems(params['kwargs']): 206 if key not in all_params: 207 raise TypeError( 208 "Got an unexpected keyword argument '%s'" 209 " to method delete_power_form" % key 210 ) 211 params[key] = val 212 del params['kwargs'] 213 # verify the required parameter 'account_id' is set 214 if ('account_id' not in params) or (params['account_id'] is None): 215 raise ValueError("Missing the required parameter `account_id` when calling `delete_power_form`") 216 # verify the required parameter 'power_form_id' is set 217 if ('power_form_id' not in params) or (params['power_form_id'] is None): 218 raise ValueError("Missing the required parameter `power_form_id` when calling `delete_power_form`") 219 220 221 collection_formats = {} 222 223 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json') 224 path_params = {} 225 if 'account_id' in params: 226 path_params['accountId'] = params['account_id'] 227 if 'power_form_id' in params: 228 path_params['powerFormId'] = params['power_form_id'] 229 230 query_params = {} 231 232 header_params = {} 233 234 form_params = [] 235 local_var_files = {} 236 237 body_params = None 238 # HTTP header `Accept` 239 header_params['Accept'] = self.api_client.\ 240 select_header_accept(['application/json']) 241 242 # Authentication setting 243 auth_settings = [] 244 245 return self.api_client.call_api(resource_path, 'DELETE', 246 path_params, 247 query_params, 248 header_params, 249 body=body_params, 250 post_params=form_params, 251 files=local_var_files, 252 response_type=None, 253 auth_settings=auth_settings, 254 callback=params.get('callback'), 255 _return_http_data_only=params.get('_return_http_data_only'), 256 _preload_content=params.get('_preload_content', True), 257 _request_timeout=params.get('_request_timeout'), 258 collection_formats=collection_formats) 259 260 def delete_power_forms(self, account_id, **kwargs): 261 """ 262 Deletes one or more PowerForms 263 This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`. 264 This method makes a synchronous HTTP request by default. To make an 265 asynchronous HTTP request, please define a `callback` function 266 to be invoked when receiving the response. 267 >>> def callback_function(response): 268 >>> pprint(response) 269 >>> 270 >>> thread = api.delete_power_forms(account_id, callback=callback_function) 271 272 :param callback function: The callback function 273 for asynchronous request. (optional) 274 :param str account_id: The external account number (int) or account ID Guid. (required) 275 :param PowerFormsRequest power_forms_request: 276 :return: PowerFormsResponse 277 If the method is called asynchronously, 278 returns the request thread. 279 """ 280 kwargs['_return_http_data_only'] = True 281 if kwargs.get('callback'): 282 return self.delete_power_forms_with_http_info(account_id, **kwargs) 283 else: 284 (data) = self.delete_power_forms_with_http_info(account_id, **kwargs) 285 return data 286 287 def delete_power_forms_with_http_info(self, account_id, **kwargs): 288 """ 289 Deletes one or more PowerForms 290 This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`. 291 This method makes a synchronous HTTP request by default. To make an 292 asynchronous HTTP request, please define a `callback` function 293 to be invoked when receiving the response. 294 >>> def callback_function(response): 295 >>> pprint(response) 296 >>> 297 >>> thread = api.delete_power_forms_with_http_info(account_id, callback=callback_function) 298 299 :param callback function: The callback function 300 for asynchronous request. (optional) 301 :param str account_id: The external account number (int) or account ID Guid. (required) 302 :param PowerFormsRequest power_forms_request: 303 :return: PowerFormsResponse 304 If the method is called asynchronously, 305 returns the request thread. 306 """ 307 308 all_params = ['account_id', 'power_forms_request'] 309 all_params.append('callback') 310 all_params.append('_return_http_data_only') 311 all_params.append('_preload_content') 312 all_params.append('_request_timeout') 313 314 params = locals() 315 for key, val in iteritems(params['kwargs']): 316 if key not in all_params: 317 raise TypeError( 318 "Got an unexpected keyword argument '%s'" 319 " to method delete_power_forms" % key 320 ) 321 params[key] = val 322 del params['kwargs'] 323 # verify the required parameter 'account_id' is set 324 if ('account_id' not in params) or (params['account_id'] is None): 325 raise ValueError("Missing the required parameter `account_id` when calling `delete_power_forms`") 326 327 328 collection_formats = {} 329 330 resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json') 331 path_params = {} 332 if 'account_id' in params: 333 path_params['accountId'] = params['account_id'] 334 335 query_params = {} 336 337 header_params = {} 338 339 form_params = [] 340 local_var_files = {} 341 342 body_params = None 343 if 'power_forms_request' in params: 344 body_params = params['power_forms_request'] 345 # HTTP header `Accept` 346 header_params['Accept'] = self.api_client.\ 347 select_header_accept(['application/json']) 348 349 # Authentication setting 350 auth_settings = [] 351 352 return self.api_client.call_api(resource_path, 'DELETE', 353 path_params, 354 query_params, 355 header_params, 356 body=body_params, 357 post_params=form_params, 358 files=local_var_files, 359 response_type='PowerFormsResponse', 360 auth_settings=auth_settings, 361 callback=params.get('callback'), 362 _return_http_data_only=params.get('_return_http_data_only'), 363 _preload_content=params.get('_preload_content', True), 364 _request_timeout=params.get('_request_timeout'), 365 collection_formats=collection_formats) 366 367 def get_power_form(self, account_id, power_form_id, **kwargs): 368 """ 369 Returns a single PowerForm. 370 This method returns detailed information about a specific PowerForm. 371 This method makes a synchronous HTTP request by default. To make an 372 asynchronous HTTP request, please define a `callback` function 373 to be invoked when receiving the response. 374 >>> def callback_function(response): 375 >>> pprint(response) 376 >>> 377 >>> thread = api.get_power_form(account_id, power_form_id, callback=callback_function) 378 379 :param callback function: The callback function 380 for asynchronous request. (optional) 381 :param str account_id: The external account number (int) or account ID Guid. (required) 382 :param str power_form_id: (required) 383 :return: PowerForm 384 If the method is called asynchronously, 385 returns the request thread. 386 """ 387 kwargs['_return_http_data_only'] = True 388 if kwargs.get('callback'): 389 return self.get_power_form_with_http_info(account_id, power_form_id, **kwargs) 390 else: 391 (data) = self.get_power_form_with_http_info(account_id, power_form_id, **kwargs) 392 return data 393 394 def get_power_form_with_http_info(self, account_id, power_form_id, **kwargs): 395 """ 396 Returns a single PowerForm. 397 This method returns detailed information about a specific PowerForm. 398 This method makes a synchronous HTTP request by default. To make an 399 asynchronous HTTP request, please define a `callback` function 400 to be invoked when receiving the response. 401 >>> def callback_function(response): 402 >>> pprint(response) 403 >>> 404 >>> thread = api.get_power_form_with_http_info(account_id, power_form_id, callback=callback_function) 405 406 :param callback function: The callback function 407 for asynchronous request. (optional) 408 :param str account_id: The external account number (int) or account ID Guid. (required) 409 :param str power_form_id: (required) 410 :return: PowerForm 411 If the method is called asynchronously, 412 returns the request thread. 413 """ 414 415 all_params = ['account_id', 'power_form_id'] 416 all_params.append('callback') 417 all_params.append('_return_http_data_only') 418 all_params.append('_preload_content') 419 all_params.append('_request_timeout') 420 421 params = locals() 422 for key, val in iteritems(params['kwargs']): 423 if key not in all_params: 424 raise TypeError( 425 "Got an unexpected keyword argument '%s'" 426 " to method get_power_form" % key 427 ) 428 params[key] = val 429 del params['kwargs'] 430 # verify the required parameter 'account_id' is set 431 if ('account_id' not in params) or (params['account_id'] is None): 432 raise ValueError("Missing the required parameter `account_id` when calling `get_power_form`") 433 # verify the required parameter 'power_form_id' is set 434 if ('power_form_id' not in params) or (params['power_form_id'] is None): 435 raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form`") 436 437 438 collection_formats = {} 439 440 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json') 441 path_params = {} 442 if 'account_id' in params: 443 path_params['accountId'] = params['account_id'] 444 if 'power_form_id' in params: 445 path_params['powerFormId'] = params['power_form_id'] 446 447 query_params = {} 448 449 header_params = {} 450 451 form_params = [] 452 local_var_files = {} 453 454 body_params = None 455 # HTTP header `Accept` 456 header_params['Accept'] = self.api_client.\ 457 select_header_accept(['application/json']) 458 459 # Authentication setting 460 auth_settings = [] 461 462 return self.api_client.call_api(resource_path, 'GET', 463 path_params, 464 query_params, 465 header_params, 466 body=body_params, 467 post_params=form_params, 468 files=local_var_files, 469 response_type='PowerForm', 470 auth_settings=auth_settings, 471 callback=params.get('callback'), 472 _return_http_data_only=params.get('_return_http_data_only'), 473 _preload_content=params.get('_preload_content', True), 474 _request_timeout=params.get('_request_timeout'), 475 collection_formats=collection_formats) 476 477 def get_power_form_data(self, account_id, power_form_id, **kwargs): 478 """ 479 Returns the form data associated with the usage of a PowerForm. 480 This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm. You specify the format in which you want to retrieve the data in the `Accept` header. This header accepts the following values: - `application/json`: JSON format - `application/xml`: XML format - `text/csv`: Comma-separated value (CSV) format **Note:** Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm. 481 This method makes a synchronous HTTP request by default. To make an 482 asynchronous HTTP request, please define a `callback` function 483 to be invoked when receiving the response. 484 >>> def callback_function(response): 485 >>> pprint(response) 486 >>> 487 >>> thread = api.get_power_form_data(account_id, power_form_id, callback=callback_function) 488 489 :param callback function: The callback function 490 for asynchronous request. (optional) 491 :param str account_id: The external account number (int) or account ID Guid. (required) 492 :param str power_form_id: (required) 493 :param str data_layout: 494 :param str from_date: 495 :param str to_date: 496 :return: PowerFormsFormDataResponse 497 If the method is called asynchronously, 498 returns the request thread. 499 """ 500 kwargs['_return_http_data_only'] = True 501 if kwargs.get('callback'): 502 return self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs) 503 else: 504 (data) = self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs) 505 return data 506 507 def get_power_form_data_with_http_info(self, account_id, power_form_id, **kwargs): 508 """ 509 Returns the form data associated with the usage of a PowerForm. 510 This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm. You specify the format in which you want to retrieve the data in the `Accept` header. This header accepts the following values: - `application/json`: JSON format - `application/xml`: XML format - `text/csv`: Comma-separated value (CSV) format **Note:** Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm. 511 This method makes a synchronous HTTP request by default. To make an 512 asynchronous HTTP request, please define a `callback` function 513 to be invoked when receiving the response. 514 >>> def callback_function(response): 515 >>> pprint(response) 516 >>> 517 >>> thread = api.get_power_form_data_with_http_info(account_id, power_form_id, callback=callback_function) 518 519 :param callback function: The callback function 520 for asynchronous request. (optional) 521 :param str account_id: The external account number (int) or account ID Guid. (required) 522 :param str power_form_id: (required) 523 :param str data_layout: 524 :param str from_date: 525 :param str to_date: 526 :return: PowerFormsFormDataResponse 527 If the method is called asynchronously, 528 returns the request thread. 529 """ 530 531 all_params = ['account_id', 'power_form_id', 'data_layout', 'from_date', 'to_date'] 532 all_params.append('callback') 533 all_params.append('_return_http_data_only') 534 all_params.append('_preload_content') 535 all_params.append('_request_timeout') 536 537 params = locals() 538 for key, val in iteritems(params['kwargs']): 539 if key not in all_params: 540 raise TypeError( 541 "Got an unexpected keyword argument '%s'" 542 " to method get_power_form_data" % key 543 ) 544 params[key] = val 545 del params['kwargs'] 546 # verify the required parameter 'account_id' is set 547 if ('account_id' not in params) or (params['account_id'] is None): 548 raise ValueError("Missing the required parameter `account_id` when calling `get_power_form_data`") 549 # verify the required parameter 'power_form_id' is set 550 if ('power_form_id' not in params) or (params['power_form_id'] is None): 551 raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form_data`") 552 553 554 collection_formats = {} 555 556 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}/form_data'.replace('{format}', 'json') 557 path_params = {} 558 if 'account_id' in params: 559 path_params['accountId'] = params['account_id'] 560 if 'power_form_id' in params: 561 path_params['powerFormId'] = params['power_form_id'] 562 563 query_params = {} 564 if 'data_layout' in params: 565 query_params['data_layout'] = params['data_layout'] 566 if 'from_date' in params: 567 query_params['from_date'] = params['from_date'] 568 if 'to_date' in params: 569 query_params['to_date'] = params['to_date'] 570 571 header_params = {} 572 573 form_params = [] 574 local_var_files = {} 575 576 body_params = None 577 # HTTP header `Accept` 578 header_params['Accept'] = self.api_client.\ 579 select_header_accept(['application/json']) 580 581 # Authentication setting 582 auth_settings = [] 583 584 return self.api_client.call_api(resource_path, 'GET', 585 path_params, 586 query_params, 587 header_params, 588 body=body_params, 589 post_params=form_params, 590 files=local_var_files, 591 response_type='PowerFormsFormDataResponse', 592 auth_settings=auth_settings, 593 callback=params.get('callback'), 594 _return_http_data_only=params.get('_return_http_data_only'), 595 _preload_content=params.get('_preload_content', True), 596 _request_timeout=params.get('_request_timeout'), 597 collection_formats=collection_formats) 598 599 def list_power_form_senders(self, account_id, **kwargs): 600 """ 601 Returns the list of PowerForms available to the user. 602 This method returns a list of users who have sent PowerForms. 603 This method makes a synchronous HTTP request by default. To make an 604 asynchronous HTTP request, please define a `callback` function 605 to be invoked when receiving the response. 606 >>> def callback_function(response): 607 >>> pprint(response) 608 >>> 609 >>> thread = api.list_power_form_senders(account_id, callback=callback_function) 610 611 :param callback function: The callback function 612 for asynchronous request. (optional) 613 :param str account_id: The external account number (int) or account ID Guid. (required) 614 :param str start_position: 615 :return: PowerFormSendersResponse 616 If the method is called asynchronously, 617 returns the request thread. 618 """ 619 kwargs['_return_http_data_only'] = True 620 if kwargs.get('callback'): 621 return self.list_power_form_senders_with_http_info(account_id, **kwargs) 622 else: 623 (data) = self.list_power_form_senders_with_http_info(account_id, **kwargs) 624 return data 625 626 def list_power_form_senders_with_http_info(self, account_id, **kwargs): 627 """ 628 Returns the list of PowerForms available to the user. 629 This method returns a list of users who have sent PowerForms. 630 This method makes a synchronous HTTP request by default. To make an 631 asynchronous HTTP request, please define a `callback` function 632 to be invoked when receiving the response. 633 >>> def callback_function(response): 634 >>> pprint(response) 635 >>> 636 >>> thread = api.list_power_form_senders_with_http_info(account_id, callback=callback_function) 637 638 :param callback function: The callback function 639 for asynchronous request. (optional) 640 :param str account_id: The external account number (int) or account ID Guid. (required) 641 :param str start_position: 642 :return: PowerFormSendersResponse 643 If the method is called asynchronously, 644 returns the request thread. 645 """ 646 647 all_params = ['account_id', 'start_position'] 648 all_params.append('callback') 649 all_params.append('_return_http_data_only') 650 all_params.append('_preload_content') 651 all_params.append('_request_timeout') 652 653 params = locals() 654 for key, val in iteritems(params['kwargs']): 655 if key not in all_params: 656 raise TypeError( 657 "Got an unexpected keyword argument '%s'" 658 " to method list_power_form_senders" % key 659 ) 660 params[key] = val 661 del params['kwargs'] 662 # verify the required parameter 'account_id' is set 663 if ('account_id' not in params) or (params['account_id'] is None): 664 raise ValueError("Missing the required parameter `account_id` when calling `list_power_form_senders`") 665 666 667 collection_formats = {} 668 669 resource_path = '/v2.1/accounts/{accountId}/powerforms/senders'.replace('{format}', 'json') 670 path_params = {} 671 if 'account_id' in params: 672 path_params['accountId'] = params['account_id'] 673 674 query_params = {} 675 if 'start_position' in params: 676 query_params['start_position'] = params['start_position'] 677 678 header_params = {} 679 680 form_params = [] 681 local_var_files = {} 682 683 body_params = None 684 # HTTP header `Accept` 685 header_params['Accept'] = self.api_client.\ 686 select_header_accept(['application/json']) 687 688 # Authentication setting 689 auth_settings = [] 690 691 return self.api_client.call_api(resource_path, 'GET', 692 path_params, 693 query_params, 694 header_params, 695 body=body_params, 696 post_params=form_params, 697 files=local_var_files, 698 response_type='PowerFormSendersResponse', 699 auth_settings=auth_settings, 700 callback=params.get('callback'), 701 _return_http_data_only=params.get('_return_http_data_only'), 702 _preload_content=params.get('_preload_content', True), 703 _request_timeout=params.get('_request_timeout'), 704 collection_formats=collection_formats) 705 706 def list_power_forms(self, account_id, **kwargs): 707 """ 708 Returns the list of PowerForms available to the user. 709 This method returns a list of PowerForms that are available to the user. 710 This method makes a synchronous HTTP request by default. To make an 711 asynchronous HTTP request, please define a `callback` function 712 to be invoked when receiving the response. 713 >>> def callback_function(response): 714 >>> pprint(response) 715 >>> 716 >>> thread = api.list_power_forms(account_id, callback=callback_function) 717 718 :param callback function: The callback function 719 for asynchronous request. (optional) 720 :param str account_id: The external account number (int) or account ID Guid. (required) 721 :param str count: 722 :param str from_date: 723 :param str order: 724 :param str order_by: 725 :param str search_fields: 726 :param str search_text: 727 :param str start_position: 728 :param str to_date: 729 :return: PowerFormsResponse 730 If the method is called asynchronously, 731 returns the request thread. 732 """ 733 kwargs['_return_http_data_only'] = True 734 if kwargs.get('callback'): 735 return self.list_power_forms_with_http_info(account_id, **kwargs) 736 else: 737 (data) = self.list_power_forms_with_http_info(account_id, **kwargs) 738 return data 739 740 def list_power_forms_with_http_info(self, account_id, **kwargs): 741 """ 742 Returns the list of PowerForms available to the user. 743 This method returns a list of PowerForms that are available to the user. 744 This method makes a synchronous HTTP request by default. To make an 745 asynchronous HTTP request, please define a `callback` function 746 to be invoked when receiving the response. 747 >>> def callback_function(response): 748 >>> pprint(response) 749 >>> 750 >>> thread = api.list_power_forms_with_http_info(account_id, callback=callback_function) 751 752 :param callback function: The callback function 753 for asynchronous request. (optional) 754 :param str account_id: The external account number (int) or account ID Guid. (required) 755 :param str count: 756 :param str from_date: 757 :param str order: 758 :param str order_by: 759 :param str search_fields: 760 :param str search_text: 761 :param str start_position: 762 :param str to_date: 763 :return: PowerFormsResponse 764 If the method is called asynchronously, 765 returns the request thread. 766 """ 767 768 all_params = ['account_id', 'count', 'from_date', 'order', 'order_by', 'search_fields', 'search_text', 'start_position', 'to_date'] 769 all_params.append('callback') 770 all_params.append('_return_http_data_only') 771 all_params.append('_preload_content') 772 all_params.append('_request_timeout') 773 774 params = locals() 775 for key, val in iteritems(params['kwargs']): 776 if key not in all_params: 777 raise TypeError( 778 "Got an unexpected keyword argument '%s'" 779 " to method list_power_forms" % key 780 ) 781 params[key] = val 782 del params['kwargs'] 783 # verify the required parameter 'account_id' is set 784 if ('account_id' not in params) or (params['account_id'] is None): 785 raise ValueError("Missing the required parameter `account_id` when calling `list_power_forms`") 786 787 788 collection_formats = {} 789 790 resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json') 791 path_params = {} 792 if 'account_id' in params: 793 path_params['accountId'] = params['account_id'] 794 795 query_params = {} 796 if 'count' in params: 797 query_params['count'] = params['count'] 798 if 'from_date' in params: 799 query_params['from_date'] = params['from_date'] 800 if 'order' in params: 801 query_params['order'] = params['order'] 802 if 'order_by' in params: 803 query_params['order_by'] = params['order_by'] 804 if 'search_fields' in params: 805 query_params['search_fields'] = params['search_fields'] 806 if 'search_text' in params: 807 query_params['search_text'] = params['search_text'] 808 if 'start_position' in params: 809 query_params['start_position'] = params['start_position'] 810 if 'to_date' in params: 811 query_params['to_date'] = params['to_date'] 812 813 header_params = {} 814 815 form_params = [] 816 local_var_files = {} 817 818 body_params = None 819 # HTTP header `Accept` 820 header_params['Accept'] = self.api_client.\ 821 select_header_accept(['application/json']) 822 823 # Authentication setting 824 auth_settings = [] 825 826 return self.api_client.call_api(resource_path, 'GET', 827 path_params, 828 query_params, 829 header_params, 830 body=body_params, 831 post_params=form_params, 832 files=local_var_files, 833 response_type='PowerFormsResponse', 834 auth_settings=auth_settings, 835 callback=params.get('callback'), 836 _return_http_data_only=params.get('_return_http_data_only'), 837 _preload_content=params.get('_preload_content', True), 838 _request_timeout=params.get('_request_timeout'), 839 collection_formats=collection_formats) 840 841 def update_power_form(self, account_id, power_form_id, **kwargs): 842 """ 843 Creates a new PowerForm. 844 This method updates an existing PowerForm. 845 This method makes a synchronous HTTP request by default. To make an 846 asynchronous HTTP request, please define a `callback` function 847 to be invoked when receiving the response. 848 >>> def callback_function(response): 849 >>> pprint(response) 850 >>> 851 >>> thread = api.update_power_form(account_id, power_form_id, callback=callback_function) 852 853 :param callback function: The callback function 854 for asynchronous request. (optional) 855 :param str account_id: The external account number (int) or account ID Guid. (required) 856 :param str power_form_id: (required) 857 :param PowerForm power_form: 858 :return: PowerForm 859 If the method is called asynchronously, 860 returns the request thread. 861 """ 862 kwargs['_return_http_data_only'] = True 863 if kwargs.get('callback'): 864 return self.update_power_form_with_http_info(account_id, power_form_id, **kwargs) 865 else: 866 (data) = self.update_power_form_with_http_info(account_id, power_form_id, **kwargs) 867 return data 868 869 def update_power_form_with_http_info(self, account_id, power_form_id, **kwargs): 870 """ 871 Creates a new PowerForm. 872 This method updates an existing PowerForm. 873 This method makes a synchronous HTTP request by default. To make an 874 asynchronous HTTP request, please define a `callback` function 875 to be invoked when receiving the response. 876 >>> def callback_function(response): 877 >>> pprint(response) 878 >>> 879 >>> thread = api.update_power_form_with_http_info(account_id, power_form_id, callback=callback_function) 880 881 :param callback function: The callback function 882 for asynchronous request. (optional) 883 :param str account_id: The external account number (int) or account ID Guid. (required) 884 :param str power_form_id: (required) 885 :param PowerForm power_form: 886 :return: PowerForm 887 If the method is called asynchronously, 888 returns the request thread. 889 """ 890 891 all_params = ['account_id', 'power_form_id', 'power_form'] 892 all_params.append('callback') 893 all_params.append('_return_http_data_only') 894 all_params.append('_preload_content') 895 all_params.append('_request_timeout') 896 897 params = locals() 898 for key, val in iteritems(params['kwargs']): 899 if key not in all_params: 900 raise TypeError( 901 "Got an unexpected keyword argument '%s'" 902 " to method update_power_form" % key 903 ) 904 params[key] = val 905 del params['kwargs'] 906 # verify the required parameter 'account_id' is set 907 if ('account_id' not in params) or (params['account_id'] is None): 908 raise ValueError("Missing the required parameter `account_id` when calling `update_power_form`") 909 # verify the required parameter 'power_form_id' is set 910 if ('power_form_id' not in params) or (params['power_form_id'] is None): 911 raise ValueError("Missing the required parameter `power_form_id` when calling `update_power_form`") 912 913 914 collection_formats = {} 915 916 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json') 917 path_params = {} 918 if 'account_id' in params: 919 path_params['accountId'] = params['account_id'] 920 if 'power_form_id' in params: 921 path_params['powerFormId'] = params['power_form_id'] 922 923 query_params = {} 924 925 header_params = {} 926 927 form_params = [] 928 local_var_files = {} 929 930 body_params = None 931 if 'power_form' in params: 932 body_params = params['power_form'] 933 # HTTP header `Accept` 934 header_params['Accept'] = self.api_client.\ 935 select_header_accept(['application/json']) 936 937 # Authentication setting 938 auth_settings = [] 939 940 return self.api_client.call_api(resource_path, 'PUT', 941 path_params, 942 query_params, 943 header_params, 944 body=body_params, 945 post_params=form_params, 946 files=local_var_files, 947 response_type='PowerForm', 948 auth_settings=auth_settings, 949 callback=params.get('callback'), 950 _return_http_data_only=params.get('_return_http_data_only'), 951 _preload_content=params.get('_preload_content', True), 952 _request_timeout=params.get('_request_timeout'), 953 collection_formats=collection_formats)
28class PowerFormsApi(object): 29 """ 30 NOTE: This class is auto generated by the swagger code generator program. 31 Do not edit the class manually. 32 Ref: https://github.com/swagger-api/swagger-codegen 33 """ 34 35 def __init__(self, api_client=None): 36 config = Configuration() 37 if api_client: 38 self.api_client = api_client 39 else: 40 if not config.api_client: 41 config.api_client = ApiClient() 42 self.api_client = config.api_client 43 44 def create_power_form(self, account_id, **kwargs): 45 """ 46 Creates a new PowerForm. 47 This method creates a new PowerForm. You create a PowerForm from an existing DocuSign [template](/docs/esign-rest-api/reference/templates/templates/create/), based on the `templateId` in the request body. PowerForms that you create from a template are referred to as *web PowerForms*. **Note:** The DocuSign Admin console also supports creating a PowerForm by uploading a PDF file that has active form fields (referred to as a *PDF PowerForm*). However, PDF PowerForms are deprecated and are not supported in the API. **Note:** A PowerForm can have only one sender. (Because PowerForms are not necessarily sent by email, this user is also referred to as the PowerForm *initiator*.) If you need to associate multiple senders with a PowerForm, create multiple copies of the PowerForm by using the same template (one copy for each sender). By default, the sender is the PowerForm Administrator who creates the PowerForm. ### Signing modes You can use one of the following signing modes for a PowerForm: **`email`** This mode verifies the recipient's identity by using email authentication before the recipient can sign a document. The recipient enters their email address on the landing page and then clicks **Begin Signing** to begin the signing process. The system then sends an email message with a validation code to the recipient. If the recipient does not provide a valid email address, they do not receive the email message containing the access code and are not able to open and sign the document. Alternatively, you can make the process easier for signers by using email authentication only and omitting the access code. To do this, you append the `activateonly` flag to the PowerForm URL and set it to true by passing in the value `1`. When the flag is active, the first recipient receives an email with a link that initiates the signing session without having to enter access code. Example: `activateonly=1` **`direct`** This mode does not require any verification. After a recipient enters their email address on the landing page and clicks **Begin Signing,** a new browser tab opens and the recipient can immediately begin the signing process. Because the `direct` signing mode does not verify the recipient's identity by using email authentication, we strongly recommend that you use this mode only when the PowerForm is accessible behind a secure portal where the recipient's identity is already authenticated, or where another form of authentication is specified for the recipient in the DocuSign template (for example, an access code, phone authentication, or ID check). **Note:** In the account settings, `enablePowerFormDirect` must be **true** to use `direct` as the `signingMode`. ### Redirect URLs You can control the URL to which signers are redirected after signing your PowerForm. However, the URL is specified elsewhere, outside of the PowerForm creation process. For details, see [How do I specify a URL to redirect to when a PowerForm is completed?](https://support.docusign.com/en/articles/How-do-I-specify-a-URL-to-redirect-to-when-a-Powerform-is-completed). ### More information For more information about creating PowerForms, see [Create a PowerForm](https://support.docusign.com/en/guides/ndse-user-guide-create-a-powerform). 48 This method makes a synchronous HTTP request by default. To make an 49 asynchronous HTTP request, please define a `callback` function 50 to be invoked when receiving the response. 51 >>> def callback_function(response): 52 >>> pprint(response) 53 >>> 54 >>> thread = api.create_power_form(account_id, callback=callback_function) 55 56 :param callback function: The callback function 57 for asynchronous request. (optional) 58 :param str account_id: The external account number (int) or account ID Guid. (required) 59 :param PowerForm power_form: 60 :return: PowerForm 61 If the method is called asynchronously, 62 returns the request thread. 63 """ 64 kwargs['_return_http_data_only'] = True 65 if kwargs.get('callback'): 66 return self.create_power_form_with_http_info(account_id, **kwargs) 67 else: 68 (data) = self.create_power_form_with_http_info(account_id, **kwargs) 69 return data 70 71 def create_power_form_with_http_info(self, account_id, **kwargs): 72 """ 73 Creates a new PowerForm. 74 This method creates a new PowerForm. You create a PowerForm from an existing DocuSign [template](/docs/esign-rest-api/reference/templates/templates/create/), based on the `templateId` in the request body. PowerForms that you create from a template are referred to as *web PowerForms*. **Note:** The DocuSign Admin console also supports creating a PowerForm by uploading a PDF file that has active form fields (referred to as a *PDF PowerForm*). However, PDF PowerForms are deprecated and are not supported in the API. **Note:** A PowerForm can have only one sender. (Because PowerForms are not necessarily sent by email, this user is also referred to as the PowerForm *initiator*.) If you need to associate multiple senders with a PowerForm, create multiple copies of the PowerForm by using the same template (one copy for each sender). By default, the sender is the PowerForm Administrator who creates the PowerForm. ### Signing modes You can use one of the following signing modes for a PowerForm: **`email`** This mode verifies the recipient's identity by using email authentication before the recipient can sign a document. The recipient enters their email address on the landing page and then clicks **Begin Signing** to begin the signing process. The system then sends an email message with a validation code to the recipient. If the recipient does not provide a valid email address, they do not receive the email message containing the access code and are not able to open and sign the document. Alternatively, you can make the process easier for signers by using email authentication only and omitting the access code. To do this, you append the `activateonly` flag to the PowerForm URL and set it to true by passing in the value `1`. When the flag is active, the first recipient receives an email with a link that initiates the signing session without having to enter access code. Example: `activateonly=1` **`direct`** This mode does not require any verification. After a recipient enters their email address on the landing page and clicks **Begin Signing,** a new browser tab opens and the recipient can immediately begin the signing process. Because the `direct` signing mode does not verify the recipient's identity by using email authentication, we strongly recommend that you use this mode only when the PowerForm is accessible behind a secure portal where the recipient's identity is already authenticated, or where another form of authentication is specified for the recipient in the DocuSign template (for example, an access code, phone authentication, or ID check). **Note:** In the account settings, `enablePowerFormDirect` must be **true** to use `direct` as the `signingMode`. ### Redirect URLs You can control the URL to which signers are redirected after signing your PowerForm. However, the URL is specified elsewhere, outside of the PowerForm creation process. For details, see [How do I specify a URL to redirect to when a PowerForm is completed?](https://support.docusign.com/en/articles/How-do-I-specify-a-URL-to-redirect-to-when-a-Powerform-is-completed). ### More information For more information about creating PowerForms, see [Create a PowerForm](https://support.docusign.com/en/guides/ndse-user-guide-create-a-powerform). 75 This method makes a synchronous HTTP request by default. To make an 76 asynchronous HTTP request, please define a `callback` function 77 to be invoked when receiving the response. 78 >>> def callback_function(response): 79 >>> pprint(response) 80 >>> 81 >>> thread = api.create_power_form_with_http_info(account_id, callback=callback_function) 82 83 :param callback function: The callback function 84 for asynchronous request. (optional) 85 :param str account_id: The external account number (int) or account ID Guid. (required) 86 :param PowerForm power_form: 87 :return: PowerForm 88 If the method is called asynchronously, 89 returns the request thread. 90 """ 91 92 all_params = ['account_id', 'power_form'] 93 all_params.append('callback') 94 all_params.append('_return_http_data_only') 95 all_params.append('_preload_content') 96 all_params.append('_request_timeout') 97 98 params = locals() 99 for key, val in iteritems(params['kwargs']): 100 if key not in all_params: 101 raise TypeError( 102 "Got an unexpected keyword argument '%s'" 103 " to method create_power_form" % key 104 ) 105 params[key] = val 106 del params['kwargs'] 107 # verify the required parameter 'account_id' is set 108 if ('account_id' not in params) or (params['account_id'] is None): 109 raise ValueError("Missing the required parameter `account_id` when calling `create_power_form`") 110 111 112 collection_formats = {} 113 114 resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json') 115 path_params = {} 116 if 'account_id' in params: 117 path_params['accountId'] = params['account_id'] 118 119 query_params = {} 120 121 header_params = {} 122 123 form_params = [] 124 local_var_files = {} 125 126 body_params = None 127 if 'power_form' in params: 128 body_params = params['power_form'] 129 # HTTP header `Accept` 130 header_params['Accept'] = self.api_client.\ 131 select_header_accept(['application/json']) 132 133 # Authentication setting 134 auth_settings = [] 135 136 return self.api_client.call_api(resource_path, 'POST', 137 path_params, 138 query_params, 139 header_params, 140 body=body_params, 141 post_params=form_params, 142 files=local_var_files, 143 response_type='PowerForm', 144 auth_settings=auth_settings, 145 callback=params.get('callback'), 146 _return_http_data_only=params.get('_return_http_data_only'), 147 _preload_content=params.get('_preload_content', True), 148 _request_timeout=params.get('_request_timeout'), 149 collection_formats=collection_formats) 150 151 def delete_power_form(self, account_id, power_form_id, **kwargs): 152 """ 153 Delete a PowerForm. 154 This method deletes a PowerForm. 155 This method makes a synchronous HTTP request by default. To make an 156 asynchronous HTTP request, please define a `callback` function 157 to be invoked when receiving the response. 158 >>> def callback_function(response): 159 >>> pprint(response) 160 >>> 161 >>> thread = api.delete_power_form(account_id, power_form_id, callback=callback_function) 162 163 :param callback function: The callback function 164 for asynchronous request. (optional) 165 :param str account_id: The external account number (int) or account ID Guid. (required) 166 :param str power_form_id: (required) 167 :return: None 168 If the method is called asynchronously, 169 returns the request thread. 170 """ 171 kwargs['_return_http_data_only'] = True 172 if kwargs.get('callback'): 173 return self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs) 174 else: 175 (data) = self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs) 176 return data 177 178 def delete_power_form_with_http_info(self, account_id, power_form_id, **kwargs): 179 """ 180 Delete a PowerForm. 181 This method deletes a PowerForm. 182 This method makes a synchronous HTTP request by default. To make an 183 asynchronous HTTP request, please define a `callback` function 184 to be invoked when receiving the response. 185 >>> def callback_function(response): 186 >>> pprint(response) 187 >>> 188 >>> thread = api.delete_power_form_with_http_info(account_id, power_form_id, callback=callback_function) 189 190 :param callback function: The callback function 191 for asynchronous request. (optional) 192 :param str account_id: The external account number (int) or account ID Guid. (required) 193 :param str power_form_id: (required) 194 :return: None 195 If the method is called asynchronously, 196 returns the request thread. 197 """ 198 199 all_params = ['account_id', 'power_form_id'] 200 all_params.append('callback') 201 all_params.append('_return_http_data_only') 202 all_params.append('_preload_content') 203 all_params.append('_request_timeout') 204 205 params = locals() 206 for key, val in iteritems(params['kwargs']): 207 if key not in all_params: 208 raise TypeError( 209 "Got an unexpected keyword argument '%s'" 210 " to method delete_power_form" % key 211 ) 212 params[key] = val 213 del params['kwargs'] 214 # verify the required parameter 'account_id' is set 215 if ('account_id' not in params) or (params['account_id'] is None): 216 raise ValueError("Missing the required parameter `account_id` when calling `delete_power_form`") 217 # verify the required parameter 'power_form_id' is set 218 if ('power_form_id' not in params) or (params['power_form_id'] is None): 219 raise ValueError("Missing the required parameter `power_form_id` when calling `delete_power_form`") 220 221 222 collection_formats = {} 223 224 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json') 225 path_params = {} 226 if 'account_id' in params: 227 path_params['accountId'] = params['account_id'] 228 if 'power_form_id' in params: 229 path_params['powerFormId'] = params['power_form_id'] 230 231 query_params = {} 232 233 header_params = {} 234 235 form_params = [] 236 local_var_files = {} 237 238 body_params = None 239 # HTTP header `Accept` 240 header_params['Accept'] = self.api_client.\ 241 select_header_accept(['application/json']) 242 243 # Authentication setting 244 auth_settings = [] 245 246 return self.api_client.call_api(resource_path, 'DELETE', 247 path_params, 248 query_params, 249 header_params, 250 body=body_params, 251 post_params=form_params, 252 files=local_var_files, 253 response_type=None, 254 auth_settings=auth_settings, 255 callback=params.get('callback'), 256 _return_http_data_only=params.get('_return_http_data_only'), 257 _preload_content=params.get('_preload_content', True), 258 _request_timeout=params.get('_request_timeout'), 259 collection_formats=collection_formats) 260 261 def delete_power_forms(self, account_id, **kwargs): 262 """ 263 Deletes one or more PowerForms 264 This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`. 265 This method makes a synchronous HTTP request by default. To make an 266 asynchronous HTTP request, please define a `callback` function 267 to be invoked when receiving the response. 268 >>> def callback_function(response): 269 >>> pprint(response) 270 >>> 271 >>> thread = api.delete_power_forms(account_id, callback=callback_function) 272 273 :param callback function: The callback function 274 for asynchronous request. (optional) 275 :param str account_id: The external account number (int) or account ID Guid. (required) 276 :param PowerFormsRequest power_forms_request: 277 :return: PowerFormsResponse 278 If the method is called asynchronously, 279 returns the request thread. 280 """ 281 kwargs['_return_http_data_only'] = True 282 if kwargs.get('callback'): 283 return self.delete_power_forms_with_http_info(account_id, **kwargs) 284 else: 285 (data) = self.delete_power_forms_with_http_info(account_id, **kwargs) 286 return data 287 288 def delete_power_forms_with_http_info(self, account_id, **kwargs): 289 """ 290 Deletes one or more PowerForms 291 This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`. 292 This method makes a synchronous HTTP request by default. To make an 293 asynchronous HTTP request, please define a `callback` function 294 to be invoked when receiving the response. 295 >>> def callback_function(response): 296 >>> pprint(response) 297 >>> 298 >>> thread = api.delete_power_forms_with_http_info(account_id, callback=callback_function) 299 300 :param callback function: The callback function 301 for asynchronous request. (optional) 302 :param str account_id: The external account number (int) or account ID Guid. (required) 303 :param PowerFormsRequest power_forms_request: 304 :return: PowerFormsResponse 305 If the method is called asynchronously, 306 returns the request thread. 307 """ 308 309 all_params = ['account_id', 'power_forms_request'] 310 all_params.append('callback') 311 all_params.append('_return_http_data_only') 312 all_params.append('_preload_content') 313 all_params.append('_request_timeout') 314 315 params = locals() 316 for key, val in iteritems(params['kwargs']): 317 if key not in all_params: 318 raise TypeError( 319 "Got an unexpected keyword argument '%s'" 320 " to method delete_power_forms" % key 321 ) 322 params[key] = val 323 del params['kwargs'] 324 # verify the required parameter 'account_id' is set 325 if ('account_id' not in params) or (params['account_id'] is None): 326 raise ValueError("Missing the required parameter `account_id` when calling `delete_power_forms`") 327 328 329 collection_formats = {} 330 331 resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json') 332 path_params = {} 333 if 'account_id' in params: 334 path_params['accountId'] = params['account_id'] 335 336 query_params = {} 337 338 header_params = {} 339 340 form_params = [] 341 local_var_files = {} 342 343 body_params = None 344 if 'power_forms_request' in params: 345 body_params = params['power_forms_request'] 346 # HTTP header `Accept` 347 header_params['Accept'] = self.api_client.\ 348 select_header_accept(['application/json']) 349 350 # Authentication setting 351 auth_settings = [] 352 353 return self.api_client.call_api(resource_path, 'DELETE', 354 path_params, 355 query_params, 356 header_params, 357 body=body_params, 358 post_params=form_params, 359 files=local_var_files, 360 response_type='PowerFormsResponse', 361 auth_settings=auth_settings, 362 callback=params.get('callback'), 363 _return_http_data_only=params.get('_return_http_data_only'), 364 _preload_content=params.get('_preload_content', True), 365 _request_timeout=params.get('_request_timeout'), 366 collection_formats=collection_formats) 367 368 def get_power_form(self, account_id, power_form_id, **kwargs): 369 """ 370 Returns a single PowerForm. 371 This method returns detailed information about a specific PowerForm. 372 This method makes a synchronous HTTP request by default. To make an 373 asynchronous HTTP request, please define a `callback` function 374 to be invoked when receiving the response. 375 >>> def callback_function(response): 376 >>> pprint(response) 377 >>> 378 >>> thread = api.get_power_form(account_id, power_form_id, callback=callback_function) 379 380 :param callback function: The callback function 381 for asynchronous request. (optional) 382 :param str account_id: The external account number (int) or account ID Guid. (required) 383 :param str power_form_id: (required) 384 :return: PowerForm 385 If the method is called asynchronously, 386 returns the request thread. 387 """ 388 kwargs['_return_http_data_only'] = True 389 if kwargs.get('callback'): 390 return self.get_power_form_with_http_info(account_id, power_form_id, **kwargs) 391 else: 392 (data) = self.get_power_form_with_http_info(account_id, power_form_id, **kwargs) 393 return data 394 395 def get_power_form_with_http_info(self, account_id, power_form_id, **kwargs): 396 """ 397 Returns a single PowerForm. 398 This method returns detailed information about a specific PowerForm. 399 This method makes a synchronous HTTP request by default. To make an 400 asynchronous HTTP request, please define a `callback` function 401 to be invoked when receiving the response. 402 >>> def callback_function(response): 403 >>> pprint(response) 404 >>> 405 >>> thread = api.get_power_form_with_http_info(account_id, power_form_id, callback=callback_function) 406 407 :param callback function: The callback function 408 for asynchronous request. (optional) 409 :param str account_id: The external account number (int) or account ID Guid. (required) 410 :param str power_form_id: (required) 411 :return: PowerForm 412 If the method is called asynchronously, 413 returns the request thread. 414 """ 415 416 all_params = ['account_id', 'power_form_id'] 417 all_params.append('callback') 418 all_params.append('_return_http_data_only') 419 all_params.append('_preload_content') 420 all_params.append('_request_timeout') 421 422 params = locals() 423 for key, val in iteritems(params['kwargs']): 424 if key not in all_params: 425 raise TypeError( 426 "Got an unexpected keyword argument '%s'" 427 " to method get_power_form" % key 428 ) 429 params[key] = val 430 del params['kwargs'] 431 # verify the required parameter 'account_id' is set 432 if ('account_id' not in params) or (params['account_id'] is None): 433 raise ValueError("Missing the required parameter `account_id` when calling `get_power_form`") 434 # verify the required parameter 'power_form_id' is set 435 if ('power_form_id' not in params) or (params['power_form_id'] is None): 436 raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form`") 437 438 439 collection_formats = {} 440 441 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json') 442 path_params = {} 443 if 'account_id' in params: 444 path_params['accountId'] = params['account_id'] 445 if 'power_form_id' in params: 446 path_params['powerFormId'] = params['power_form_id'] 447 448 query_params = {} 449 450 header_params = {} 451 452 form_params = [] 453 local_var_files = {} 454 455 body_params = None 456 # HTTP header `Accept` 457 header_params['Accept'] = self.api_client.\ 458 select_header_accept(['application/json']) 459 460 # Authentication setting 461 auth_settings = [] 462 463 return self.api_client.call_api(resource_path, 'GET', 464 path_params, 465 query_params, 466 header_params, 467 body=body_params, 468 post_params=form_params, 469 files=local_var_files, 470 response_type='PowerForm', 471 auth_settings=auth_settings, 472 callback=params.get('callback'), 473 _return_http_data_only=params.get('_return_http_data_only'), 474 _preload_content=params.get('_preload_content', True), 475 _request_timeout=params.get('_request_timeout'), 476 collection_formats=collection_formats) 477 478 def get_power_form_data(self, account_id, power_form_id, **kwargs): 479 """ 480 Returns the form data associated with the usage of a PowerForm. 481 This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm. You specify the format in which you want to retrieve the data in the `Accept` header. This header accepts the following values: - `application/json`: JSON format - `application/xml`: XML format - `text/csv`: Comma-separated value (CSV) format **Note:** Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm. 482 This method makes a synchronous HTTP request by default. To make an 483 asynchronous HTTP request, please define a `callback` function 484 to be invoked when receiving the response. 485 >>> def callback_function(response): 486 >>> pprint(response) 487 >>> 488 >>> thread = api.get_power_form_data(account_id, power_form_id, callback=callback_function) 489 490 :param callback function: The callback function 491 for asynchronous request. (optional) 492 :param str account_id: The external account number (int) or account ID Guid. (required) 493 :param str power_form_id: (required) 494 :param str data_layout: 495 :param str from_date: 496 :param str to_date: 497 :return: PowerFormsFormDataResponse 498 If the method is called asynchronously, 499 returns the request thread. 500 """ 501 kwargs['_return_http_data_only'] = True 502 if kwargs.get('callback'): 503 return self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs) 504 else: 505 (data) = self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs) 506 return data 507 508 def get_power_form_data_with_http_info(self, account_id, power_form_id, **kwargs): 509 """ 510 Returns the form data associated with the usage of a PowerForm. 511 This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm. You specify the format in which you want to retrieve the data in the `Accept` header. This header accepts the following values: - `application/json`: JSON format - `application/xml`: XML format - `text/csv`: Comma-separated value (CSV) format **Note:** Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm. 512 This method makes a synchronous HTTP request by default. To make an 513 asynchronous HTTP request, please define a `callback` function 514 to be invoked when receiving the response. 515 >>> def callback_function(response): 516 >>> pprint(response) 517 >>> 518 >>> thread = api.get_power_form_data_with_http_info(account_id, power_form_id, callback=callback_function) 519 520 :param callback function: The callback function 521 for asynchronous request. (optional) 522 :param str account_id: The external account number (int) or account ID Guid. (required) 523 :param str power_form_id: (required) 524 :param str data_layout: 525 :param str from_date: 526 :param str to_date: 527 :return: PowerFormsFormDataResponse 528 If the method is called asynchronously, 529 returns the request thread. 530 """ 531 532 all_params = ['account_id', 'power_form_id', 'data_layout', 'from_date', 'to_date'] 533 all_params.append('callback') 534 all_params.append('_return_http_data_only') 535 all_params.append('_preload_content') 536 all_params.append('_request_timeout') 537 538 params = locals() 539 for key, val in iteritems(params['kwargs']): 540 if key not in all_params: 541 raise TypeError( 542 "Got an unexpected keyword argument '%s'" 543 " to method get_power_form_data" % key 544 ) 545 params[key] = val 546 del params['kwargs'] 547 # verify the required parameter 'account_id' is set 548 if ('account_id' not in params) or (params['account_id'] is None): 549 raise ValueError("Missing the required parameter `account_id` when calling `get_power_form_data`") 550 # verify the required parameter 'power_form_id' is set 551 if ('power_form_id' not in params) or (params['power_form_id'] is None): 552 raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form_data`") 553 554 555 collection_formats = {} 556 557 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}/form_data'.replace('{format}', 'json') 558 path_params = {} 559 if 'account_id' in params: 560 path_params['accountId'] = params['account_id'] 561 if 'power_form_id' in params: 562 path_params['powerFormId'] = params['power_form_id'] 563 564 query_params = {} 565 if 'data_layout' in params: 566 query_params['data_layout'] = params['data_layout'] 567 if 'from_date' in params: 568 query_params['from_date'] = params['from_date'] 569 if 'to_date' in params: 570 query_params['to_date'] = params['to_date'] 571 572 header_params = {} 573 574 form_params = [] 575 local_var_files = {} 576 577 body_params = None 578 # HTTP header `Accept` 579 header_params['Accept'] = self.api_client.\ 580 select_header_accept(['application/json']) 581 582 # Authentication setting 583 auth_settings = [] 584 585 return self.api_client.call_api(resource_path, 'GET', 586 path_params, 587 query_params, 588 header_params, 589 body=body_params, 590 post_params=form_params, 591 files=local_var_files, 592 response_type='PowerFormsFormDataResponse', 593 auth_settings=auth_settings, 594 callback=params.get('callback'), 595 _return_http_data_only=params.get('_return_http_data_only'), 596 _preload_content=params.get('_preload_content', True), 597 _request_timeout=params.get('_request_timeout'), 598 collection_formats=collection_formats) 599 600 def list_power_form_senders(self, account_id, **kwargs): 601 """ 602 Returns the list of PowerForms available to the user. 603 This method returns a list of users who have sent PowerForms. 604 This method makes a synchronous HTTP request by default. To make an 605 asynchronous HTTP request, please define a `callback` function 606 to be invoked when receiving the response. 607 >>> def callback_function(response): 608 >>> pprint(response) 609 >>> 610 >>> thread = api.list_power_form_senders(account_id, callback=callback_function) 611 612 :param callback function: The callback function 613 for asynchronous request. (optional) 614 :param str account_id: The external account number (int) or account ID Guid. (required) 615 :param str start_position: 616 :return: PowerFormSendersResponse 617 If the method is called asynchronously, 618 returns the request thread. 619 """ 620 kwargs['_return_http_data_only'] = True 621 if kwargs.get('callback'): 622 return self.list_power_form_senders_with_http_info(account_id, **kwargs) 623 else: 624 (data) = self.list_power_form_senders_with_http_info(account_id, **kwargs) 625 return data 626 627 def list_power_form_senders_with_http_info(self, account_id, **kwargs): 628 """ 629 Returns the list of PowerForms available to the user. 630 This method returns a list of users who have sent PowerForms. 631 This method makes a synchronous HTTP request by default. To make an 632 asynchronous HTTP request, please define a `callback` function 633 to be invoked when receiving the response. 634 >>> def callback_function(response): 635 >>> pprint(response) 636 >>> 637 >>> thread = api.list_power_form_senders_with_http_info(account_id, callback=callback_function) 638 639 :param callback function: The callback function 640 for asynchronous request. (optional) 641 :param str account_id: The external account number (int) or account ID Guid. (required) 642 :param str start_position: 643 :return: PowerFormSendersResponse 644 If the method is called asynchronously, 645 returns the request thread. 646 """ 647 648 all_params = ['account_id', 'start_position'] 649 all_params.append('callback') 650 all_params.append('_return_http_data_only') 651 all_params.append('_preload_content') 652 all_params.append('_request_timeout') 653 654 params = locals() 655 for key, val in iteritems(params['kwargs']): 656 if key not in all_params: 657 raise TypeError( 658 "Got an unexpected keyword argument '%s'" 659 " to method list_power_form_senders" % key 660 ) 661 params[key] = val 662 del params['kwargs'] 663 # verify the required parameter 'account_id' is set 664 if ('account_id' not in params) or (params['account_id'] is None): 665 raise ValueError("Missing the required parameter `account_id` when calling `list_power_form_senders`") 666 667 668 collection_formats = {} 669 670 resource_path = '/v2.1/accounts/{accountId}/powerforms/senders'.replace('{format}', 'json') 671 path_params = {} 672 if 'account_id' in params: 673 path_params['accountId'] = params['account_id'] 674 675 query_params = {} 676 if 'start_position' in params: 677 query_params['start_position'] = params['start_position'] 678 679 header_params = {} 680 681 form_params = [] 682 local_var_files = {} 683 684 body_params = None 685 # HTTP header `Accept` 686 header_params['Accept'] = self.api_client.\ 687 select_header_accept(['application/json']) 688 689 # Authentication setting 690 auth_settings = [] 691 692 return self.api_client.call_api(resource_path, 'GET', 693 path_params, 694 query_params, 695 header_params, 696 body=body_params, 697 post_params=form_params, 698 files=local_var_files, 699 response_type='PowerFormSendersResponse', 700 auth_settings=auth_settings, 701 callback=params.get('callback'), 702 _return_http_data_only=params.get('_return_http_data_only'), 703 _preload_content=params.get('_preload_content', True), 704 _request_timeout=params.get('_request_timeout'), 705 collection_formats=collection_formats) 706 707 def list_power_forms(self, account_id, **kwargs): 708 """ 709 Returns the list of PowerForms available to the user. 710 This method returns a list of PowerForms that are available to the user. 711 This method makes a synchronous HTTP request by default. To make an 712 asynchronous HTTP request, please define a `callback` function 713 to be invoked when receiving the response. 714 >>> def callback_function(response): 715 >>> pprint(response) 716 >>> 717 >>> thread = api.list_power_forms(account_id, callback=callback_function) 718 719 :param callback function: The callback function 720 for asynchronous request. (optional) 721 :param str account_id: The external account number (int) or account ID Guid. (required) 722 :param str count: 723 :param str from_date: 724 :param str order: 725 :param str order_by: 726 :param str search_fields: 727 :param str search_text: 728 :param str start_position: 729 :param str to_date: 730 :return: PowerFormsResponse 731 If the method is called asynchronously, 732 returns the request thread. 733 """ 734 kwargs['_return_http_data_only'] = True 735 if kwargs.get('callback'): 736 return self.list_power_forms_with_http_info(account_id, **kwargs) 737 else: 738 (data) = self.list_power_forms_with_http_info(account_id, **kwargs) 739 return data 740 741 def list_power_forms_with_http_info(self, account_id, **kwargs): 742 """ 743 Returns the list of PowerForms available to the user. 744 This method returns a list of PowerForms that are available to the user. 745 This method makes a synchronous HTTP request by default. To make an 746 asynchronous HTTP request, please define a `callback` function 747 to be invoked when receiving the response. 748 >>> def callback_function(response): 749 >>> pprint(response) 750 >>> 751 >>> thread = api.list_power_forms_with_http_info(account_id, callback=callback_function) 752 753 :param callback function: The callback function 754 for asynchronous request. (optional) 755 :param str account_id: The external account number (int) or account ID Guid. (required) 756 :param str count: 757 :param str from_date: 758 :param str order: 759 :param str order_by: 760 :param str search_fields: 761 :param str search_text: 762 :param str start_position: 763 :param str to_date: 764 :return: PowerFormsResponse 765 If the method is called asynchronously, 766 returns the request thread. 767 """ 768 769 all_params = ['account_id', 'count', 'from_date', 'order', 'order_by', 'search_fields', 'search_text', 'start_position', 'to_date'] 770 all_params.append('callback') 771 all_params.append('_return_http_data_only') 772 all_params.append('_preload_content') 773 all_params.append('_request_timeout') 774 775 params = locals() 776 for key, val in iteritems(params['kwargs']): 777 if key not in all_params: 778 raise TypeError( 779 "Got an unexpected keyword argument '%s'" 780 " to method list_power_forms" % key 781 ) 782 params[key] = val 783 del params['kwargs'] 784 # verify the required parameter 'account_id' is set 785 if ('account_id' not in params) or (params['account_id'] is None): 786 raise ValueError("Missing the required parameter `account_id` when calling `list_power_forms`") 787 788 789 collection_formats = {} 790 791 resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json') 792 path_params = {} 793 if 'account_id' in params: 794 path_params['accountId'] = params['account_id'] 795 796 query_params = {} 797 if 'count' in params: 798 query_params['count'] = params['count'] 799 if 'from_date' in params: 800 query_params['from_date'] = params['from_date'] 801 if 'order' in params: 802 query_params['order'] = params['order'] 803 if 'order_by' in params: 804 query_params['order_by'] = params['order_by'] 805 if 'search_fields' in params: 806 query_params['search_fields'] = params['search_fields'] 807 if 'search_text' in params: 808 query_params['search_text'] = params['search_text'] 809 if 'start_position' in params: 810 query_params['start_position'] = params['start_position'] 811 if 'to_date' in params: 812 query_params['to_date'] = params['to_date'] 813 814 header_params = {} 815 816 form_params = [] 817 local_var_files = {} 818 819 body_params = None 820 # HTTP header `Accept` 821 header_params['Accept'] = self.api_client.\ 822 select_header_accept(['application/json']) 823 824 # Authentication setting 825 auth_settings = [] 826 827 return self.api_client.call_api(resource_path, 'GET', 828 path_params, 829 query_params, 830 header_params, 831 body=body_params, 832 post_params=form_params, 833 files=local_var_files, 834 response_type='PowerFormsResponse', 835 auth_settings=auth_settings, 836 callback=params.get('callback'), 837 _return_http_data_only=params.get('_return_http_data_only'), 838 _preload_content=params.get('_preload_content', True), 839 _request_timeout=params.get('_request_timeout'), 840 collection_formats=collection_formats) 841 842 def update_power_form(self, account_id, power_form_id, **kwargs): 843 """ 844 Creates a new PowerForm. 845 This method updates an existing PowerForm. 846 This method makes a synchronous HTTP request by default. To make an 847 asynchronous HTTP request, please define a `callback` function 848 to be invoked when receiving the response. 849 >>> def callback_function(response): 850 >>> pprint(response) 851 >>> 852 >>> thread = api.update_power_form(account_id, power_form_id, callback=callback_function) 853 854 :param callback function: The callback function 855 for asynchronous request. (optional) 856 :param str account_id: The external account number (int) or account ID Guid. (required) 857 :param str power_form_id: (required) 858 :param PowerForm power_form: 859 :return: PowerForm 860 If the method is called asynchronously, 861 returns the request thread. 862 """ 863 kwargs['_return_http_data_only'] = True 864 if kwargs.get('callback'): 865 return self.update_power_form_with_http_info(account_id, power_form_id, **kwargs) 866 else: 867 (data) = self.update_power_form_with_http_info(account_id, power_form_id, **kwargs) 868 return data 869 870 def update_power_form_with_http_info(self, account_id, power_form_id, **kwargs): 871 """ 872 Creates a new PowerForm. 873 This method updates an existing PowerForm. 874 This method makes a synchronous HTTP request by default. To make an 875 asynchronous HTTP request, please define a `callback` function 876 to be invoked when receiving the response. 877 >>> def callback_function(response): 878 >>> pprint(response) 879 >>> 880 >>> thread = api.update_power_form_with_http_info(account_id, power_form_id, callback=callback_function) 881 882 :param callback function: The callback function 883 for asynchronous request. (optional) 884 :param str account_id: The external account number (int) or account ID Guid. (required) 885 :param str power_form_id: (required) 886 :param PowerForm power_form: 887 :return: PowerForm 888 If the method is called asynchronously, 889 returns the request thread. 890 """ 891 892 all_params = ['account_id', 'power_form_id', 'power_form'] 893 all_params.append('callback') 894 all_params.append('_return_http_data_only') 895 all_params.append('_preload_content') 896 all_params.append('_request_timeout') 897 898 params = locals() 899 for key, val in iteritems(params['kwargs']): 900 if key not in all_params: 901 raise TypeError( 902 "Got an unexpected keyword argument '%s'" 903 " to method update_power_form" % key 904 ) 905 params[key] = val 906 del params['kwargs'] 907 # verify the required parameter 'account_id' is set 908 if ('account_id' not in params) or (params['account_id'] is None): 909 raise ValueError("Missing the required parameter `account_id` when calling `update_power_form`") 910 # verify the required parameter 'power_form_id' is set 911 if ('power_form_id' not in params) or (params['power_form_id'] is None): 912 raise ValueError("Missing the required parameter `power_form_id` when calling `update_power_form`") 913 914 915 collection_formats = {} 916 917 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json') 918 path_params = {} 919 if 'account_id' in params: 920 path_params['accountId'] = params['account_id'] 921 if 'power_form_id' in params: 922 path_params['powerFormId'] = params['power_form_id'] 923 924 query_params = {} 925 926 header_params = {} 927 928 form_params = [] 929 local_var_files = {} 930 931 body_params = None 932 if 'power_form' in params: 933 body_params = params['power_form'] 934 # HTTP header `Accept` 935 header_params['Accept'] = self.api_client.\ 936 select_header_accept(['application/json']) 937 938 # Authentication setting 939 auth_settings = [] 940 941 return self.api_client.call_api(resource_path, 'PUT', 942 path_params, 943 query_params, 944 header_params, 945 body=body_params, 946 post_params=form_params, 947 files=local_var_files, 948 response_type='PowerForm', 949 auth_settings=auth_settings, 950 callback=params.get('callback'), 951 _return_http_data_only=params.get('_return_http_data_only'), 952 _preload_content=params.get('_preload_content', True), 953 _request_timeout=params.get('_request_timeout'), 954 collection_formats=collection_formats)
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen
44 def create_power_form(self, account_id, **kwargs): 45 """ 46 Creates a new PowerForm. 47 This method creates a new PowerForm. You create a PowerForm from an existing DocuSign [template](/docs/esign-rest-api/reference/templates/templates/create/), based on the `templateId` in the request body. PowerForms that you create from a template are referred to as *web PowerForms*. **Note:** The DocuSign Admin console also supports creating a PowerForm by uploading a PDF file that has active form fields (referred to as a *PDF PowerForm*). However, PDF PowerForms are deprecated and are not supported in the API. **Note:** A PowerForm can have only one sender. (Because PowerForms are not necessarily sent by email, this user is also referred to as the PowerForm *initiator*.) If you need to associate multiple senders with a PowerForm, create multiple copies of the PowerForm by using the same template (one copy for each sender). By default, the sender is the PowerForm Administrator who creates the PowerForm. ### Signing modes You can use one of the following signing modes for a PowerForm: **`email`** This mode verifies the recipient's identity by using email authentication before the recipient can sign a document. The recipient enters their email address on the landing page and then clicks **Begin Signing** to begin the signing process. The system then sends an email message with a validation code to the recipient. If the recipient does not provide a valid email address, they do not receive the email message containing the access code and are not able to open and sign the document. Alternatively, you can make the process easier for signers by using email authentication only and omitting the access code. To do this, you append the `activateonly` flag to the PowerForm URL and set it to true by passing in the value `1`. When the flag is active, the first recipient receives an email with a link that initiates the signing session without having to enter access code. Example: `activateonly=1` **`direct`** This mode does not require any verification. After a recipient enters their email address on the landing page and clicks **Begin Signing,** a new browser tab opens and the recipient can immediately begin the signing process. Because the `direct` signing mode does not verify the recipient's identity by using email authentication, we strongly recommend that you use this mode only when the PowerForm is accessible behind a secure portal where the recipient's identity is already authenticated, or where another form of authentication is specified for the recipient in the DocuSign template (for example, an access code, phone authentication, or ID check). **Note:** In the account settings, `enablePowerFormDirect` must be **true** to use `direct` as the `signingMode`. ### Redirect URLs You can control the URL to which signers are redirected after signing your PowerForm. However, the URL is specified elsewhere, outside of the PowerForm creation process. For details, see [How do I specify a URL to redirect to when a PowerForm is completed?](https://support.docusign.com/en/articles/How-do-I-specify-a-URL-to-redirect-to-when-a-Powerform-is-completed). ### More information For more information about creating PowerForms, see [Create a PowerForm](https://support.docusign.com/en/guides/ndse-user-guide-create-a-powerform). 48 This method makes a synchronous HTTP request by default. To make an 49 asynchronous HTTP request, please define a `callback` function 50 to be invoked when receiving the response. 51 >>> def callback_function(response): 52 >>> pprint(response) 53 >>> 54 >>> thread = api.create_power_form(account_id, callback=callback_function) 55 56 :param callback function: The callback function 57 for asynchronous request. (optional) 58 :param str account_id: The external account number (int) or account ID Guid. (required) 59 :param PowerForm power_form: 60 :return: PowerForm 61 If the method is called asynchronously, 62 returns the request thread. 63 """ 64 kwargs['_return_http_data_only'] = True 65 if kwargs.get('callback'): 66 return self.create_power_form_with_http_info(account_id, **kwargs) 67 else: 68 (data) = self.create_power_form_with_http_info(account_id, **kwargs) 69 return data
Creates a new PowerForm.
This method creates a new PowerForm. You create a PowerForm from an existing DocuSign template, based on the templateId in the request body. PowerForms that you create from a template are referred to as web PowerForms. Note: The DocuSign Admin console also supports creating a PowerForm by uploading a PDF file that has active form fields (referred to as a PDF PowerForm). However, PDF PowerForms are deprecated and are not supported in the API. Note: A PowerForm can have only one sender. (Because PowerForms are not necessarily sent by email, this user is also referred to as the PowerForm initiator.) If you need to associate multiple senders with a PowerForm, create multiple copies of the PowerForm by using the same template (one copy for each sender). By default, the sender is the PowerForm Administrator who creates the PowerForm. ### Signing modes You can use one of the following signing modes for a PowerForm: email This mode verifies the recipient's identity by using email authentication before the recipient can sign a document. The recipient enters their email address on the landing page and then clicks Begin Signing to begin the signing process. The system then sends an email message with a validation code to the recipient. If the recipient does not provide a valid email address, they do not receive the email message containing the access code and are not able to open and sign the document. Alternatively, you can make the process easier for signers by using email authentication only and omitting the access code. To do this, you append the activateonly flag to the PowerForm URL and set it to true by passing in the value 1. When the flag is active, the first recipient receives an email with a link that initiates the signing session without having to enter access code. Example: activateonly=1 direct This mode does not require any verification. After a recipient enters their email address on the landing page and clicks Begin Signing, a new browser tab opens and the recipient can immediately begin the signing process. Because the direct signing mode does not verify the recipient's identity by using email authentication, we strongly recommend that you use this mode only when the PowerForm is accessible behind a secure portal where the recipient's identity is already authenticated, or where another form of authentication is specified for the recipient in the DocuSign template (for example, an access code, phone authentication, or ID check). Note: In the account settings, enablePowerFormDirect must be true to use direct as the signingMode. ### Redirect URLs You can control the URL to which signers are redirected after signing your PowerForm. However, the URL is specified elsewhere, outside of the PowerForm creation process. For details, see How do I specify a URL to redirect to when a PowerForm is completed?. ### More information For more information about creating PowerForms, see Create a PowerForm.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.create_power_form(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- PowerForm power_form:
Returns
PowerForm If the method is called asynchronously, returns the request thread.
71 def create_power_form_with_http_info(self, account_id, **kwargs): 72 """ 73 Creates a new PowerForm. 74 This method creates a new PowerForm. You create a PowerForm from an existing DocuSign [template](/docs/esign-rest-api/reference/templates/templates/create/), based on the `templateId` in the request body. PowerForms that you create from a template are referred to as *web PowerForms*. **Note:** The DocuSign Admin console also supports creating a PowerForm by uploading a PDF file that has active form fields (referred to as a *PDF PowerForm*). However, PDF PowerForms are deprecated and are not supported in the API. **Note:** A PowerForm can have only one sender. (Because PowerForms are not necessarily sent by email, this user is also referred to as the PowerForm *initiator*.) If you need to associate multiple senders with a PowerForm, create multiple copies of the PowerForm by using the same template (one copy for each sender). By default, the sender is the PowerForm Administrator who creates the PowerForm. ### Signing modes You can use one of the following signing modes for a PowerForm: **`email`** This mode verifies the recipient's identity by using email authentication before the recipient can sign a document. The recipient enters their email address on the landing page and then clicks **Begin Signing** to begin the signing process. The system then sends an email message with a validation code to the recipient. If the recipient does not provide a valid email address, they do not receive the email message containing the access code and are not able to open and sign the document. Alternatively, you can make the process easier for signers by using email authentication only and omitting the access code. To do this, you append the `activateonly` flag to the PowerForm URL and set it to true by passing in the value `1`. When the flag is active, the first recipient receives an email with a link that initiates the signing session without having to enter access code. Example: `activateonly=1` **`direct`** This mode does not require any verification. After a recipient enters their email address on the landing page and clicks **Begin Signing,** a new browser tab opens and the recipient can immediately begin the signing process. Because the `direct` signing mode does not verify the recipient's identity by using email authentication, we strongly recommend that you use this mode only when the PowerForm is accessible behind a secure portal where the recipient's identity is already authenticated, or where another form of authentication is specified for the recipient in the DocuSign template (for example, an access code, phone authentication, or ID check). **Note:** In the account settings, `enablePowerFormDirect` must be **true** to use `direct` as the `signingMode`. ### Redirect URLs You can control the URL to which signers are redirected after signing your PowerForm. However, the URL is specified elsewhere, outside of the PowerForm creation process. For details, see [How do I specify a URL to redirect to when a PowerForm is completed?](https://support.docusign.com/en/articles/How-do-I-specify-a-URL-to-redirect-to-when-a-Powerform-is-completed). ### More information For more information about creating PowerForms, see [Create a PowerForm](https://support.docusign.com/en/guides/ndse-user-guide-create-a-powerform). 75 This method makes a synchronous HTTP request by default. To make an 76 asynchronous HTTP request, please define a `callback` function 77 to be invoked when receiving the response. 78 >>> def callback_function(response): 79 >>> pprint(response) 80 >>> 81 >>> thread = api.create_power_form_with_http_info(account_id, callback=callback_function) 82 83 :param callback function: The callback function 84 for asynchronous request. (optional) 85 :param str account_id: The external account number (int) or account ID Guid. (required) 86 :param PowerForm power_form: 87 :return: PowerForm 88 If the method is called asynchronously, 89 returns the request thread. 90 """ 91 92 all_params = ['account_id', 'power_form'] 93 all_params.append('callback') 94 all_params.append('_return_http_data_only') 95 all_params.append('_preload_content') 96 all_params.append('_request_timeout') 97 98 params = locals() 99 for key, val in iteritems(params['kwargs']): 100 if key not in all_params: 101 raise TypeError( 102 "Got an unexpected keyword argument '%s'" 103 " to method create_power_form" % key 104 ) 105 params[key] = val 106 del params['kwargs'] 107 # verify the required parameter 'account_id' is set 108 if ('account_id' not in params) or (params['account_id'] is None): 109 raise ValueError("Missing the required parameter `account_id` when calling `create_power_form`") 110 111 112 collection_formats = {} 113 114 resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json') 115 path_params = {} 116 if 'account_id' in params: 117 path_params['accountId'] = params['account_id'] 118 119 query_params = {} 120 121 header_params = {} 122 123 form_params = [] 124 local_var_files = {} 125 126 body_params = None 127 if 'power_form' in params: 128 body_params = params['power_form'] 129 # HTTP header `Accept` 130 header_params['Accept'] = self.api_client.\ 131 select_header_accept(['application/json']) 132 133 # Authentication setting 134 auth_settings = [] 135 136 return self.api_client.call_api(resource_path, 'POST', 137 path_params, 138 query_params, 139 header_params, 140 body=body_params, 141 post_params=form_params, 142 files=local_var_files, 143 response_type='PowerForm', 144 auth_settings=auth_settings, 145 callback=params.get('callback'), 146 _return_http_data_only=params.get('_return_http_data_only'), 147 _preload_content=params.get('_preload_content', True), 148 _request_timeout=params.get('_request_timeout'), 149 collection_formats=collection_formats)
Creates a new PowerForm.
This method creates a new PowerForm. You create a PowerForm from an existing DocuSign template, based on the templateId in the request body. PowerForms that you create from a template are referred to as web PowerForms. Note: The DocuSign Admin console also supports creating a PowerForm by uploading a PDF file that has active form fields (referred to as a PDF PowerForm). However, PDF PowerForms are deprecated and are not supported in the API. Note: A PowerForm can have only one sender. (Because PowerForms are not necessarily sent by email, this user is also referred to as the PowerForm initiator.) If you need to associate multiple senders with a PowerForm, create multiple copies of the PowerForm by using the same template (one copy for each sender). By default, the sender is the PowerForm Administrator who creates the PowerForm. ### Signing modes You can use one of the following signing modes for a PowerForm: email This mode verifies the recipient's identity by using email authentication before the recipient can sign a document. The recipient enters their email address on the landing page and then clicks Begin Signing to begin the signing process. The system then sends an email message with a validation code to the recipient. If the recipient does not provide a valid email address, they do not receive the email message containing the access code and are not able to open and sign the document. Alternatively, you can make the process easier for signers by using email authentication only and omitting the access code. To do this, you append the activateonly flag to the PowerForm URL and set it to true by passing in the value 1. When the flag is active, the first recipient receives an email with a link that initiates the signing session without having to enter access code. Example: activateonly=1 direct This mode does not require any verification. After a recipient enters their email address on the landing page and clicks Begin Signing, a new browser tab opens and the recipient can immediately begin the signing process. Because the direct signing mode does not verify the recipient's identity by using email authentication, we strongly recommend that you use this mode only when the PowerForm is accessible behind a secure portal where the recipient's identity is already authenticated, or where another form of authentication is specified for the recipient in the DocuSign template (for example, an access code, phone authentication, or ID check). Note: In the account settings, enablePowerFormDirect must be true to use direct as the signingMode. ### Redirect URLs You can control the URL to which signers are redirected after signing your PowerForm. However, the URL is specified elsewhere, outside of the PowerForm creation process. For details, see How do I specify a URL to redirect to when a PowerForm is completed?. ### More information For more information about creating PowerForms, see Create a PowerForm.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.create_power_form_with_http_info(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- PowerForm power_form:
Returns
PowerForm If the method is called asynchronously, returns the request thread.
151 def delete_power_form(self, account_id, power_form_id, **kwargs): 152 """ 153 Delete a PowerForm. 154 This method deletes a PowerForm. 155 This method makes a synchronous HTTP request by default. To make an 156 asynchronous HTTP request, please define a `callback` function 157 to be invoked when receiving the response. 158 >>> def callback_function(response): 159 >>> pprint(response) 160 >>> 161 >>> thread = api.delete_power_form(account_id, power_form_id, callback=callback_function) 162 163 :param callback function: The callback function 164 for asynchronous request. (optional) 165 :param str account_id: The external account number (int) or account ID Guid. (required) 166 :param str power_form_id: (required) 167 :return: None 168 If the method is called asynchronously, 169 returns the request thread. 170 """ 171 kwargs['_return_http_data_only'] = True 172 if kwargs.get('callback'): 173 return self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs) 174 else: 175 (data) = self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs) 176 return data
Delete a PowerForm.
This method deletes a PowerForm.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_power_form(account_id, power_form_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str power_form_id: (required)
Returns
None If the method is called asynchronously, returns the request thread.
178 def delete_power_form_with_http_info(self, account_id, power_form_id, **kwargs): 179 """ 180 Delete a PowerForm. 181 This method deletes a PowerForm. 182 This method makes a synchronous HTTP request by default. To make an 183 asynchronous HTTP request, please define a `callback` function 184 to be invoked when receiving the response. 185 >>> def callback_function(response): 186 >>> pprint(response) 187 >>> 188 >>> thread = api.delete_power_form_with_http_info(account_id, power_form_id, callback=callback_function) 189 190 :param callback function: The callback function 191 for asynchronous request. (optional) 192 :param str account_id: The external account number (int) or account ID Guid. (required) 193 :param str power_form_id: (required) 194 :return: None 195 If the method is called asynchronously, 196 returns the request thread. 197 """ 198 199 all_params = ['account_id', 'power_form_id'] 200 all_params.append('callback') 201 all_params.append('_return_http_data_only') 202 all_params.append('_preload_content') 203 all_params.append('_request_timeout') 204 205 params = locals() 206 for key, val in iteritems(params['kwargs']): 207 if key not in all_params: 208 raise TypeError( 209 "Got an unexpected keyword argument '%s'" 210 " to method delete_power_form" % key 211 ) 212 params[key] = val 213 del params['kwargs'] 214 # verify the required parameter 'account_id' is set 215 if ('account_id' not in params) or (params['account_id'] is None): 216 raise ValueError("Missing the required parameter `account_id` when calling `delete_power_form`") 217 # verify the required parameter 'power_form_id' is set 218 if ('power_form_id' not in params) or (params['power_form_id'] is None): 219 raise ValueError("Missing the required parameter `power_form_id` when calling `delete_power_form`") 220 221 222 collection_formats = {} 223 224 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json') 225 path_params = {} 226 if 'account_id' in params: 227 path_params['accountId'] = params['account_id'] 228 if 'power_form_id' in params: 229 path_params['powerFormId'] = params['power_form_id'] 230 231 query_params = {} 232 233 header_params = {} 234 235 form_params = [] 236 local_var_files = {} 237 238 body_params = None 239 # HTTP header `Accept` 240 header_params['Accept'] = self.api_client.\ 241 select_header_accept(['application/json']) 242 243 # Authentication setting 244 auth_settings = [] 245 246 return self.api_client.call_api(resource_path, 'DELETE', 247 path_params, 248 query_params, 249 header_params, 250 body=body_params, 251 post_params=form_params, 252 files=local_var_files, 253 response_type=None, 254 auth_settings=auth_settings, 255 callback=params.get('callback'), 256 _return_http_data_only=params.get('_return_http_data_only'), 257 _preload_content=params.get('_preload_content', True), 258 _request_timeout=params.get('_request_timeout'), 259 collection_formats=collection_formats)
Delete a PowerForm.
This method deletes a PowerForm.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str power_form_id: (required)
Returns
None If the method is called asynchronously, returns the request thread.
261 def delete_power_forms(self, account_id, **kwargs): 262 """ 263 Deletes one or more PowerForms 264 This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`. 265 This method makes a synchronous HTTP request by default. To make an 266 asynchronous HTTP request, please define a `callback` function 267 to be invoked when receiving the response. 268 >>> def callback_function(response): 269 >>> pprint(response) 270 >>> 271 >>> thread = api.delete_power_forms(account_id, callback=callback_function) 272 273 :param callback function: The callback function 274 for asynchronous request. (optional) 275 :param str account_id: The external account number (int) or account ID Guid. (required) 276 :param PowerFormsRequest power_forms_request: 277 :return: PowerFormsResponse 278 If the method is called asynchronously, 279 returns the request thread. 280 """ 281 kwargs['_return_http_data_only'] = True 282 if kwargs.get('callback'): 283 return self.delete_power_forms_with_http_info(account_id, **kwargs) 284 else: 285 (data) = self.delete_power_forms_with_http_info(account_id, **kwargs) 286 return data
Deletes one or more PowerForms
This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the powerFormId.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_power_forms(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- PowerFormsRequest power_forms_request:
Returns
PowerFormsResponse If the method is called asynchronously, returns the request thread.
288 def delete_power_forms_with_http_info(self, account_id, **kwargs): 289 """ 290 Deletes one or more PowerForms 291 This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`. 292 This method makes a synchronous HTTP request by default. To make an 293 asynchronous HTTP request, please define a `callback` function 294 to be invoked when receiving the response. 295 >>> def callback_function(response): 296 >>> pprint(response) 297 >>> 298 >>> thread = api.delete_power_forms_with_http_info(account_id, callback=callback_function) 299 300 :param callback function: The callback function 301 for asynchronous request. (optional) 302 :param str account_id: The external account number (int) or account ID Guid. (required) 303 :param PowerFormsRequest power_forms_request: 304 :return: PowerFormsResponse 305 If the method is called asynchronously, 306 returns the request thread. 307 """ 308 309 all_params = ['account_id', 'power_forms_request'] 310 all_params.append('callback') 311 all_params.append('_return_http_data_only') 312 all_params.append('_preload_content') 313 all_params.append('_request_timeout') 314 315 params = locals() 316 for key, val in iteritems(params['kwargs']): 317 if key not in all_params: 318 raise TypeError( 319 "Got an unexpected keyword argument '%s'" 320 " to method delete_power_forms" % key 321 ) 322 params[key] = val 323 del params['kwargs'] 324 # verify the required parameter 'account_id' is set 325 if ('account_id' not in params) or (params['account_id'] is None): 326 raise ValueError("Missing the required parameter `account_id` when calling `delete_power_forms`") 327 328 329 collection_formats = {} 330 331 resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json') 332 path_params = {} 333 if 'account_id' in params: 334 path_params['accountId'] = params['account_id'] 335 336 query_params = {} 337 338 header_params = {} 339 340 form_params = [] 341 local_var_files = {} 342 343 body_params = None 344 if 'power_forms_request' in params: 345 body_params = params['power_forms_request'] 346 # HTTP header `Accept` 347 header_params['Accept'] = self.api_client.\ 348 select_header_accept(['application/json']) 349 350 # Authentication setting 351 auth_settings = [] 352 353 return self.api_client.call_api(resource_path, 'DELETE', 354 path_params, 355 query_params, 356 header_params, 357 body=body_params, 358 post_params=form_params, 359 files=local_var_files, 360 response_type='PowerFormsResponse', 361 auth_settings=auth_settings, 362 callback=params.get('callback'), 363 _return_http_data_only=params.get('_return_http_data_only'), 364 _preload_content=params.get('_preload_content', True), 365 _request_timeout=params.get('_request_timeout'), 366 collection_formats=collection_formats)
Deletes one or more PowerForms
This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the powerFormId.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_power_forms_with_http_info(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- PowerFormsRequest power_forms_request:
Returns
PowerFormsResponse If the method is called asynchronously, returns the request thread.
368 def get_power_form(self, account_id, power_form_id, **kwargs): 369 """ 370 Returns a single PowerForm. 371 This method returns detailed information about a specific PowerForm. 372 This method makes a synchronous HTTP request by default. To make an 373 asynchronous HTTP request, please define a `callback` function 374 to be invoked when receiving the response. 375 >>> def callback_function(response): 376 >>> pprint(response) 377 >>> 378 >>> thread = api.get_power_form(account_id, power_form_id, callback=callback_function) 379 380 :param callback function: The callback function 381 for asynchronous request. (optional) 382 :param str account_id: The external account number (int) or account ID Guid. (required) 383 :param str power_form_id: (required) 384 :return: PowerForm 385 If the method is called asynchronously, 386 returns the request thread. 387 """ 388 kwargs['_return_http_data_only'] = True 389 if kwargs.get('callback'): 390 return self.get_power_form_with_http_info(account_id, power_form_id, **kwargs) 391 else: 392 (data) = self.get_power_form_with_http_info(account_id, power_form_id, **kwargs) 393 return data
Returns a single PowerForm.
This method returns detailed information about a specific PowerForm.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_power_form(account_id, power_form_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str power_form_id: (required)
Returns
PowerForm If the method is called asynchronously, returns the request thread.
395 def get_power_form_with_http_info(self, account_id, power_form_id, **kwargs): 396 """ 397 Returns a single PowerForm. 398 This method returns detailed information about a specific PowerForm. 399 This method makes a synchronous HTTP request by default. To make an 400 asynchronous HTTP request, please define a `callback` function 401 to be invoked when receiving the response. 402 >>> def callback_function(response): 403 >>> pprint(response) 404 >>> 405 >>> thread = api.get_power_form_with_http_info(account_id, power_form_id, callback=callback_function) 406 407 :param callback function: The callback function 408 for asynchronous request. (optional) 409 :param str account_id: The external account number (int) or account ID Guid. (required) 410 :param str power_form_id: (required) 411 :return: PowerForm 412 If the method is called asynchronously, 413 returns the request thread. 414 """ 415 416 all_params = ['account_id', 'power_form_id'] 417 all_params.append('callback') 418 all_params.append('_return_http_data_only') 419 all_params.append('_preload_content') 420 all_params.append('_request_timeout') 421 422 params = locals() 423 for key, val in iteritems(params['kwargs']): 424 if key not in all_params: 425 raise TypeError( 426 "Got an unexpected keyword argument '%s'" 427 " to method get_power_form" % key 428 ) 429 params[key] = val 430 del params['kwargs'] 431 # verify the required parameter 'account_id' is set 432 if ('account_id' not in params) or (params['account_id'] is None): 433 raise ValueError("Missing the required parameter `account_id` when calling `get_power_form`") 434 # verify the required parameter 'power_form_id' is set 435 if ('power_form_id' not in params) or (params['power_form_id'] is None): 436 raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form`") 437 438 439 collection_formats = {} 440 441 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json') 442 path_params = {} 443 if 'account_id' in params: 444 path_params['accountId'] = params['account_id'] 445 if 'power_form_id' in params: 446 path_params['powerFormId'] = params['power_form_id'] 447 448 query_params = {} 449 450 header_params = {} 451 452 form_params = [] 453 local_var_files = {} 454 455 body_params = None 456 # HTTP header `Accept` 457 header_params['Accept'] = self.api_client.\ 458 select_header_accept(['application/json']) 459 460 # Authentication setting 461 auth_settings = [] 462 463 return self.api_client.call_api(resource_path, 'GET', 464 path_params, 465 query_params, 466 header_params, 467 body=body_params, 468 post_params=form_params, 469 files=local_var_files, 470 response_type='PowerForm', 471 auth_settings=auth_settings, 472 callback=params.get('callback'), 473 _return_http_data_only=params.get('_return_http_data_only'), 474 _preload_content=params.get('_preload_content', True), 475 _request_timeout=params.get('_request_timeout'), 476 collection_formats=collection_formats)
Returns a single PowerForm.
This method returns detailed information about a specific PowerForm.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str power_form_id: (required)
Returns
PowerForm If the method is called asynchronously, returns the request thread.
478 def get_power_form_data(self, account_id, power_form_id, **kwargs): 479 """ 480 Returns the form data associated with the usage of a PowerForm. 481 This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm. You specify the format in which you want to retrieve the data in the `Accept` header. This header accepts the following values: - `application/json`: JSON format - `application/xml`: XML format - `text/csv`: Comma-separated value (CSV) format **Note:** Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm. 482 This method makes a synchronous HTTP request by default. To make an 483 asynchronous HTTP request, please define a `callback` function 484 to be invoked when receiving the response. 485 >>> def callback_function(response): 486 >>> pprint(response) 487 >>> 488 >>> thread = api.get_power_form_data(account_id, power_form_id, callback=callback_function) 489 490 :param callback function: The callback function 491 for asynchronous request. (optional) 492 :param str account_id: The external account number (int) or account ID Guid. (required) 493 :param str power_form_id: (required) 494 :param str data_layout: 495 :param str from_date: 496 :param str to_date: 497 :return: PowerFormsFormDataResponse 498 If the method is called asynchronously, 499 returns the request thread. 500 """ 501 kwargs['_return_http_data_only'] = True 502 if kwargs.get('callback'): 503 return self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs) 504 else: 505 (data) = self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs) 506 return data
Returns the form data associated with the usage of a PowerForm.
This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm. You specify the format in which you want to retrieve the data in the Accept header. This header accepts the following values: - application/json: JSON format - application/xml: XML format - text/csv: Comma-separated value (CSV) format Note: Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_power_form_data(account_id, power_form_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str power_form_id: (required)
- str data_layout:
- str from_date:
- str to_date:
Returns
PowerFormsFormDataResponse If the method is called asynchronously, returns the request thread.
508 def get_power_form_data_with_http_info(self, account_id, power_form_id, **kwargs): 509 """ 510 Returns the form data associated with the usage of a PowerForm. 511 This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm. You specify the format in which you want to retrieve the data in the `Accept` header. This header accepts the following values: - `application/json`: JSON format - `application/xml`: XML format - `text/csv`: Comma-separated value (CSV) format **Note:** Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm. 512 This method makes a synchronous HTTP request by default. To make an 513 asynchronous HTTP request, please define a `callback` function 514 to be invoked when receiving the response. 515 >>> def callback_function(response): 516 >>> pprint(response) 517 >>> 518 >>> thread = api.get_power_form_data_with_http_info(account_id, power_form_id, callback=callback_function) 519 520 :param callback function: The callback function 521 for asynchronous request. (optional) 522 :param str account_id: The external account number (int) or account ID Guid. (required) 523 :param str power_form_id: (required) 524 :param str data_layout: 525 :param str from_date: 526 :param str to_date: 527 :return: PowerFormsFormDataResponse 528 If the method is called asynchronously, 529 returns the request thread. 530 """ 531 532 all_params = ['account_id', 'power_form_id', 'data_layout', 'from_date', 'to_date'] 533 all_params.append('callback') 534 all_params.append('_return_http_data_only') 535 all_params.append('_preload_content') 536 all_params.append('_request_timeout') 537 538 params = locals() 539 for key, val in iteritems(params['kwargs']): 540 if key not in all_params: 541 raise TypeError( 542 "Got an unexpected keyword argument '%s'" 543 " to method get_power_form_data" % key 544 ) 545 params[key] = val 546 del params['kwargs'] 547 # verify the required parameter 'account_id' is set 548 if ('account_id' not in params) or (params['account_id'] is None): 549 raise ValueError("Missing the required parameter `account_id` when calling `get_power_form_data`") 550 # verify the required parameter 'power_form_id' is set 551 if ('power_form_id' not in params) or (params['power_form_id'] is None): 552 raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form_data`") 553 554 555 collection_formats = {} 556 557 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}/form_data'.replace('{format}', 'json') 558 path_params = {} 559 if 'account_id' in params: 560 path_params['accountId'] = params['account_id'] 561 if 'power_form_id' in params: 562 path_params['powerFormId'] = params['power_form_id'] 563 564 query_params = {} 565 if 'data_layout' in params: 566 query_params['data_layout'] = params['data_layout'] 567 if 'from_date' in params: 568 query_params['from_date'] = params['from_date'] 569 if 'to_date' in params: 570 query_params['to_date'] = params['to_date'] 571 572 header_params = {} 573 574 form_params = [] 575 local_var_files = {} 576 577 body_params = None 578 # HTTP header `Accept` 579 header_params['Accept'] = self.api_client.\ 580 select_header_accept(['application/json']) 581 582 # Authentication setting 583 auth_settings = [] 584 585 return self.api_client.call_api(resource_path, 'GET', 586 path_params, 587 query_params, 588 header_params, 589 body=body_params, 590 post_params=form_params, 591 files=local_var_files, 592 response_type='PowerFormsFormDataResponse', 593 auth_settings=auth_settings, 594 callback=params.get('callback'), 595 _return_http_data_only=params.get('_return_http_data_only'), 596 _preload_content=params.get('_preload_content', True), 597 _request_timeout=params.get('_request_timeout'), 598 collection_formats=collection_formats)
Returns the form data associated with the usage of a PowerForm.
This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm. You specify the format in which you want to retrieve the data in the Accept header. This header accepts the following values: - application/json: JSON format - application/xml: XML format - text/csv: Comma-separated value (CSV) format Note: Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_power_form_data_with_http_info(account_id, power_form_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str power_form_id: (required)
- str data_layout:
- str from_date:
- str to_date:
Returns
PowerFormsFormDataResponse If the method is called asynchronously, returns the request thread.
600 def list_power_form_senders(self, account_id, **kwargs): 601 """ 602 Returns the list of PowerForms available to the user. 603 This method returns a list of users who have sent PowerForms. 604 This method makes a synchronous HTTP request by default. To make an 605 asynchronous HTTP request, please define a `callback` function 606 to be invoked when receiving the response. 607 >>> def callback_function(response): 608 >>> pprint(response) 609 >>> 610 >>> thread = api.list_power_form_senders(account_id, callback=callback_function) 611 612 :param callback function: The callback function 613 for asynchronous request. (optional) 614 :param str account_id: The external account number (int) or account ID Guid. (required) 615 :param str start_position: 616 :return: PowerFormSendersResponse 617 If the method is called asynchronously, 618 returns the request thread. 619 """ 620 kwargs['_return_http_data_only'] = True 621 if kwargs.get('callback'): 622 return self.list_power_form_senders_with_http_info(account_id, **kwargs) 623 else: 624 (data) = self.list_power_form_senders_with_http_info(account_id, **kwargs) 625 return data
Returns the list of PowerForms available to the user.
This method returns a list of users who have sent PowerForms.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.list_power_form_senders(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str start_position:
Returns
PowerFormSendersResponse If the method is called asynchronously, returns the request thread.
627 def list_power_form_senders_with_http_info(self, account_id, **kwargs): 628 """ 629 Returns the list of PowerForms available to the user. 630 This method returns a list of users who have sent PowerForms. 631 This method makes a synchronous HTTP request by default. To make an 632 asynchronous HTTP request, please define a `callback` function 633 to be invoked when receiving the response. 634 >>> def callback_function(response): 635 >>> pprint(response) 636 >>> 637 >>> thread = api.list_power_form_senders_with_http_info(account_id, callback=callback_function) 638 639 :param callback function: The callback function 640 for asynchronous request. (optional) 641 :param str account_id: The external account number (int) or account ID Guid. (required) 642 :param str start_position: 643 :return: PowerFormSendersResponse 644 If the method is called asynchronously, 645 returns the request thread. 646 """ 647 648 all_params = ['account_id', 'start_position'] 649 all_params.append('callback') 650 all_params.append('_return_http_data_only') 651 all_params.append('_preload_content') 652 all_params.append('_request_timeout') 653 654 params = locals() 655 for key, val in iteritems(params['kwargs']): 656 if key not in all_params: 657 raise TypeError( 658 "Got an unexpected keyword argument '%s'" 659 " to method list_power_form_senders" % key 660 ) 661 params[key] = val 662 del params['kwargs'] 663 # verify the required parameter 'account_id' is set 664 if ('account_id' not in params) or (params['account_id'] is None): 665 raise ValueError("Missing the required parameter `account_id` when calling `list_power_form_senders`") 666 667 668 collection_formats = {} 669 670 resource_path = '/v2.1/accounts/{accountId}/powerforms/senders'.replace('{format}', 'json') 671 path_params = {} 672 if 'account_id' in params: 673 path_params['accountId'] = params['account_id'] 674 675 query_params = {} 676 if 'start_position' in params: 677 query_params['start_position'] = params['start_position'] 678 679 header_params = {} 680 681 form_params = [] 682 local_var_files = {} 683 684 body_params = None 685 # HTTP header `Accept` 686 header_params['Accept'] = self.api_client.\ 687 select_header_accept(['application/json']) 688 689 # Authentication setting 690 auth_settings = [] 691 692 return self.api_client.call_api(resource_path, 'GET', 693 path_params, 694 query_params, 695 header_params, 696 body=body_params, 697 post_params=form_params, 698 files=local_var_files, 699 response_type='PowerFormSendersResponse', 700 auth_settings=auth_settings, 701 callback=params.get('callback'), 702 _return_http_data_only=params.get('_return_http_data_only'), 703 _preload_content=params.get('_preload_content', True), 704 _request_timeout=params.get('_request_timeout'), 705 collection_formats=collection_formats)
Returns the list of PowerForms available to the user.
This method returns a list of users who have sent PowerForms.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.list_power_form_senders_with_http_info(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str start_position:
Returns
PowerFormSendersResponse If the method is called asynchronously, returns the request thread.
707 def list_power_forms(self, account_id, **kwargs): 708 """ 709 Returns the list of PowerForms available to the user. 710 This method returns a list of PowerForms that are available to the user. 711 This method makes a synchronous HTTP request by default. To make an 712 asynchronous HTTP request, please define a `callback` function 713 to be invoked when receiving the response. 714 >>> def callback_function(response): 715 >>> pprint(response) 716 >>> 717 >>> thread = api.list_power_forms(account_id, callback=callback_function) 718 719 :param callback function: The callback function 720 for asynchronous request. (optional) 721 :param str account_id: The external account number (int) or account ID Guid. (required) 722 :param str count: 723 :param str from_date: 724 :param str order: 725 :param str order_by: 726 :param str search_fields: 727 :param str search_text: 728 :param str start_position: 729 :param str to_date: 730 :return: PowerFormsResponse 731 If the method is called asynchronously, 732 returns the request thread. 733 """ 734 kwargs['_return_http_data_only'] = True 735 if kwargs.get('callback'): 736 return self.list_power_forms_with_http_info(account_id, **kwargs) 737 else: 738 (data) = self.list_power_forms_with_http_info(account_id, **kwargs) 739 return data
Returns the list of PowerForms available to the user.
This method returns a list of PowerForms that are available to the user.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.list_power_forms(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str count:
- str from_date:
- str order:
- str order_by:
- str search_fields:
- str search_text:
- str start_position:
- str to_date:
Returns
PowerFormsResponse If the method is called asynchronously, returns the request thread.
741 def list_power_forms_with_http_info(self, account_id, **kwargs): 742 """ 743 Returns the list of PowerForms available to the user. 744 This method returns a list of PowerForms that are available to the user. 745 This method makes a synchronous HTTP request by default. To make an 746 asynchronous HTTP request, please define a `callback` function 747 to be invoked when receiving the response. 748 >>> def callback_function(response): 749 >>> pprint(response) 750 >>> 751 >>> thread = api.list_power_forms_with_http_info(account_id, callback=callback_function) 752 753 :param callback function: The callback function 754 for asynchronous request. (optional) 755 :param str account_id: The external account number (int) or account ID Guid. (required) 756 :param str count: 757 :param str from_date: 758 :param str order: 759 :param str order_by: 760 :param str search_fields: 761 :param str search_text: 762 :param str start_position: 763 :param str to_date: 764 :return: PowerFormsResponse 765 If the method is called asynchronously, 766 returns the request thread. 767 """ 768 769 all_params = ['account_id', 'count', 'from_date', 'order', 'order_by', 'search_fields', 'search_text', 'start_position', 'to_date'] 770 all_params.append('callback') 771 all_params.append('_return_http_data_only') 772 all_params.append('_preload_content') 773 all_params.append('_request_timeout') 774 775 params = locals() 776 for key, val in iteritems(params['kwargs']): 777 if key not in all_params: 778 raise TypeError( 779 "Got an unexpected keyword argument '%s'" 780 " to method list_power_forms" % key 781 ) 782 params[key] = val 783 del params['kwargs'] 784 # verify the required parameter 'account_id' is set 785 if ('account_id' not in params) or (params['account_id'] is None): 786 raise ValueError("Missing the required parameter `account_id` when calling `list_power_forms`") 787 788 789 collection_formats = {} 790 791 resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json') 792 path_params = {} 793 if 'account_id' in params: 794 path_params['accountId'] = params['account_id'] 795 796 query_params = {} 797 if 'count' in params: 798 query_params['count'] = params['count'] 799 if 'from_date' in params: 800 query_params['from_date'] = params['from_date'] 801 if 'order' in params: 802 query_params['order'] = params['order'] 803 if 'order_by' in params: 804 query_params['order_by'] = params['order_by'] 805 if 'search_fields' in params: 806 query_params['search_fields'] = params['search_fields'] 807 if 'search_text' in params: 808 query_params['search_text'] = params['search_text'] 809 if 'start_position' in params: 810 query_params['start_position'] = params['start_position'] 811 if 'to_date' in params: 812 query_params['to_date'] = params['to_date'] 813 814 header_params = {} 815 816 form_params = [] 817 local_var_files = {} 818 819 body_params = None 820 # HTTP header `Accept` 821 header_params['Accept'] = self.api_client.\ 822 select_header_accept(['application/json']) 823 824 # Authentication setting 825 auth_settings = [] 826 827 return self.api_client.call_api(resource_path, 'GET', 828 path_params, 829 query_params, 830 header_params, 831 body=body_params, 832 post_params=form_params, 833 files=local_var_files, 834 response_type='PowerFormsResponse', 835 auth_settings=auth_settings, 836 callback=params.get('callback'), 837 _return_http_data_only=params.get('_return_http_data_only'), 838 _preload_content=params.get('_preload_content', True), 839 _request_timeout=params.get('_request_timeout'), 840 collection_formats=collection_formats)
Returns the list of PowerForms available to the user.
This method returns a list of PowerForms that are available to the user.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.list_power_forms_with_http_info(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str count:
- str from_date:
- str order:
- str order_by:
- str search_fields:
- str search_text:
- str start_position:
- str to_date:
Returns
PowerFormsResponse If the method is called asynchronously, returns the request thread.
842 def update_power_form(self, account_id, power_form_id, **kwargs): 843 """ 844 Creates a new PowerForm. 845 This method updates an existing PowerForm. 846 This method makes a synchronous HTTP request by default. To make an 847 asynchronous HTTP request, please define a `callback` function 848 to be invoked when receiving the response. 849 >>> def callback_function(response): 850 >>> pprint(response) 851 >>> 852 >>> thread = api.update_power_form(account_id, power_form_id, callback=callback_function) 853 854 :param callback function: The callback function 855 for asynchronous request. (optional) 856 :param str account_id: The external account number (int) or account ID Guid. (required) 857 :param str power_form_id: (required) 858 :param PowerForm power_form: 859 :return: PowerForm 860 If the method is called asynchronously, 861 returns the request thread. 862 """ 863 kwargs['_return_http_data_only'] = True 864 if kwargs.get('callback'): 865 return self.update_power_form_with_http_info(account_id, power_form_id, **kwargs) 866 else: 867 (data) = self.update_power_form_with_http_info(account_id, power_form_id, **kwargs) 868 return data
Creates a new PowerForm.
This method updates an existing PowerForm.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_power_form(account_id, power_form_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str power_form_id: (required)
- PowerForm power_form:
Returns
PowerForm If the method is called asynchronously, returns the request thread.
870 def update_power_form_with_http_info(self, account_id, power_form_id, **kwargs): 871 """ 872 Creates a new PowerForm. 873 This method updates an existing PowerForm. 874 This method makes a synchronous HTTP request by default. To make an 875 asynchronous HTTP request, please define a `callback` function 876 to be invoked when receiving the response. 877 >>> def callback_function(response): 878 >>> pprint(response) 879 >>> 880 >>> thread = api.update_power_form_with_http_info(account_id, power_form_id, callback=callback_function) 881 882 :param callback function: The callback function 883 for asynchronous request. (optional) 884 :param str account_id: The external account number (int) or account ID Guid. (required) 885 :param str power_form_id: (required) 886 :param PowerForm power_form: 887 :return: PowerForm 888 If the method is called asynchronously, 889 returns the request thread. 890 """ 891 892 all_params = ['account_id', 'power_form_id', 'power_form'] 893 all_params.append('callback') 894 all_params.append('_return_http_data_only') 895 all_params.append('_preload_content') 896 all_params.append('_request_timeout') 897 898 params = locals() 899 for key, val in iteritems(params['kwargs']): 900 if key not in all_params: 901 raise TypeError( 902 "Got an unexpected keyword argument '%s'" 903 " to method update_power_form" % key 904 ) 905 params[key] = val 906 del params['kwargs'] 907 # verify the required parameter 'account_id' is set 908 if ('account_id' not in params) or (params['account_id'] is None): 909 raise ValueError("Missing the required parameter `account_id` when calling `update_power_form`") 910 # verify the required parameter 'power_form_id' is set 911 if ('power_form_id' not in params) or (params['power_form_id'] is None): 912 raise ValueError("Missing the required parameter `power_form_id` when calling `update_power_form`") 913 914 915 collection_formats = {} 916 917 resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json') 918 path_params = {} 919 if 'account_id' in params: 920 path_params['accountId'] = params['account_id'] 921 if 'power_form_id' in params: 922 path_params['powerFormId'] = params['power_form_id'] 923 924 query_params = {} 925 926 header_params = {} 927 928 form_params = [] 929 local_var_files = {} 930 931 body_params = None 932 if 'power_form' in params: 933 body_params = params['power_form'] 934 # HTTP header `Accept` 935 header_params['Accept'] = self.api_client.\ 936 select_header_accept(['application/json']) 937 938 # Authentication setting 939 auth_settings = [] 940 941 return self.api_client.call_api(resource_path, 'PUT', 942 path_params, 943 query_params, 944 header_params, 945 body=body_params, 946 post_params=form_params, 947 files=local_var_files, 948 response_type='PowerForm', 949 auth_settings=auth_settings, 950 callback=params.get('callback'), 951 _return_http_data_only=params.get('_return_http_data_only'), 952 _preload_content=params.get('_preload_content', True), 953 _request_timeout=params.get('_request_timeout'), 954 collection_formats=collection_formats)
Creates a new PowerForm.
This method updates an existing PowerForm.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str power_form_id: (required)
- PowerForm power_form:
Returns
PowerForm If the method is called asynchronously, returns the request thread.