0

I'm learning InstaSharper, but I can't understand how to Follow/Unfollow user. Because UnFollowUserAsync requires UserId. Can you tell me please how to get User's ID, or maybe there are other ways to follow/unfollow users.

Thanks in advance

Utkarsh Dubey
  • 703
  • 11
  • 31
vanya
  • 21
  • 2
  • 1
    Possible duplicate of [Instagram how to get my user id from username?](https://stackoverflow.com/questions/11796349/instagram-how-to-get-my-user-id-from-username) – skolldev Jul 10 '19 at 11:47

1 Answers1

1

Pk returns user Id in InstaSharp.

       IResult<InstaUserInfo> a = await 
api.GetUserInfoByUsernameAsync(/*username*/"asfasv");
        var id = a.Value.Pk;

Other Example:

var nextUri = UriCreator.GetUserFollowingUri(user.Value.Pk, _user.RankToken, searchQuery,
                            userListResponse.Value.NextMaxId); 

For more details: UserProcessor

Utkarsh Dubey
  • 703
  • 11
  • 31
vanya
  • 21
  • 2