createFollow abstract method
Allows a user ID to follow another user.
If the target user does not have public Tweets, this endpoint will send a follow request.
The request succeeds with no action when the authenticated user sends a request to a user they're already following, or if they're sending a follower request to a user that does not have public Tweets.
Parameters
-
userId
: The authenticated user ID who you would like to initiate the follow on behalf of. You must pass the Access Tokens that relate to this user when authenticating the request. -
targetUserId
: The user ID of the user that you would like the id to follow.
Endpoint Url
Authentication Methods
- OAuth 2.0 Authorization Code with PKCE
- OAuth 1.0a
Required Scopes
- tweet.read
- users.read
- follows.write
Rate Limits
- User rate limit (OAuth 2.0 user Access Token): 50 requests per 15-minute window per each authenticated user
Reference
Implementation
Future<TwitterResponse<FollowStateData, void>> createFollow(
{required String userId, required String targetUserId});