@@ -1797,3 +1797,144 @@ def folder_lock(self, folder_lock_id):
17971797 :class:`FolderLock`
17981798 """
17991799 return self .translator .get ('folder_lock' )(session = self ._session , object_id = folder_lock_id )
1800+
1801+ def sign_request (self , sign_request_id ):
1802+ """
1803+ Initialize a :class:`SignRequest` object, whose box id is sign_request_id.
1804+
1805+ :param sign_request_id:
1806+ The box id of the :class:`SignRequest` object.
1807+ :type sign_request_id:
1808+ `unicode`
1809+ :return:
1810+ A :class:`SignRequest` object with the given file id.
1811+ :rtype:
1812+ :class:`SignRequest`
1813+ """
1814+ return self .translator .get ('sign_request' )(session = self ._session , object_id = sign_request_id )
1815+
1816+ @api_call
1817+ def create_sign_request (self , files , signers , parent_folder_id , prefill_tags = None , are_reminders_enabled = None , are_text_signatures_enabled = None ,
1818+ days_valid = None , email_message = None , email_subject = None , external_id = None , is_document_preparation_needed = None ):
1819+ """
1820+ Used to create a new sign request.
1821+
1822+ :param files:
1823+ List of files to create a signing document from.
1824+ :type files:
1825+ `Iterable`
1826+ :param signers:
1827+ List of signers for the sign request. 35 is the max number of signers permitted.
1828+ :type signers:
1829+ `Iterable`
1830+ :param parent_folder_id:
1831+ The id of the destination folder to place sign request specific data in.
1832+ :type parent_folder_id:
1833+ `unicode`
1834+ :param prefill_tags:
1835+ When a document contains sign related tags in the content,
1836+ you can prefill them using this prefill_tags by referencing the 'id' of the tag as the external_id field of the prefill tag.
1837+ :type prefill_tags:
1838+ `Iterable` or None
1839+ :param are_reminders_enabled:
1840+ Reminds signers to sign a document on day 3, 8, 13 and 18. Reminders are only sent to outstanding signers.
1841+ :type are_reminders_enabled:
1842+ `bool` or None
1843+ :param are_text_signatures_enabled:
1844+ Disables the usage of signatures generated by typing (text).
1845+ :type are_text_signatures_enabled:
1846+ `bool` or None
1847+ :param days_valid:
1848+ Number of days after which this request will automatically expire if not completed.
1849+ :type days_valid:
1850+ `unicode` or None
1851+ :param email_message:
1852+ Message to include in sign request email. The field is cleaned through sanitization of specific characters.
1853+ However, some html tags are allowed. Links included in the message are also converted to hyperlinks in the email.
1854+ The message may contain the following html tags including a, abbr, acronym, b, blockquote, code, em, i, ul, li, ol, and strong.
1855+ Be aware that when the text to html ratio is too high, the email may end up in spam filters. Custom styles on these tags are not allowed.
1856+ If this field is not passed, a default message will be used.
1857+ :type email_message:
1858+ `Iterable` or None
1859+ :param email_subject:
1860+ Subject of sign request email. This is cleaned by sign request. If this field is not passed, a default subject will be used.
1861+ :type email_subject:
1862+ `unicode` or None
1863+ :param external_id:
1864+ This can be used to reference an ID in an external system that the sign request is related to.
1865+ :type external_id:
1866+ `unicode` or None
1867+ :param is_document_preparation_needed:
1868+ Indicates if the sender should receive a prepare_url in the response to complete document preparation via UI.
1869+ :type is_document_preparation_needed:
1870+ `bool` or None
1871+ :returns:
1872+ A dictionary representing a created SignRequest
1873+ :rtype:
1874+ :class:`dict`
1875+ """
1876+ url = self ._session .get_url ('sign_requests' )
1877+
1878+ body = {
1879+ 'source_files' : files ,
1880+ 'signers' : signers ,
1881+ 'parent_folder' : {
1882+ 'id' : parent_folder_id ,
1883+ 'type' : 'folder'
1884+ }
1885+ }
1886+
1887+ if prefill_tags :
1888+ body ['prefill_tags' ] = prefill_tags
1889+ if are_reminders_enabled :
1890+ body ['are_reminders_enabled' ] = are_reminders_enabled
1891+ if are_text_signatures_enabled :
1892+ body ['are_text_signatures_enabled' ] = are_text_signatures_enabled
1893+ if days_valid :
1894+ body ['days_valid' ] = days_valid
1895+ if email_message :
1896+ body ['email_message' ] = email_message
1897+ if email_subject :
1898+ body ['email_subject' ] = email_subject
1899+ if external_id :
1900+ body ['external_id' ] = external_id
1901+ if is_document_preparation_needed :
1902+ body ['is_document_preparation_needed' ] = is_document_preparation_needed
1903+
1904+ box_response = self ._session .post (url , data = json .dumps (body ))
1905+ response = box_response .json ()
1906+ return self .translator .translate (
1907+ session = self ._session ,
1908+ response_object = response ,
1909+ )
1910+
1911+ @api_call
1912+ def get_sign_requests (self , limit = None , marker = None , fields = None ):
1913+ """
1914+ Returns all the sign requests.
1915+
1916+ :param limit:
1917+ The maximum number of entries to return per page. If not specified, then will use the server-side default.
1918+ :type limit:
1919+ `int` or None
1920+ :param marker:
1921+ The paging marker to start paging from.
1922+ :type marker:
1923+ `unicode` or None
1924+ :param fields:
1925+ List of fields to request.
1926+ :type fields:
1927+ `Iterable` of `unicode`
1928+ :returns:
1929+ An iterator of the entries in the device pins.
1930+ :rtype:
1931+ :class:`BoxObjectCollection`
1932+ """
1933+ return MarkerBasedObjectCollection (
1934+ session = self ._session ,
1935+ url = self .get_url ('sign_requests' ),
1936+ limit = limit ,
1937+ marker = marker ,
1938+ fields = fields ,
1939+ return_full_pages = False ,
1940+ )
0 commit comments