docusign_webforms.apis.form_instance_management_api

Web Forms API version 1.1

The Web Forms API facilitates generating semantic HTML forms around everyday contracts. # noqa: E501

OpenAPI spec version: 1.1.0 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git

  1# coding: utf-8
  2
  3"""
  4    Web Forms API version 1.1
  5
  6    The Web Forms API facilitates generating semantic HTML forms around everyday contracts.   # noqa: E501
  7
  8    OpenAPI spec version: 1.1.0
  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 FormInstanceManagementApi(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_instance(self, account_id, form_id, create_instance_body, **kwargs):
 44        """
 45        Creates an instance of the web form
 46        Creates an instance of the web form.
 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_instance(account_id, form_id, create_instance_body, callback=callback_function)
 54
 55        :param callback function: The callback function
 56            for asynchronous request. (optional)
 57        :param str account_id: Account identifier in which the web form resides (required)
 58        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
 59        :param CreateInstanceRequestBody create_instance_body: Request body containing properties that will be used to create instance. (required)
 60        :return: WebFormInstance
 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_instance_with_http_info(account_id, form_id, create_instance_body, **kwargs)
 67        else:
 68            (data) = self.create_instance_with_http_info(account_id, form_id, create_instance_body, **kwargs)
 69            return data
 70
 71    def create_instance_with_http_info(self, account_id, form_id, create_instance_body, **kwargs):
 72        """
 73        Creates an instance of the web form
 74        Creates an instance of the web form.
 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_instance_with_http_info(account_id, form_id, create_instance_body, callback=callback_function)
 82
 83        :param callback function: The callback function
 84            for asynchronous request. (optional)
 85        :param str account_id: Account identifier in which the web form resides (required)
 86        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
 87        :param CreateInstanceRequestBody create_instance_body: Request body containing properties that will be used to create instance. (required)
 88        :return: WebFormInstance
 89                 If the method is called asynchronously,
 90                 returns the request thread.
 91        """
 92
 93        all_params = ['account_id', 'form_id', 'create_instance_body']
 94        all_params.append('callback')
 95        all_params.append('_return_http_data_only')
 96        all_params.append('_preload_content')
 97        all_params.append('_request_timeout')
 98
 99        params = locals()
