def update_branding(self, branding_id, params): """ Update a existing branding @branding_id: Id of the branding to update @params: Same params as method create_branding, see above @return: A dict with updated branding data """ parser = Parser(self.TOUCH_BRANDING_PARAMS, []) parser.validate_data(params) connection = Connection(self.token) connection.add_header('Content-Type', 'application/json') connection.set_url(self.production, self.BRANDINGS_ID_URL % branding_id) connection.add_params(params) return connection.patch_request()
def create_branding(self, params): """ Create a new branding @params: An array of params (all params are optional) - primary: If set, this new branding will be the default one. - corporate_layout_color: Default color for all application widgets (hex code) - corporate_text_color: Default text color for all application widgets (hex code) - application_texts: A dict with the new text values - sign_button: Text for sign button - send_button: Text for send button - decline_button: Text for decline button: - decline_modal_title: Title for decline modal (when you click decline button) - decline_modal_body: Body for decline modal (when you click decline button) - photo: Photo message text, which tells the user that a photo is needed in the current process - multi_pages: Header of the document, which tells the user the number of pages to sign ex: { 'photo': 'Hey! Take a photo of yourself to validate the process!'} - subject_tag: This tag appears at the subject of all your messages ex: [ your_tag ] Pending document - reminders: A list with reminder times (in seconds). Every reminder time, a email will be sent, if the signer didn't sign the document ex: [ 3600 ] (At 30 minutes of sending the email)) - expire_time: The signature time (in seconds). When the expire time is over, the document cannot be signed. Set 0 if you want a signature without expire time. - callback_url: A url to redirect the user, when the process is over. - events_url: A url to send system event notifications - signature_pos_x: Default position x of signature - signature_pos_y: Default position y of signature - terms_and_conditions_label: The terms text that appears when you need to check the button to accept. - terms_and_conditions_body: Custom text that appears below signature conditions @return: A dict with branding data """ parser = Parser(self.TOUCH_BRANDING_PARAMS, []) parser.validate_data(params) connection = Connection(self.token) connection.add_header('Content-Type', 'application/json') connection.set_url(self.production, self.BRANDINGS_URL) connection.add_params(params, json_format=True) return connection.post_request()