From 5f2b7bdaea5f424900b7ebad4af678a9d69413ed Mon Sep 17 00:00:00 2001 From: Christian Finnberg Date: Thu, 6 Sep 2018 17:53:25 +0300 Subject: [PATCH 1/2] Add example of OAuth2 message creation --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 88a87703cf1f3..aa8bb844dddfe 100644 --- a/README.md +++ b/README.md @@ -175,10 +175,13 @@ from O365 import Connection, FluentInbox # Setup connection object # This will provide you with auth url, open it and authentication and copy the resulting page url and paste it back in the input -Connection.oauth2("your client_id", "your client_secret", store_token=True) +c = Connection.oauth2("your client_id", "your client_secret", store_token=True) # Proxy call is required only if you are behind proxy Connection.proxy(url='proxy.company.com', port=8080, username='proxy_username', password='proxy_password') + +# Start a message with OAuth2 +m = Message(oauth=c.oauth) ``` From b79da087cc0c2459908ffad2fa2ec0c55f85de1e Mon Sep 17 00:00:00 2001 From: Christian Finnberg Date: Thu, 6 Sep 2018 17:54:57 +0300 Subject: [PATCH 2/2] Typo --- O365/fluent_message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/O365/fluent_message.py b/O365/fluent_message.py index d1315f1479d26..55f22799516ac 100644 --- a/O365/fluent_message.py +++ b/O365/fluent_message.py @@ -126,7 +126,7 @@ def sendMessage(self, user_id=None, **kwargs): if user_id: url = self.send_as_url.format(user_id=user_id) else: - usl = self.send_url + url = self.send_url response = (self.oauth, requests)[self.oauth is None].post( url, data, headers=headers, auth=self.auth, verify=self.verify, **kwargs) log.debug('response from server for sending message:' + str(response))