getUser(__fields_expansions_tweetFields_) - daneden/Twift GitHub Wiki

getUser(_:fields:expansions:tweetFields:)

Returns a variety of information about a single user specified by the requested ID.

public func getUser(_ userId: User.ID,
                      fields: RequestFields? = nil,
                      expansions: [User.Expansions] = [.pinned_tweet_id],
                      tweetFields: [Tweet.Fields] = []
  )

Equivalent to GET /2/users/:id.

Parameters

  • userId: The ID of the user to lookup.
  • fields: Any additional fields to include on returned objects
  • expansions: Objects that should be expanded in the includes property

Returns

A Twitter API response object containing the User and any pinned tweets