Comments (6)
Some endpoints in the MS Graph API will insert a retry-after value in the response header when returning a 429 code. Teams isn't indicated as being one of them, but docs have been known to be wrong.
https://developer.microsoft.com/en-us/graph/docs/concepts/throttling
Batching may not necessarily make things better: it depends how the Teams API that sits underneath the Graph is counting API calls.
from channelsurf.
Yeah, I saw that page as well, and I can confirm that there's no retry-after value in the response header. Since batching the requests doesn't result in more messages being posted, I'm assuming there's a hard limit in the Teams API on the number of posts per hour. Throttling seems to reset after an hour.
Also, this bit of code will return a new token after the original expires. Right now i am just returning the new token from postMessage, so it will only allow you to upload a single channel because the new token never makes it back to the GetAndUploadMessages loop at the top of Messages.cs, but because we are making a new team for each channel, it works well enough for our purposes. Sorry for linearizing your beautifully object oriented program!
if (j["error"]["code"].ToString() == "InvalidAuthenticationToken")
{
// need to re-authenticate when token expires - made authenticationcontext public static
//this piece is successfully re-authenticating
//new access token is returned from method
string newToken = Program.authenticationContext.AcquireTokenSilentAsync(Program.aadResourceAppId, Program.Configuration["AzureAd:ClientId"]).Result.AccessToken;
Helpers.httpClient.DefaultRequestHeaders.Clear();
Helpers.httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", newToken);
Helpers.httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
from channelsurf.
@argvMatey Thanks for sharing your improvements. Do you still have the code? Could you share it as a Pull-Request? I guess it would increase the chance somebody building on the progress you have made.
from channelsurf.
is that code posted anywhere i am running into issues when i try and run it
from channelsurf.
@tamhinsf is there any new development into this direction going on, would be great, to fix this issue?
and make the result... way more "pretty"
from channelsurf.
We can import chats from slack to teams for more information you may want to take a look at this Slack to Teams migration guide.
https://www.cloudfuze.com/slack-to-teams-migration-guide-for-it-admins/
from channelsurf.
Related Issues (20)
- Unhandled Exception: System.AggregateException: HOT 7
- JSON -> HTML drops links for attached files
- Specified Framework Not Found - Once Installed, Unhandled Exception HOT 1
- Stuck at the place right after the authentication. HOT 9
- Object reference not set to an instance of an object - Issue with NullReferenceException HOT 4
- System.NotSupportedException: The given path's format is not supported HOT 6
- No messages are actually imported HOT 1
- Message order HOT 1
- Stuck after "You've Successfully signed in" HOT 6
- Does it copy files? HOT 3
- client assertion and client secret HOT 3
- Couldn't find a project Error HOT 2
- Private channels not migrated HOT 1
- Folder creation error
- Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
- Unable to login to Microsoft Teams
- (AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret') HOT 1
- MSB4018 The "ResolvePackageAssets" task failed unexpectedly. HOT 2
- Has anyone had any success with this tool recently or is it dead? HOT 3
- Given path's format is not supported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from channelsurf.