Open SudipRai opened 2 years ago
Just curious, how do you handle connection in your code? did you get a new refresh token?
I am handling the connection like this. The connection is made every day with the automation and it works fine for around 90 days.
Just some thoughts for your reference, may not be correct.
In the documentation, it says: (1) the Connection Class handles the authentication. (2) If your application needs to work for more than 90 days without user interaction and without interacting with the API, then you must implement a periodic call to Connection.refresh_token before the 90 days have passed.
so, I think your code should include refresh token method, then you will see a different refresh token in your txt file. My guess is that for the past 90 days, your refresh token did not change, so it failed when it comes to expiration.
The refresh token is changing with the every connection made.
Can you provide the code sample for making the periodic call to refresh the token??
If your refresh token is changing. I don't know then :(
I haven't implemented by myself. Just started to use O365, but from documentation, if need to manually call that, I will go something like:
from O365.connection import Connection c1=Connection(credentials) c1.refresh_token()
then in your token txt, the refresh token should be changed.
Is there any way we can bulk update the data in excel sheet through json. Accessing cell one by one and updating consumes a lot of times. And also how to delete all the data from particular workbook?
The refresh token is changing with the every connection made.
That's normal
Is there any way we can bulk update the data in excel sheet through json. Accessing cell one by one and updating consumes a lot of times. And also how to delete all the data from particular workbook?
I think that's not implemented. Check MS Graph to see if this is possible there. If it's possible there it should be easy to implement in O365
Yes, we can make a JSON data and update it in the Excel file at once using Graph API. Is there any way to do it the same way in O365??
The refresh token is changing with the every connection made.
That's normal
Is there any other way we can automate the process without the user interaction?
Of course implement a call once every 90 days
Do you mean using the Connection class ??
Is there any way we can bulk update the data in excel sheet through json. Accessing cell one by one and updating consumes a lot of times. And also how to delete all the data from particular workbook?
I think that's not implemented. Check MS Graph to see if this is possible there. If it's possible there it should be easy to implement in O365
You mean we can apply everything that is in Microsoft Graph API through O365 module? Can you provide me one example? Like if I want to call these Graph API : GET /me/drive/items/{id}/workbook/worksheets/{id|name} GET /me/drive/root:/{item-path}:/workbook/worksheets/{id|name}
Here, I dont want to use the WorkBook from O365.excel.
Just call account.con.refresh_token()
As per the documentation *O365 will automatically refresh the token for you on either authentication method. The refresh token lasts 90 days but it's refreshed on each connection so as long as you connect within 90 days you can have unlimited access.
But after using the token for certain period of time, reauthenticate is needed to access the resources. So, we have to reauthenticate for the access tokens every 90 days???