def get_account(self): """ Get info from your account @return Account data """ connection = Connection(self.token) connection.set_url(self.production, self.ACCOUNT_URL) return connection.get_request()
def get_signature(self, signature_id): """ Get a concrete Signature @return Signature data """ connection = Connection(self.token) connection.set_url(self.production, self.SIGNS_ID_URL % signature_id) return connection.get_request()
def get_email_certificates(self, email_id): """ Get certificates from a specific email """ connection = Connection(self.token) connection.set_url(self.production, self.EMAILS_CERTIFICATES_URL % email_id) return connection.get_request()
def get_email_certificate(self, email_id, certificate_id): """ Get single certificate from a specific email """ connection = Connection(self.token) connection.set_url(self.production, self.EMAILS_CERTIFICATES_ID_URL % (email_id, certificate_id)) return connection.get_request()
def get_signature_documents(self, signature_id): """ Get all documents from a concrete Signature @return List of documents """ connection = Connection(self.token) connection.set_url(self.production, self.SIGNS_DOCUMENTS_URL % signature_id) return connection.get_request()
def get_email(self, email_id): """ Get a specific email """ connection = Connection(self.token) connection.set_url(self.production, self.EMAILS_ID_URL % email_id) return connection.get_request()
def get_signature_document(self, signature_id, document_id): """ Get a concrete document from a concrete Signature @return Document data """ connection = Connection(self.token) connection.set_url(self.production, self.SIGNS_DOCUMENTS_ID_URL % (signature_id, document_id)) return connection.get_request()
def get_brandings(self): """ Get all account brandings @return List of brandings """ connection = Connection(self.token) connection.set_url(self.production, self.BRANDINGS_URL) return connection.get_request()
def get_templates(self, limit=100, offset=0): """ Get all account templates """ url = self.TEMPLATES_URL + "?limit=%s&offset=%s" % (limit, offset) connection = Connection(self.token) connection.set_url(self.production, url) return connection.get_request()
def get_branding(self, branding_id): """ Get a concrete branding @branding_id: Id of the branding to fetch @return Branding """ connection = Connection(self.token) connection.set_url(self.production, self.BRANDINGS_ID_URL % branding_id) return connection.get_request()
def get_emails(self, limit=100, offset=0, conditions={}): """ Get all certified emails """ url = self.EMAILS_URL + "?limit=%s&offset=%s" % (limit, offset) for key, value in conditions.items(): if key is 'ids': value = ",".join(value) url += '&%s=%s' % (key, value) connection = Connection(self.token) connection.set_url(self.production, url) return connection.get_request()
def count_emails(self, conditions={}): """ Count all certified emails """ url = self.EMAILS_COUNT_URL + "?" for key, value in conditions.items(): if key is 'ids': value = ",".join(value) url += '&%s=%s' % (key, value) connection = Connection(self.token) connection.set_url(self.production, url) connection.set_url(self.production, url) return connection.get_request()
def get_signatures(self, limit=100, offset=0, conditions={}): """ Get all signatures """ url = self.SIGNS_URL + "?limit=%s&offset=%s" % (limit, offset) for key, value in conditions.items(): if key is 'data': for data_key, data_value in value.items(): url += '&data[%s]=%s' % (data_key, data_value) continue if key is 'ids': value = ",".join(value) url += '&%s=%s' % (key, value) connection = Connection(self.token) connection.set_url(self.production, url) return connection.get_request()
def count_signatures(self, conditions={}): """ Count all signatures """ url = self.SIGNS_COUNT_URL + '?' for key, value in conditions.items(): if key is 'data': for data_key, data_value in value.items(): url += '&data[%s]=%s' % (data_key, data_value) continue if key is 'ids': value = ",".join(value) url += '&%s=%s' % (key, value) connection = Connection(self.token) connection.set_url(self.production, url) return connection.get_request()