def getAllMessages(self): response = requests.get(frontpoint + "v1/u/messages/All/unread", headers=self.headers) json_input = response.json() decoded = json.dumps(json_input) decoded = json.loads(decoded) data = decoded['data'] messages=[] for x in data: message = objects.message(self.token,self.pubkey,x["id"],x["sender"],x["content"]) messages.append(message) return messages
def getAllMessages(self): response = requests.get(frontpoint + "v1/u/messages/All/unread", headers=self.headers) json_input = response.json() decoded = json.dumps(json_input) decoded = json.loads(decoded) data = decoded['data'] messages = [] for x in data: message = objects.message(self.token, self.pubkey, x["id"], x["sender"], x["content"]) messages.append(message) return messages
def __init__(self, auth_key, secret, url, **kwargs): self._key = auth_key self._secret = secret self._url = url # Default request type is POST self._request_method = 'POST' # Setup optional persistent arguments self._args = {} for k, v in kwargs.items(): self._args[k] = v self.clear() # All the objects get initialized self.account = objects.account(self) self.attachment = objects.attachment(self) self.call = objects.call(self) self.chat = objects.chat(self) self.contact = objects.contact(self) self.conversation = objects.conversation(self) self.folder = objects.folder(self) self.history = objects.history(self) self.invoice = objects.invoice(self) self.key = objects.key(self) self.mailbox = objects.mailbox(self) self.message = objects.message(self) self.metrics = objects.metrics(self) self.note = objects.note(self) self.partner = objects.partner(self) self.popAccount = objects.popAccount(self) self.preference = objects.preference(self) self.search = objects.search(self) self.smtpServer = objects.smtpServer(self) self.tag = objects.tag(self) self.template = objects.template(self) self.ticket = objects.ticket(self) self.user = objects.user(self) self.utility = objects.utility(self)