Search code examples
c#sharefile

ShareFile API stops on third iteration


So I am running an API call that changes Access Controls for a specific group across many folders. There is no officially supported way for changing multiple folders so my program utilizes a ForEach to run through a large list of folder ids. The first one runs fine and moves to the next folder. The second one also runs and moves to the third. On the third call the API doesn't return anything, doesn't change the setting, and eventually times out.

First I thought there may be something wrong with the third folder id so I put it at the top of the list. Again, it stopped at the third id (previously the second id) so the problem can't be the id. Next, I thought I could be sending too many calls in a short time so I introduced a delay. Even with a 10 second delay between them it still stops at the third id and times out.

Has anyone else ever run into this problem? And if so, how did you get around it?


Solution

  • So I still don't know what was wrong, but I downloaded Fiddler to see what exactly was happening with the request. Apparently when I run it with Fiddler active it works perfectly. Too weird.