getFollowers(__fields_paginationToken_maxResults_) - daneden/Twift GitHub Wiki

getFollowers(_:fields:paginationToken:maxResults:)

Returns a list of users who are followers of the specified user ID.

public func getFollowers(_ userId: User.ID,
                           fields: RequestFields? = nil,
                           paginationToken: String? = nil,
                           maxResults: Int = 100
  )

Equivalent to GET /2/users/:id/followers.

Parameters

  • userId: The user ID whose followers you would like to retrieve
  • userFields: This fields parameter enables you to select which specific user fields will deliver with each returned user objects. These specified user fields will display directly in the returned user struct.
  • tweetFields: This fields parameter enables you to select which specific Tweet fields will deliver in each returned pinned Tweet. The Tweet fields will only return if the user has a pinned Tweet. While the referenced Tweet ID will be located in the original Tweet object, you will find this ID and all additional Tweet fields in the includes property on the returned TwitterAPIDataIncludesAndMeta struct.
  • paginationToken: When iterating over pages of results, you can pass in the nextToken from the previously-returned value to get the next page of results
  • maxResults: The maximum number of results to fetch.

Returns

A Twitter API response object containing an array of User structs and any pinned tweets in the includes property