100        for key, val in iteritems(params['kwargs']):
101            if key not in all_params:
102                raise TypeError(
103                    "Got an unexpected keyword argument '%s'"
104                    " to method create_instance" % key
105                )
106            params[key] = val
107        del params['kwargs']
108        # verify the required parameter 'account_id' is set
109        if ('account_id' not in params) or (params['account_id'] is None):
110            raise ValueError("Missing the required parameter `account_id` when calling `create_instance`")
111        # verify the required parameter 'form_id' is set
112        if ('form_id' not in params) or (params['form_id'] is None):
113            raise ValueError("Missing the required parameter `form_id` when calling `create_instance`")
114        # verify the required parameter 'create_instance_body' is set
115        if ('create_instance_body' not in params) or (params['create_instance_body'] is None):
116            raise ValueError("Missing the required parameter `create_instance_body` when calling `create_instance`")
117
118
119        collection_formats = {}
120
121        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances'.replace('{format}', 'json')
122        path_params = {}
123        if 'account_id' in params:
124            path_params['accountId'] = params['account_id']
125        if 'form_id' in params:
126            path_params['formId'] = params['form_id']
127
128        query_params = {}
129
130        header_params = {}
131
132        form_params = []
133        local_var_files = {}
134
135        body_params = None
136        if 'create_instance_body' in params:
137            body_params = params['create_instance_body']
138        # HTTP header `Accept`
139        header_params['Accept'] = self.api_client.\
140            select_header_accept(['application/json'])
141
142        # HTTP header `Content-Type`
143        header_params['Content-Type'] = self.api_client.\
144            select_header_content_type(['application/json'])
145
146        # Authentication setting
147        auth_settings = []
148
149        return self.api_client.call_api(resource_path, 'POST',
150                                        path_params,
151                                        query_params,
152                                        header_params,
153                                        body=body_params,
154                                        post_params=form_params,
155                                        files=local_var_files,
156                                        response_type='WebFormInstance',
157                                        auth_settings=auth_settings,
158                                        callback=params.get('callback'),
159                                        _return_http_data_only=params.get('_return_http_data_only'),
160                                        _preload_content=params.get('_preload_content', True),
161                                        _request_timeout=params.get('_request_timeout'),
162                                        collection_formats=collection_formats)
163
164    def get_instance(self, account_id, form_id, instance_id, **kwargs):
165        """
166        Get form instance
167        Retrieves instance information filter by instance id
168        This method makes a synchronous HTTP request by default. To make an
169        asynchronous HTTP request, please define a `callback` function
170        to be invoked when receiving the response.
171        >>> def callback_function(response):
172        >>>     pprint(response)
173        >>>
174        >>> thread = api.get_instance(account_id, form_id, instance_id, callback=callback_function)
175
176        :param callback function: The callback function
177            for asynchronous request. (optional)
178        :param str account_id: Account identifier in which the web form resides (required)
179        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
180        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
181        :return: WebFormInstance
182                 If the method is called asynchronously,
183                 returns the request thread.
184        """
185        kwargs['_return_http_data_only'] = True
186        if kwargs.get('callback'):
187            return self.get_instance_with_http_info(account_id, form_id, instance_id, **kwargs)
188        else:
189            (data) = self.get_instance_with_http_info(account_id, form_id, instance_id, **kwargs)
190            return data
191
192    def get_instance_with_http_info(self, account_id, form_id, instance_id, **kwargs):
193        """
194        Get form instance
195        Retrieves instance information filter by instance id
196        This method makes a synchronous HTTP request by default. To make an
197        asynchronous HTTP request, please define a `callback` function
198        to be invoked when receiving the response.
199        >>> def callback_function(response):
200        >>>     pprint(response)
201        >>>
202        >>> thread = api.get_instance_with_http_info(account_id, form_id, instance_id, callback=callback_function)
203
204        :param callback function: The callback function
205            for asynchronous request. (optional)
206        :param str account_id: Account identifier in which the web form resides (required)
207        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
208        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
209        :return: WebFormInstance
210                 If the method is called asynchronously,
211                 returns the request thread.
212        """
213
214        all_params = ['account_id', 'form_id', 'instance_id']
215        all_params.append('callback')
216        all_params.append('_return_http_data_only')
217        all_params.append('_preload_content')
218        all_params.append('_request_timeout')
219
220        params = locals()
221        for key, val in iteritems(params['kwargs']):
222            if key not in all_params:
223                raise TypeError(
224                    "Got an unexpected keyword argument '%s'"
225                    " to method get_instance" % key
226                )
227            params[key] = val
228        del params['kwargs']
229        # verify the required parameter 'account_id' is set
230        if ('account_id' not in params) or (params['account_id'] is None):
231            raise ValueError("Missing the required parameter `account_id` when calling `get_instance`")
232        # verify the required parameter 'form_id' is set
233        if ('form_id' not in params) or (params['form_id'] is None):
234            raise ValueError("Missing the required parameter `form_id` when calling `get_instance`")
235        # verify the required parameter 'instance_id' is set
236        if ('instance_id' not in params) or (params['instance_id'] is None):
237            raise ValueError("Missing the required parameter `instance_id` when calling `get_instance`")
238
239
240        collection_formats = {}
241
242        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances/{instanceId}'.replace('{format}', 'json')
243        path_params = {}
244        if 'account_id' in params:
245            path_params['accountId'] = params['account_id']
246        if 'form_id' in params:
247            path_params['formId'] = params['form_id']
248        if 'instance_id' in params:
249            path_params['instanceId'] = params['instance_id']
250
251        query_params = {}
252
253        header_params = {}
254
255        form_params = []
256        local_var_files = {}
257
258        body_params = None
259        # HTTP header `Accept`
260        header_params['Accept'] = self.api_client.\
261            select_header_accept(['application/json'])
262
263        # HTTP header `Content-Type`
264        header_params['Content-Type'] = self.api_client.\
265            select_header_content_type(['application/json'])
266
267        # Authentication setting
268        auth_settings = []
269
270        return self.api_client.call_api(resource_path, 'GET',
271                                        path_params,
272                                        query_params,
273                                        header_params,
274                                        body=body_params,
275                                        post_params=form_params,
276                                        files=local_var_files,
277                                        response_type='WebFormInstance',
278                                        auth_settings=auth_settings,
279                                        callback=params.get('callback'),
280                                        _return_http_data_only=params.get('_return_http_data_only'),
281                                        _preload_content=params.get('_preload_content', True),
282                                        _request_timeout=params.get('_request_timeout'),
283                                        collection_formats=collection_formats)
284
285    def list_instances(self, account_id, form_id, **kwargs):
286        """
287        List instances
288        List all the instances of a web form in an account. When filtered by clientUserId, it will return instances having same clientUserId
289        This method makes a synchronous HTTP request by default. To make an
290        asynchronous HTTP request, please define a `callback` function
291        to be invoked when receiving the response.
292        >>> def callback_function(response):
293        >>>     pprint(response)
294        >>>
295        >>> thread = api.list_instances(account_id, form_id, callback=callback_function)
296
297        :param callback function: The callback function
298            for asynchronous request. (optional)
299        :param str account_id: Account identifier in which the web form resides (required)
300        :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required)
301        :param str client_user_id: A unique identifier for a user that should originate from client's system. This value can be anything your backend system would use to track individual form instances. Examples include employee IDs, email addresses, surrogate key values, etc.
302        :return: WebFormInstanceList
303                 If the method is called asynchronously,
304                 returns the request thread.
305        """
306        kwargs['_return_http_data_only'] = True
307        if kwargs.get('callback'):
308            return self.list_instances_with_http_info(account_id, form_id, **kwargs)
309        else:
310            (data) = self.list_instances_with_http_info(account_id, form_id, **kwargs)
311            return data
312
313    def list_instances_with_http_info(self, account_id, form_id, **kwargs):
314        """
315        List instances
316        List all the instances of a web form in an account. When filtered by clientUserId, it will return instances having same clientUserId
317        This method makes a synchronous HTTP request by default. To make an
318        asynchronous HTTP request, please define a `callback` function
319        to be invoked when receiving the response.
320        >>> def callback_function(response):
321        >>>     pprint(response)
322        >>>
323        >>> thread = api.list_instances_with_http_info(account_id, form_id, callback=callback_function)
324
325        :param callback function: The callback function
326            for asynchronous request. (optional)
327        :param str account_id: Account identifier in which the web form resides (required)
328        :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required)
329        :param str client_user_id: A unique identifier for a user that should originate from client's system. This value can be anything your backend system would use to track individual form instances. Examples include employee IDs, email addresses, surrogate key values, etc.
330        :return: WebFormInstanceList
331                 If the method is called asynchronously,
332                 returns the request thread.
333        """
334
335        all_params = ['account_id', 'form_id', 'client_user_id']
336        all_params.append('callback')
337        all_params.append('_return_http_data_only')
338        all_params.append('_preload_content')
339        all_params.append('_request_timeout')
340
341        params = locals()
342        for key, val in iteritems(params['kwargs']):
343            if key not in all_params:
344                raise TypeError(
345                    "Got an unexpected keyword argument '%s'"
346                    " to method list_instances" % key
347                )
348            params[key] = val
349        del params['kwargs']
350        # verify the required parameter 'account_id' is set
351        if ('account_id' not in params) or (params['account_id'] is None):
352            raise ValueError("Missing the required parameter `account_id` when calling `list_instances`")
353        # verify the required parameter 'form_id' is set
354        if ('form_id' not in params) or (params['form_id'] is None):
355            raise ValueError("Missing the required parameter `form_id` when calling `list_instances`")
356
357        if 'client_user_id' in params and len(params['client_user_id']) > 100:
358            raise ValueError("Invalid value for parameter `client_user_id` when calling `list_instances`, length must be less than or equal to `100`")
359
360        collection_formats = {}
361
362        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances'.replace('{format}', 'json')
363        path_params = {}
364        if 'account_id' in params:
365            path_params['accountId'] = params['account_id']
366        if 'form_id' in params:
367            path_params['formId'] = params['form_id']
368
369        query_params = {}
370        if 'client_user_id' in params:
371            query_params['client_user_id'] = params['client_user_id']
372
373        header_params = {}
374
375        form_params = []
376        local_var_files = {}
377
378        body_params = None
379        # HTTP header `Accept`
380        header_params['Accept'] = self.api_client.\
381            select_header_accept(['application/json'])
382
383        # HTTP header `Content-Type`
384        header_params['Content-Type'] = self.api_client.\
385            select_header_content_type(['application/json'])
386
387        # Authentication setting
388        auth_settings = []
389
390        return self.api_client.call_api(resource_path, 'GET',
391                                        path_params,
392                                        query_params,
393                                        header_params,
394                                        body=body_params,
395                                        post_params=form_params,
396                                        files=local_var_files,
397                                        response_type='WebFormInstanceList',
398                                        auth_settings=auth_settings,
399                                        callback=params.get('callback'),
400                                        _return_http_data_only=params.get('_return_http_data_only'),
401                                        _preload_content=params.get('_preload_content', True),
402                                        _request_timeout=params.get('_request_timeout'),
403                                        collection_formats=collection_formats)
404
405    def refresh_token(self, account_id, form_id, instance_id, **kwargs):
406        """
407        Refreshes the instance token
408        Generates new instance token for the existing Web Form Instance.
409        This method makes a synchronous HTTP request by default. To make an
410        asynchronous HTTP request, please define a `callback` function
411        to be invoked when receiving the response.
412        >>> def callback_function(response):
413        >>>     pprint(response)
414        >>>
415        >>> thread = api.refresh_token(account_id, form_id, instance_id, callback=callback_function)
416
417        :param callback function: The callback function
418            for asynchronous request. (optional)
419        :param str account_id: Account identifier in which the web form resides (required)
420        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
421        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
422        :return: WebFormInstance
423                 If the method is called asynchronously,
424                 returns the request thread.
425        """
426        kwargs['_return_http_data_only'] = True
427        if kwargs.get('callback'):
428            return self.refresh_token_with_http_info(account_id, form_id, instance_id, **kwargs)
429        else:
430            (data) = self.refresh_token_with_http_info(account_id, form_id, instance_id, **kwargs)
431            return data
432
433    def refresh_token_with_http_info(self, account_id, form_id, instance_id, **kwargs):
434        """
435        Refreshes the instance token
436        Generates new instance token for the existing Web Form Instance.
437        This method makes a synchronous HTTP request by default. To make an
438        asynchronous HTTP request, please define a `callback` function
439        to be invoked when receiving the response.
440        >>> def callback_function(response):
441        >>>     pprint(response)
442        >>>
443        >>> thread = api.refresh_token_with_http_info(account_id, form_id, instance_id, callback=callback_function)
444
445        :param callback function: The callback function
446            for asynchronous request. (optional)
447        :param str account_id: Account identifier in which the web form resides (required)
448        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
449        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
450        :return: WebFormInstance
451                 If the method is called asynchronously,
452                 returns the request thread.
453        """
454
455        all_params = ['account_id', 'form_id', 'instance_id']
456        all_params.append('callback')
457        all_params.append('_return_http_data_only')
458        all_params.append('_preload_content')
459        all_params.append('_request_timeout')
460
461        params = locals()
462        for key, val in iteritems(params['kwargs']):
463            if key not in all_params:
464                raise TypeError(
465                    "Got an unexpected keyword argument '%s'"
466                    " to method refresh_token" % key
467                )
468            params[key] = val
469        del params['kwargs']
470        # verify the required parameter 'account_id' is set
471        if ('account_id' not in params) or (params['account_id'] is None):
472            raise ValueError("Missing the required parameter `account_id` when calling `refresh_token`")
473        # verify the required parameter 'form_id' is set
474        if ('form_id' not in params) or (params['form_id'] is None):
475            raise ValueError("Missing the required parameter `form_id` when calling `refresh_token`")
476        # verify the required parameter 'instance_id' is set
477        if ('instance_id' not in params) or (params['instance_id'] is None):
478            raise ValueError("Missing the required parameter `instance_id` when calling `refresh_token`")
479
480
481        collection_formats = {}
482
483        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances/{instanceId}/refresh'.replace('{format}', 'json')
484        path_params = {}
485        if 'account_id' in params:
486            path_params['accountId'] = params['account_id']
487        if 'form_id' in params:
488            path_params['formId'] = params['form_id']
489        if 'instance_id' in params:
490            path_params['instanceId'] = params['instance_id']
491
492        query_params = {}
493
494        header_params = {}
495
496        form_params = []
497        local_var_files = {}
498
499        body_params = None
500        # HTTP header `Accept`
501        header_params['Accept'] = self.api_client.\
502            select_header_accept(['application/json'])
503
504        # HTTP header `Content-Type`
505        header_params['Content-Type'] = self.api_client.\
506            select_header_content_type(['application/json'])
507
508        # Authentication setting
509        auth_settings = []
510
511        return self.api_client.call_api(resource_path, 'POST',
512                                        path_params,
513                                        query_params,
514                                        header_params,
515                                        body=body_params,
516                                        post_params=form_params,
517                                        files=local_var_files,
518                                        response_type='WebFormInstance',
519                                        auth_settings=auth_settings,
520                                        callback=params.get('callback'),
521                                        _return_http_data_only=params.get('_return_http_data_only'),
522                                        _preload_content=params.get('_preload_content', True),
523                                        _request_timeout=params.get('_request_timeout'),
524                                        collection_formats=collection_formats)
class FormInstanceManagementApi:
 28class FormInstanceManagementApi(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_instance(self, account_id, form_id, create_instance_body, **kwargs):
 45        """
 46        Creates an instance of the web form
 47        Creates an instance of the web form.
 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_instance(account_id, form_id, create_instance_body, callback=callback_function)
 55
 56        :param callback function: The callback function
 57            for asynchronous request. (optional)
 58        :param str account_id: Account identifier in which the web form resides (required)
 59        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
 60        :param CreateInstanceRequestBody create_instance_body: Request body containing properties that will be used to create instance. (required)
 61        :return: WebFormInstance
 62                 If the method is called asynchronously,
 63                 returns the request thread.
 64        """
 65        kwargs['_return_http_data_only'] = True
 66        if kwargs.get('callback'):
 67            return self.create_instance_with_http_info(account_id, form_id, create_instance_body, **kwargs)
 68        else:
 69            (data) = self.create_instance_with_http_info(account_id, form_id, create_instance_body, **kwargs)
 70            return data
 71
 72    def create_instance_with_http_info(self, account_id, form_id, create_instance_body, **kwargs):
 73        """
 74        Creates an instance of the web form
 75        Creates an instance of the web form.
 76        This method makes a synchronous HTTP request by default. To make an
 77        asynchronous HTTP request, please define a `callback` function
 78        to be invoked when receiving the response.
 79        >>> def callback_function(response):
 80        >>>     pprint(response)
 81        >>>
 82        >>> thread = api.create_instance_with_http_info(account_id, form_id, create_instance_body, callback=callback_function)
 83
 84        :param callback function: The callback function
 85            for asynchronous request. (optional)
 86        :param str account_id: Account identifier in which the web form resides (required)
 87        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
 88        :param CreateInstanceRequestBody create_instance_body: Request body containing properties that will be used to create instance. (required)
 89        :return: WebFormInstance
 90                 If the method is called asynchronously,
 91                 returns the request thread.
 92        """
 93
 94        all_params = ['account_id', 'form_id', 'create_instance_body']
 95        all_params.append('callback')
 96        all_params.append('_return_http_data_only')
 97        all_params.append('_preload_content')
 98        all_params.append('_request_timeout')
 99
100        params = locals()
101        for key, val in iteritems(params['kwargs']):
102            if key not in all_params:
103                raise TypeError(
104                    "Got an unexpected keyword argument '%s'"
105                    " to method create_instance" % key
106                )
107            params[key] = val
108        del params['kwargs']
109        # verify the required parameter 'account_id' is set
110        if ('account_id' not in params) or (params['account_id'] is None):
111            raise ValueError("Missing the required parameter `account_id` when calling `create_instance`")
112        # verify the required parameter 'form_id' is set
113        if ('form_id' not in params) or (params['form_id'] is None):
114            raise ValueError("Missing the required parameter `form_id` when calling `create_instance`")
115        # verify the required parameter 'create_instance_body' is set
116        if ('create_instance_body' not in params) or (params['create_instance_body'] is None):
117            raise ValueError("Missing the required parameter `create_instance_body` when calling `create_instance`")
118
119
120        collection_formats = {}
121
122        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances'.replace('{format}', 'json')
123        path_params = {}
124        if 'account_id' in params:
125            path_params['accountId'] = params['account_id']
126        if 'form_id' in params:
127            path_params['formId'] = params['form_id']
128
129        query_params = {}
130
131        header_params = {}
132
133        form_params = []
134        local_var_files = {}
135
136        body_params = None
137        if 'create_instance_body' in params:
138            body_params = params['create_instance_body']
139        # HTTP header `Accept`
140        header_params['Accept'] = self.api_client.\
141            select_header_accept(['application/json'])
142
143        # HTTP header `Content-Type`
144        header_params['Content-Type'] = self.api_client.\
145            select_header_content_type(['application/json'])
146
147        # Authentication setting
148        auth_settings = []
149
150        return self.api_client.call_api(resource_path, 'POST',
151                                        path_params,
152                                        query_params,
153                                        header_params,
154                                        body=body_params,
155                                        post_params=form_params,
156                                        files=local_var_files,
157                                        response_type='WebFormInstance',
158                                        auth_settings=auth_settings,
159                                        callback=params.get('callback'),
160                                        _return_http_data_only=params.get('_return_http_data_only'),
161                                        _preload_content=params.get('_preload_content', True),
162                                        _request_timeout=params.get('_request_timeout'),
163                                        collection_formats=collection_formats)
164
165    def get_instance(self, account_id, form_id, instance_id, **kwargs):
166        """
167        Get form instance
168        Retrieves instance information filter by instance id
169        This method makes a synchronous HTTP request by default. To make an
170        asynchronous HTTP request, please define a `callback` function
171        to be invoked when receiving the response.
172        >>> def callback_function(response):
173        >>>     pprint(response)
174        >>>
175        >>> thread = api.get_instance(account_id, form_id, instance_id, callback=callback_function)
176
177        :param callback function: The callback function
178            for asynchronous request. (optional)
179        :param str account_id: Account identifier in which the web form resides (required)
180        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
181        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
182        :return: WebFormInstance
183                 If the method is called asynchronously,
184                 returns the request thread.
185        """
186        kwargs['_return_http_data_only'] = True
187        if kwargs.get('callback'):
188            return self.get_instance_with_http_info(account_id, form_id, instance_id, **kwargs)
189        else:
190            (data) = self.get_instance_with_http_info(account_id, form_id, instance_id, **kwargs)
191            return data
192
193    def get_instance_with_http_info(self, account_id, form_id, instance_id, **kwargs):
194        """
195        Get form instance
196        Retrieves instance information filter by instance id
197        This method makes a synchronous HTTP request by default. To make an
198        asynchronous HTTP request, please define a `callback` function
199        to be invoked when receiving the response.
200        >>> def callback_function(response):
201        >>>     pprint(response)
202        >>>
203        >>> thread = api.get_instance_with_http_info(account_id, form_id, instance_id, callback=callback_function)
204
205        :param callback function: The callback function
206            for asynchronous request. (optional)
207        :param str account_id: Account identifier in which the web form resides (required)
208        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
209        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
210        :return: WebFormInstance
211                 If the method is called asynchronously,
212                 returns the request thread.
213        """
214
215        all_params = ['account_id', 'form_id', 'instance_id']
216        all_params.append('callback')
217        all_params.append('_return_http_data_only')
218        all_params.append('_preload_content')
219        all_params.append('_request_timeout')
220
221        params = locals()
222        for key, val in iteritems(params['kwargs']):
223            if key not in all_params:
224                raise TypeError(
225                    "Got an unexpected keyword argument '%s'"
226                    " to method get_instance" % key
227                )
228            params[key] = val
229        del params['kwargs']
230        # verify the required parameter 'account_id' is set
231        if ('account_id' not in params) or (params['account_id'] is None):
232            raise ValueError("Missing the required parameter `account_id` when calling `get_instance`")
233        # verify the required parameter 'form_id' is set
234        if ('form_id' not in params) or (params['form_id'] is None):
235            raise ValueError("Missing the required parameter `form_id` when calling `get_instance`")
236        # verify the required parameter 'instance_id' is set
237        if ('instance_id' not in params) or (params['instance_id'] is None):
238            raise ValueError("Missing the required parameter `instance_id` when calling `get_instance`")
239
240
241        collection_formats = {}
242
243        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances/{instanceId}'.replace('{format}', 'json')
244        path_params = {}
245        if 'account_id' in params:
246            path_params['accountId'] = params['account_id']
247        if 'form_id' in params:
248            path_params['formId'] = params['form_id']
249        if 'instance_id' in params:
250            path_params['instanceId'] = params['instance_id']
251
252        query_params = {}
253
254        header_params = {}
255
256        form_params = []
257        local_var_files = {}
258
259        body_params = None
260        # HTTP header `Accept`
261        header_params['Accept'] = self.api_client.\
262            select_header_accept(['application/json'])
263
264        # HTTP header `Content-Type`
265        header_params['Content-Type'] = self.api_client.\
266            select_header_content_type(['application/json'])
267
268        # Authentication setting
269        auth_settings = []
270
271        return self.api_client.call_api(resource_path, 'GET',
272                                        path_params,
273                                        query_params,
274                                        header_params,
275                                        body=body_params,
276                                        post_params=form_params,
277                                        files=local_var_files,
278                                        response_type='WebFormInstance',
279                                        auth_settings=auth_settings,
280                                        callback=params.get('callback'),
281                                        _return_http_data_only=params.get('_return_http_data_only'),
282                                        _preload_content=params.get('_preload_content', True),
283                                        _request_timeout=params.get('_request_timeout'),
284                                        collection_formats=collection_formats)
285
286    def list_instances(self, account_id, form_id, **kwargs):
287        """
288        List instances
289        List all the instances of a web form in an account. When filtered by clientUserId, it will return instances having same clientUserId
290        This method makes a synchronous HTTP request by default. To make an
291        asynchronous HTTP request, please define a `callback` function
292        to be invoked when receiving the response.
293        >>> def callback_function(response):
294        >>>     pprint(response)
295        >>>
296        >>> thread = api.list_instances(account_id, form_id, callback=callback_function)
297
298        :param callback function: The callback function
299            for asynchronous request. (optional)
300        :param str account_id: Account identifier in which the web form resides (required)
301        :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required)
302        :param str client_user_id: A unique identifier for a user that should originate from client's system. This value can be anything your backend system would use to track individual form instances. Examples include employee IDs, email addresses, surrogate key values, etc.
303        :return: WebFormInstanceList
304                 If the method is called asynchronously,
305                 returns the request thread.
306        """
307        kwargs['_return_http_data_only'] = True
308        if kwargs.get('callback'):
309            return self.list_instances_with_http_info(account_id, form_id, **kwargs)
310        else:
311            (data) = self.list_instances_with_http_info(account_id, form_id, **kwargs)
312            return data
313
314    def list_instances_with_http_info(self, account_id, form_id, **kwargs):
315        """
316        List instances
317        List all the instances of a web form in an account. When filtered by clientUserId, it will return instances having same clientUserId
318        This method makes a synchronous HTTP request by default. To make an
319        asynchronous HTTP request, please define a `callback` function
320        to be invoked when receiving the response.
321        >>> def callback_function(response):
322        >>>     pprint(response)
323        >>>
324        >>> thread = api.list_instances_with_http_info(account_id, form_id, callback=callback_function)
325
326        :param callback function: The callback function
327            for asynchronous request. (optional)
328        :param str account_id: Account identifier in which the web form resides (required)
329        :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required)
330        :param str client_user_id: A unique identifier for a user that should originate from client's system. This value can be anything your backend system would use to track individual form instances. Examples include employee IDs, email addresses, surrogate key values, etc.
331        :return: WebFormInstanceList
332                 If the method is called asynchronously,
333                 returns the request thread.
334        """
335
336        all_params = ['account_id', 'form_id', 'client_user_id']
337        all_params.append('callback')
338        all_params.append('_return_http_data_only')
339        all_params.append('_preload_content')
340        all_params.append('_request_timeout')
341
342        params = locals()
343        for key, val in iteritems(params['kwargs']):
344            if key not in all_params:
345                raise TypeError(
346                    "Got an unexpected keyword argument '%s'"
347                    " to method list_instances" % key
348                )
349            params[key] = val
350        del params['kwargs']
351        # verify the required parameter 'account_id' is set
352        if ('account_id' not in params) or (params['account_id'] is None):
353            raise ValueError("Missing the required parameter `account_id` when calling `list_instances`")
354        # verify the required parameter 'form_id' is set
355        if ('form_id' not in params) or (params['form_id'] is None):
356            raise ValueError("Missing the required parameter `form_id` when calling `list_instances`")
357
358        if 'client_user_id' in params and len(params['client_user_id']) > 100:
359            raise ValueError("Invalid value for parameter `client_user_id` when calling `list_instances`, length must be less than or equal to `100`")
360
361        collection_formats = {}
362
363        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances'.replace('{format}', 'json')
364        path_params = {}
365        if 'account_id' in params:
366            path_params['accountId'] = params['account_id']
367        if 'form_id' in params:
368            path_params['formId'] = params['form_id']
369
370        query_params = {}
371        if 'client_user_id' in params:
372            query_params['client_user_id'] = params['client_user_id']
373
374        header_params = {}
375
376        form_params = []
377        local_var_files = {}
378
379        body_params = None
380        # HTTP header `Accept`
381        header_params['Accept'] = self.api_client.\
382            select_header_accept(['application/json'])
383
384        # HTTP header `Content-Type`
385        header_params['Content-Type'] = self.api_client.\
386            select_header_content_type(['application/json'])
387
388        # Authentication setting
389        auth_settings = []
390
391        return self.api_client.call_api(resource_path, 'GET',
392                                        path_params,
393                                        query_params,
394                                        header_params,
395                                        body=body_params,
396                                        post_params=form_params,
397                                        files=local_var_files,
398                                        response_type='WebFormInstanceList',
399                                        auth_settings=auth_settings,
400                                        callback=params.get('callback'),
401                                        _return_http_data_only=params.get('_return_http_data_only'),
402                                        _preload_content=params.get('_preload_content', True),
403                                        _request_timeout=params.get('_request_timeout'),
404                                        collection_formats=collection_formats)
405
406    def refresh_token(self, account_id, form_id, instance_id, **kwargs):
407        """
408        Refreshes the instance token
409        Generates new instance token for the existing Web Form Instance.
410        This method makes a synchronous HTTP request by default. To make an
411        asynchronous HTTP request, please define a `callback` function
412        to be invoked when receiving the response.
413        >>> def callback_function(response):
414        >>>     pprint(response)
415        >>>
416        >>> thread = api.refresh_token(account_id, form_id, instance_id, callback=callback_function)
417
418        :param callback function: The callback function
419            for asynchronous request. (optional)
420        :param str account_id: Account identifier in which the web form resides (required)
421        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
422        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
423        :return: WebFormInstance
424                 If the method is called asynchronously,
425                 returns the request thread.
426        """
427        kwargs['_return_http_data_only'] = True
428        if kwargs.get('callback'):
429            return self.refresh_token_with_http_info(account_id, form_id, instance_id, **kwargs)
430        else:
431            (data) = self.refresh_token_with_http_info(account_id, form_id, instance_id, **kwargs)
432            return data
433
434    def refresh_token_with_http_info(self, account_id, form_id, instance_id, **kwargs):
435        """
436        Refreshes the instance token
437        Generates new instance token for the existing Web Form Instance.
438        This method makes a synchronous HTTP request by default. To make an
439        asynchronous HTTP request, please define a `callback` function
440        to be invoked when receiving the response.
441        >>> def callback_function(response):
442        >>>     pprint(response)
443        >>>
444        >>> thread = api.refresh_token_with_http_info(account_id, form_id, instance_id, callback=callback_function)
445
446        :param callback function: The callback function
447            for asynchronous request. (optional)
448        :param str account_id: Account identifier in which the web form resides (required)
449        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
450        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
451        :return: WebFormInstance
452                 If the method is called asynchronously,
453                 returns the request thread.
454        """
455
456        all_params = ['account_id', 'form_id', 'instance_id']
457        all_params.append('callback')
458        all_params.append('_return_http_data_only')
459        all_params.append('_preload_content')
460        all_params.append('_request_timeout')
461
462        params = locals()
463        for key, val in iteritems(params['kwargs']):
464            if key not in all_params:
465                raise TypeError(
466                    "Got an unexpected keyword argument '%s'"
467                    " to method refresh_token" % key
468                )
469            params[key] = val
470        del params['kwargs']
471        # verify the required parameter 'account_id' is set
472        if ('account_id' not in params) or (params['account_id'] is None):
473            raise ValueError("Missing the required parameter `account_id` when calling `refresh_token`")
474        # verify the required parameter 'form_id' is set
475        if ('form_id' not in params) or (params['form_id'] is None):
476            raise ValueError("Missing the required parameter `form_id` when calling `refresh_token`")
477        # verify the required parameter 'instance_id' is set
478        if ('instance_id' not in params) or (params['instance_id'] is None):
479            raise ValueError("Missing the required parameter `instance_id` when calling `refresh_token`")
480
481
482        collection_formats = {}
483
484        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances/{instanceId}/refresh'.replace('{format}', 'json')
485        path_params = {}
486        if 'account_id' in params:
487            path_params['accountId'] = params['account_id']
488        if 'form_id' in params:
489            path_params['formId'] = params['form_id']
490        if 'instance_id' in params:
491            path_params['instanceId'] = params['instance_id']
492
493        query_params = {}
494
495        header_params = {}
496
497        form_params = []
498        local_var_files = {}
499
500        body_params = None
501        # HTTP header `Accept`
502        header_params['Accept'] = self.api_client.\
503            select_header_accept(['application/json'])
504
505        # HTTP header `Content-Type`
506        header_params['Content-Type'] = self.api_client.\
507            select_header_content_type(['application/json'])
508
509        # Authentication setting
510        auth_settings = []
511
512        return self.api_client.call_api(resource_path, 'POST',
513                                        path_params,
514                                        query_params,
515                                        header_params,
516                                        body=body_params,
517                                        post_params=form_params,
518                                        files=local_var_files,
519                                        response_type='WebFormInstance',
520                                        auth_settings=auth_settings,
521                                        callback=params.get('callback'),
522                                        _return_http_data_only=params.get('_return_http_data_only'),
523                                        _preload_content=params.get('_preload_content', True),
524                                        _request_timeout=params.get('_request_timeout'),
525                                        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

FormInstanceManagementApi(api_client=None)
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
def create_instance(self, account_id, form_id, create_instance_body, **kwargs)
44    def create_instance(self, account_id, form_id, create_instance_body, **kwargs):
45        """
46        Creates an instance of the web form
47        Creates an instance of the web form.
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_instance(account_id, form_id, create_instance_body, callback=callback_function)
55
56        :param callback function: The callback function
57            for asynchronous request. (optional)
58        :param str account_id: Account identifier in which the web form resides (required)
59        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
60        :param CreateInstanceRequestBody create_instance_body: Request body containing properties that will be used to create instance. (required)
61        :return: WebFormInstance
62                 If the method is called asynchronously,
63                 returns the request thread.
64        """
65        kwargs['_return_http_data_only'] = True
66        if kwargs.get('callback'):
67            return self.create_instance_with_http_info(account_id, form_id, create_instance_body, **kwargs)
68        else:
69            (data) = self.create_instance_with_http_info(account_id, form_id, create_instance_body, **kwargs)
70            return data

Creates an instance of the web form Creates an instance of the web form. 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_instance(account_id, form_id, create_instance_body, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: Account identifier in which the web form resides (required)
  • str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
  • CreateInstanceRequestBody create_instance_body: Request body containing properties that will be used to create instance. (required)
Returns

WebFormInstance If the method is called asynchronously, returns the request thread.

def create_instance_with_http_info(self, account_id, form_id, create_instance_body, **kwargs)
 72    def create_instance_with_http_info(self, account_id, form_id, create_instance_body, **kwargs):
 73        """
 74        Creates an instance of the web form
 75        Creates an instance of the web form.
 76        This method makes a synchronous HTTP request by default. To make an
 77        asynchronous HTTP request, please define a `callback` function
 78        to be invoked when receiving the response.
 79        >>> def callback_function(response):
 80        >>>     pprint(response)
 81        >>>
 82        >>> thread = api.create_instance_with_http_info(account_id, form_id, create_instance_body, callback=callback_function)
 83
 84        :param callback function: The callback function
 85            for asynchronous request. (optional)
 86        :param str account_id: Account identifier in which the web form resides (required)
 87        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
 88        :param CreateInstanceRequestBody create_instance_body: Request body containing properties that will be used to create instance. (required)
 89        :return: WebFormInstance
 90                 If the method is called asynchronously,
 91                 returns the request thread.
 92        """
 93
 94        all_params = ['account_id', 'form_id', 'create_instance_body']
 95        all_params.append('callback')
 96        all_params.append('_return_http_data_only')
 97        all_params.append('_preload_content')
 98        all_params.append('_request_timeout')
 99
100        params = locals()
101        for key, val in iteritems(params['kwargs']):
102            if key not in all_params:
103                raise TypeError(
104                    "Got an unexpected keyword argument '%s'"
105                    " to method create_instance" % key
106                )
107            params[key] = val
108        del params['kwargs']
109        # verify the required parameter 'account_id' is set
110        if ('account_id' not in params) or (params['account_id'] is None):
111            raise ValueError("Missing the required parameter `account_id` when calling `create_instance`")
112        # verify the required parameter 'form_id' is set
113        if ('form_id' not in params) or (params['form_id'] is None):
114            raise ValueError("Missing the required parameter `form_id` when calling `create_instance`")
115        # verify the required parameter 'create_instance_body' is set
116        if ('create_instance_body' not in params) or (params['create_instance_body'] is None):
117            raise ValueError("Missing the required parameter `create_instance_body` when calling `create_instance`")
118
119
120        collection_formats = {}
121
122        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances'.replace('{format}', 'json')
123        path_params = {}
124        if 'account_id' in params:
125            path_params['accountId'] = params['account_id']
126        if 'form_id' in params:
127            path_params['formId'] = params['form_id']
128
129        query_params = {}
130
131        header_params = {}
132
133        form_params = []
134        local_var_files = {}
135
136        body_params = None
137        if 'create_instance_body' in params:
138            body_params = params['create_instance_body']
139        # HTTP header `Accept`
140        header_params['Accept'] = self.api_client.\
141            select_header_accept(['application/json'])
142
143        # HTTP header `Content-Type`
144        header_params['Content-Type'] = self.api_client.\
145            select_header_content_type(['application/json'])
146
147        # Authentication setting
148        auth_settings = []
149
150        return self.api_client.call_api(resource_path, 'POST',
151                                        path_params,
152                                        query_params,
153                                        header_params,
154                                        body=body_params,
155                                        post_params=form_params,
156                                        files=local_var_files,
157                                        response_type='WebFormInstance',
158                                        auth_settings=auth_settings,
159                                        callback=params.get('callback'),
160                                        _return_http_data_only=params.get('_return_http_data_only'),
161                                        _preload_content=params.get('_preload_content', True),
162                                        _request_timeout=params.get('_request_timeout'),
163                                        collection_formats=collection_formats)

Creates an instance of the web form Creates an instance of the web form. 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_instance_with_http_info(account_id, form_id, create_instance_body, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: Account identifier in which the web form resides (required)
  • str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
  • CreateInstanceRequestBody create_instance_body: Request body containing properties that will be used to create instance. (required)
Returns

WebFormInstance If the method is called asynchronously, returns the request thread.

def get_instance(self, account_id, form_id, instance_id, **kwargs)
165    def get_instance(self, account_id, form_id, instance_id, **kwargs):
166        """
167        Get form instance
168        Retrieves instance information filter by instance id
169        This method makes a synchronous HTTP request by default. To make an
170        asynchronous HTTP request, please define a `callback` function
171        to be invoked when receiving the response.
172        >>> def callback_function(response):
173        >>>     pprint(response)
174        >>>
175        >>> thread = api.get_instance(account_id, form_id, instance_id, callback=callback_function)
176
177        :param callback function: The callback function
178            for asynchronous request. (optional)
179        :param str account_id: Account identifier in which the web form resides (required)
180        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
181        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
182        :return: WebFormInstance
183                 If the method is called asynchronously,
184                 returns the request thread.
185        """
186        kwargs['_return_http_data_only'] = True
187        if kwargs.get('callback'):
188            return self.get_instance_with_http_info(account_id, form_id, instance_id, **kwargs)
189        else:
190            (data) = self.get_instance_with_http_info(account_id, form_id, instance_id, **kwargs)
191            return data

Get form instance Retrieves instance information filter by instance id 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_instance(account_id, form_id, instance_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: Account identifier in which the web form resides (required)
  • str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
  • str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
Returns

WebFormInstance If the method is called asynchronously, returns the request thread.

def get_instance_with_http_info(self, account_id, form_id, instance_id, **kwargs)
193    def get_instance_with_http_info(self, account_id, form_id, instance_id, **kwargs):
194        """
195        Get form instance
196        Retrieves instance information filter by instance id
197        This method makes a synchronous HTTP request by default. To make an
198        asynchronous HTTP request, please define a `callback` function
199        to be invoked when receiving the response.
200        >>> def callback_function(response):
201        >>>     pprint(response)
202        >>>
203        >>> thread = api.get_instance_with_http_info(account_id, form_id, instance_id, callback=callback_function)
204
205        :param callback function: The callback function
206            for asynchronous request. (optional)
207        :param str account_id: Account identifier in which the web form resides (required)
208        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
209        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
210        :return: WebFormInstance
211                 If the method is called asynchronously,
212                 returns the request thread.
213        """
214
215        all_params = ['account_id', 'form_id', 'instance_id']
216        all_params.append('callback')
217        all_params.append('_return_http_data_only')
218        all_params.append('_preload_content')
219        all_params.append('_request_timeout')
220
221        params = locals()
222        for key, val in iteritems(params['kwargs']):
223            if key not in all_params:
224                raise TypeError(
225                    "Got an unexpected keyword argument '%s'"
226                    " to method get_instance" % key
227                )
228            params[key] = val
229        del params['kwargs']
230        # verify the required parameter 'account_id' is set
231        if ('account_id' not in params) or (params['account_id'] is None):
232            raise ValueError("Missing the required parameter `account_id` when calling `get_instance`")
233        # verify the required parameter 'form_id' is set
234        if ('form_id' not in params) or (params['form_id'] is None):
235            raise ValueError("Missing the required parameter `form_id` when calling `get_instance`")
236        # verify the required parameter 'instance_id' is set
237        if ('instance_id' not in params) or (params['instance_id'] is None):
238            raise ValueError("Missing the required parameter `instance_id` when calling `get_instance`")
239
240
241        collection_formats = {}
242
243        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances/{instanceId}'.replace('{format}', 'json')
244        path_params = {}
245        if 'account_id' in params:
246            path_params['accountId'] = params['account_id']
247        if 'form_id' in params:
248            path_params['formId'] = params['form_id']
249        if 'instance_id' in params:
250            path_params['instanceId'] = params['instance_id']
251
252        query_params = {}
253
254        header_params = {}
255
256        form_params = []
257        local_var_files = {}
258
259        body_params = None
260        # HTTP header `Accept`
261        header_params['Accept'] = self.api_client.\
262            select_header_accept(['application/json'])
263
264        # HTTP header `Content-Type`
265        header_params['Content-Type'] = self.api_client.\
266            select_header_content_type(['application/json'])
267
268        # Authentication setting
269        auth_settings = []
270
271        return self.api_client.call_api(resource_path, 'GET',
272                                        path_params,
273                                        query_params,
274                                        header_params,
275                                        body=body_params,
276                                        post_params=form_params,
277                                        files=local_var_files,
278                                        response_type='WebFormInstance',
279                                        auth_settings=auth_settings,
280                                        callback=params.get('callback'),
281                                        _return_http_data_only=params.get('_return_http_data_only'),
282                                        _preload_content=params.get('_preload_content', True),
283                                        _request_timeout=params.get('_request_timeout'),
284                                        collection_formats=collection_formats)

Get form instance Retrieves instance information filter by instance id 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_instance_with_http_info(account_id, form_id, instance_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: Account identifier in which the web form resides (required)
  • str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
  • str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
Returns

WebFormInstance If the method is called asynchronously, returns the request thread.

def list_instances(self, account_id, form_id, **kwargs)
286    def list_instances(self, account_id, form_id, **kwargs):
287        """
288        List instances
289        List all the instances of a web form in an account. When filtered by clientUserId, it will return instances having same clientUserId
290        This method makes a synchronous HTTP request by default. To make an
291        asynchronous HTTP request, please define a `callback` function
292        to be invoked when receiving the response.
293        >>> def callback_function(response):
294        >>>     pprint(response)
295        >>>
296        >>> thread = api.list_instances(account_id, form_id, callback=callback_function)
297
298        :param callback function: The callback function
299            for asynchronous request. (optional)
300        :param str account_id: Account identifier in which the web form resides (required)
301        :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required)
302        :param str client_user_id: A unique identifier for a user that should originate from client's system. This value can be anything your backend system would use to track individual form instances. Examples include employee IDs, email addresses, surrogate key values, etc.
303        :return: WebFormInstanceList
304                 If the method is called asynchronously,
305                 returns the request thread.
306        """
307        kwargs['_return_http_data_only'] = True
308        if kwargs.get('callback'):
309            return self.list_instances_with_http_info(account_id, form_id, **kwargs)
310        else:
311            (data) = self.list_instances_with_http_info(account_id, form_id, **kwargs)
312            return data

List instances List all the instances of a web form in an account. When filtered by clientUserId, it will return instances having same clientUserId 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_instances(account_id, form_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: Account identifier in which the web form resides (required)
  • str form_id: Unique identifier for a web form that is consistent for it's lifetime (required)
  • str client_user_id: A unique identifier for a user that should originate from client's system. This value can be anything your backend system would use to track individual form instances. Examples include employee IDs, email addresses, surrogate key values, etc.
Returns

WebFormInstanceList If the method is called asynchronously, returns the request thread.

def list_instances_with_http_info(self, account_id, form_id, **kwargs)
314    def list_instances_with_http_info(self, account_id, form_id, **kwargs):
315        """
316        List instances
317        List all the instances of a web form in an account. When filtered by clientUserId, it will return instances having same clientUserId
318        This method makes a synchronous HTTP request by default. To make an
319        asynchronous HTTP request, please define a `callback` function
320        to be invoked when receiving the response.
321        >>> def callback_function(response):
322        >>>     pprint(response)
323        >>>
324        >>> thread = api.list_instances_with_http_info(account_id, form_id, callback=callback_function)
325
326        :param callback function: The callback function
327            for asynchronous request. (optional)
328        :param str account_id: Account identifier in which the web form resides (required)
329        :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required)
330        :param str client_user_id: A unique identifier for a user that should originate from client's system. This value can be anything your backend system would use to track individual form instances. Examples include employee IDs, email addresses, surrogate key values, etc.
331        :return: WebFormInstanceList
332                 If the method is called asynchronously,
333                 returns the request thread.
334        """
335
336        all_params = ['account_id', 'form_id', 'client_user_id']
337        all_params.append('callback')
338        all_params.append('_return_http_data_only')
339        all_params.append('_preload_content')
340        all_params.append('_request_timeout')
341
342        params = locals()
343        for key, val in iteritems(params['kwargs']):
344            if key not in all_params:
345                raise TypeError(
346                    "Got an unexpected keyword argument '%s'"
347                    " to method list_instances" % key
348                )
349            params[key] = val
350        del params['kwargs']
351        # verify the required parameter 'account_id' is set
352        if ('account_id' not in params) or (params['account_id'] is None):
353            raise ValueError("Missing the required parameter `account_id` when calling `list_instances`")
354        # verify the required parameter 'form_id' is set
355        if ('form_id' not in params) or (params['form_id'] is None):
356            raise ValueError("Missing the required parameter `form_id` when calling `list_instances`")
357
358        if 'client_user_id' in params and len(params['client_user_id']) > 100:
359            raise ValueError("Invalid value for parameter `client_user_id` when calling `list_instances`, length must be less than or equal to `100`")
360
361        collection_formats = {}
362
363        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances'.replace('{format}', 'json')
364        path_params = {}
365        if 'account_id' in params:
366            path_params['accountId'] = params['account_id']
367        if 'form_id' in params:
368            path_params['formId'] = params['form_id']
369
370        query_params = {}
371        if 'client_user_id' in params:
372            query_params['client_user_id'] = params['client_user_id']
373
374        header_params = {}
375
376        form_params = []
377        local_var_files = {}
378
379        body_params = None
380        # HTTP header `Accept`
381        header_params['Accept'] = self.api_client.\
382            select_header_accept(['application/json'])
383
384        # HTTP header `Content-Type`
385        header_params['Content-Type'] = self.api_client.\
386            select_header_content_type(['application/json'])
387
388        # Authentication setting
389        auth_settings = []
390
391        return self.api_client.call_api(resource_path, 'GET',
392                                        path_params,
393                                        query_params,
394                                        header_params,
395                                        body=body_params,
396                                        post_params=form_params,
397                                        files=local_var_files,
398                                        response_type='WebFormInstanceList',
399                                        auth_settings=auth_settings,
400                                        callback=params.get('callback'),
401                                        _return_http_data_only=params.get('_return_http_data_only'),
402                                        _preload_content=params.get('_preload_content', True),
403                                        _request_timeout=params.get('_request_timeout'),
404                                        collection_formats=collection_formats)

List instances List all the instances of a web form in an account. When filtered by clientUserId, it will return instances having same clientUserId 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_instances_with_http_info(account_id, form_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: Account identifier in which the web form resides (required)
  • str form_id: Unique identifier for a web form that is consistent for it's lifetime (required)
  • str client_user_id: A unique identifier for a user that should originate from client's system. This value can be anything your backend system would use to track individual form instances. Examples include employee IDs, email addresses, surrogate key values, etc.
Returns

WebFormInstanceList If the method is called asynchronously, returns the request thread.

def refresh_token(self, account_id, form_id, instance_id, **kwargs)
406    def refresh_token(self, account_id, form_id, instance_id, **kwargs):
407        """
408        Refreshes the instance token
409        Generates new instance token for the existing Web Form Instance.
410        This method makes a synchronous HTTP request by default. To make an
411        asynchronous HTTP request, please define a `callback` function
412        to be invoked when receiving the response.
413        >>> def callback_function(response):
414        >>>     pprint(response)
415        >>>
416        >>> thread = api.refresh_token(account_id, form_id, instance_id, callback=callback_function)
417
418        :param callback function: The callback function
419            for asynchronous request. (optional)
420        :param str account_id: Account identifier in which the web form resides (required)
421        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
422        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
423        :return: WebFormInstance
424                 If the method is called asynchronously,
425                 returns the request thread.
426        """
427        kwargs['_return_http_data_only'] = True
428        if kwargs.get('callback'):
429            return self.refresh_token_with_http_info(account_id, form_id, instance_id, **kwargs)
430        else:
431            (data) = self.refresh_token_with_http_info(account_id, form_id, instance_id, **kwargs)
432            return data

Refreshes the instance token Generates new instance token for the existing Web Form Instance. 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.refresh_token(account_id, form_id, instance_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: Account identifier in which the web form resides (required)
  • str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
  • str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
Returns

WebFormInstance If the method is called asynchronously, returns the request thread.

def refresh_token_with_http_info(self, account_id, form_id, instance_id, **kwargs)
434    def refresh_token_with_http_info(self, account_id, form_id, instance_id, **kwargs):
435        """
436        Refreshes the instance token
437        Generates new instance token for the existing Web Form Instance.
438        This method makes a synchronous HTTP request by default. To make an
439        asynchronous HTTP request, please define a `callback` function
440        to be invoked when receiving the response.
441        >>> def callback_function(response):
442        >>>     pprint(response)
443        >>>
444        >>> thread = api.refresh_token_with_http_info(account_id, form_id, instance_id, callback=callback_function)
445
446        :param callback function: The callback function
447            for asynchronous request. (optional)
448        :param str account_id: Account identifier in which the web form resides (required)
449        :param str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
450        :param str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
451        :return: WebFormInstance
452                 If the method is called asynchronously,
453                 returns the request thread.
454        """
455
456        all_params = ['account_id', 'form_id', 'instance_id']
457        all_params.append('callback')
458        all_params.append('_return_http_data_only')
459        all_params.append('_preload_content')
460        all_params.append('_request_timeout')
461
462        params = locals()
463        for key, val in iteritems(params['kwargs']):
464            if key not in all_params:
465                raise TypeError(
466                    "Got an unexpected keyword argument '%s'"
467                    " to method refresh_token" % key
468                )
469            params[key] = val
470        del params['kwargs']
471        # verify the required parameter 'account_id' is set
472        if ('account_id' not in params) or (params['account_id'] is None):
473            raise ValueError("Missing the required parameter `account_id` when calling `refresh_token`")
474        # verify the required parameter 'form_id' is set
475        if ('form_id' not in params) or (params['form_id'] is None):
476            raise ValueError("Missing the required parameter `form_id` when calling `refresh_token`")
477        # verify the required parameter 'instance_id' is set
478        if ('instance_id' not in params) or (params['instance_id'] is None):
479            raise ValueError("Missing the required parameter `instance_id` when calling `refresh_token`")
480
481
482        collection_formats = {}
483
484        resource_path = '/v1.1/accounts/{accountId}/forms/{formId}/instances/{instanceId}/refresh'.replace('{format}', 'json')
485        path_params = {}
486        if 'account_id' in params:
487            path_params['accountId'] = params['account_id']
488        if 'form_id' in params:
489            path_params['formId'] = params['form_id']
490        if 'instance_id' in params:
491            path_params['instanceId'] = params['instance_id']
492
493        query_params = {}
494
495        header_params = {}
496
497        form_params = []
498        local_var_files = {}
499
500        body_params = None
501        # HTTP header `Accept`
502        header_params['Accept'] = self.api_client.\
503            select_header_accept(['application/json'])
504
505        # HTTP header `Content-Type`
506        header_params['Content-Type'] = self.api_client.\
507            select_header_content_type(['application/json'])
508
509        # Authentication setting
510        auth_settings = []
511
512        return self.api_client.call_api(resource_path, 'POST',
513                                        path_params,
514                                        query_params,
515                                        header_params,
516                                        body=body_params,
517                                        post_params=form_params,
518                                        files=local_var_files,
519                                        response_type='WebFormInstance',
520                                        auth_settings=auth_settings,
521                                        callback=params.get('callback'),
522                                        _return_http_data_only=params.get('_return_http_data_only'),
523                                        _preload_content=params.get('_preload_content', True),
524                                        _request_timeout=params.get('_request_timeout'),
525                                        collection_formats=collection_formats)

Refreshes the instance token Generates new instance token for the existing Web Form Instance. 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.refresh_token_with_http_info(account_id, form_id, instance_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: Account identifier in which the web form resides (required)
  • str form_id: Unique identifier for a web form entity that is consistent for it's lifetime (required)
  • str instance_id: Unique identifier for a Web Form Instance that is consistent until its expiration (required)
Returns

WebFormInstance If the method is called asynchronously, returns the request thread.