Friendships

class Friendships(val client: ApiClient) : Endpoint

Collection of api endpoints related to friendships.

See also

Parameters

client

Current ApiClient instance.

Constructors

Link copied to clipboard
fun Friendships(client: ApiClient)

Creates new Friendships endpoint instance.

Properties

Link copied to clipboard
open override val client: ApiClient

Extensions

Link copied to clipboard
fun Friendships.createByScreenName(    screenName: String,     follow: Boolean? = null,     vararg options: Option): JsonObjectApiAction<User>

Allows the authenticating user to follow (friend) the user specified in the ID parameter. Returns the followed user when successful. Returns a string describing the failure condition when unsuccessful. If the user is already friends with the user a HTTP 403 may be returned, though for performance reasons this method may also return a HTTP 200 OK message even if the follow relationship already exists. Actions taken in this method are asynchronous. Changes will be eventually consistent.

Link copied to clipboard
fun Friendships.createByUserId(    userId: Long,     follow: Boolean? = null,     vararg options: Option): JsonObjectApiAction<User>

Allows the authenticating user to follow (friend) the user specified in the ID parameter. Returns the followed user when successful. Returns a string describing the failure condition when unsuccessful. If the user is already friends with the user a HTTP 403 may be returned, though for performance reasons this method may also return a HTTP 200 OK message even if the follow relationship already exists. Actions taken in this method are asynchronous. Changes will be eventually consistent.

Link copied to clipboard
fun Friendships.destroyByScreenName(screenName: String, vararg options: Option): JsonObjectApiAction<User>

Allows the authenticating user to unfollow the user specified in the ID parameter. Returns the unfollowed user when successful. Returns a string describing the failure condition when unsuccessful. Actions taken in this method are asynchronous. Changes will be eventually consistent.

Link copied to clipboard
fun Friendships.destroyByUserId(userId: Long, vararg options: Option): JsonObjectApiAction<User>

Allows the authenticating user to unfollow the user specified in the ID parameter. Returns the unfollowed user when successful. Returns a string describing the failure condition when unsuccessful. Actions taken in this method are asynchronous. Changes will be eventually consistent.

Link copied to clipboard
fun Friendships.lookupByScreenNames(screenNames: List<String>, vararg options: Option): JsonArrayApiAction<Friendships.Lookup>

Returns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided. Values for connections can be: following, following_requested, followed_by, none, blocking, muting.

Link copied to clipboard
fun Friendships.lookupByUserIds(userIds: List<Long>, vararg options: Option): JsonArrayApiAction<Friendships.Lookup>

Returns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided. Values for connections can be: following, following_requested, followed_by, none, blocking, muting.

Link copied to clipboard
val Friendships.noRetweetsIds: ApiAction<List<Long>>

Shorthand property to Friendships.noRetweetsIds.

fun Friendships.noRetweetsIds(stringifyIds: Boolean? = null, vararg options: Option): ApiAction<List<Long>>

Returns a collection of user_ids that the currently authenticated user does not want to receive retweets from. Use POST friendships/update to set the "no retweets" status for a given user account on behalf of the current user.

Link copied to clipboard
fun Friendships.showByScreenName(    sourceScreenName: String,     targetScreenName: String,     vararg options: Option): JsonObjectApiAction<Friendships.Show>
fun Friendships.showByScreenName(targetScreenName: String, vararg options: Option): JsonObjectApiAction<Friendships.Show>

Returns detailed information about the relationship between two arbitrary users.

Link copied to clipboard
fun Friendships.showByUserId(    sourceId: Long,     targetId: Long,     vararg options: Option): JsonObjectApiAction<Friendships.Show>
fun Friendships.showByUserId(targetId: Long, vararg options: Option): JsonObjectApiAction<Friendships.Show>

Returns detailed information about the relationship between two arbitrary users.

Link copied to clipboard
fun Friendships.updateByScreenName(    screenName: String,     device: Boolean? = null,     retweets: Boolean? = null,     vararg options: Option): JsonObjectApiAction<Relationship>

Enable or disable Retweets and device notifications from the specified user.

Link copied to clipboard
fun Friendships.updateByUserId(    userId: Long,     device: Boolean? = null,     retweets: Boolean? = null,     vararg options: Option): JsonObjectApiAction<Relationship>

Enable or disable Retweets and device notifications from the specified user.