I am trying to add members in a list using Linq To Twitter API. According to the documentation I can add 100 members per request and can add upto 5000 members. https://dev.twitter.com/docs/api/1.1/post/lists/members/create_all
With that, I wrote a little function
public static async Task<List> AddMembersToList(ulong twitterUserId, ulong listId, List<ulong> followerIds, SingleUserAuthorizer auth)
{
var twitterContext = new TwitterContext(auth);
try
{
int count = 0;
while (followerIds.Count > count)
{
await twitterContext.AddMemberRangeToListAsync(listId, null, twitterUserId, null, followerIds.Skip(count).Take(100).ToList());
count += 100;
}
return new List();
}
catch (Exception ex)
{
return null;
}
}
The above should suppose to work but I am getting two different errors.. Sometime, I am getting an error message
Over Capacity
And sometime, it throws an error
ex = {"<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n <meta http-equiv=\"Content-Language\" content=\"en-us\">\n <meta name...
I am not able to figure out the reason..I need your suggestion