Account

class Account(val client: ApiClient) : Endpoint

Collection of api endpoints related to account information for the authenticating user.

See also

Parameters

client

Current ApiClient instance.

Constructors

Link copied to clipboard
fun Account(client: ApiClient)

Creates new Account endpoint instance.

Properties

Link copied to clipboard
open override val client: ApiClient

Extensions

Link copied to clipboard
val Account.removeProfileBanner: EmptyApiAction

Shorthand property to Account.removeProfileBanner.

fun Account.removeProfileBanner(vararg options: Option): EmptyApiAction

Removes the uploaded profile banner for the authenticating user. Returns HTTP 200 upon success.

Link copied to clipboard
val Account.settings: JsonObjectApiAction<Account.Settings>

Shorthand extension property to Account.settings.

fun Account.settings(vararg options: Option): JsonObjectApiAction<Account.Settings>

Returns settings (including current trend, geo and sleep time information) for the authenticating user.

Link copied to clipboard
val Account.updateProfile: JsonObjectApiAction<User>

Shorthand extension property to Account.updateProfile.

fun Account.updateProfile(    name: String? = null,     url: String? = null,     location: String? = null,     description: String? = null,     profileLinkColor: String? = null,     includeEntities: Boolean? = null,     skipStatus: Boolean? = null,     birthdateYear: Int? = null,     birthdateMonth: Int? = null,     birthdateDay: Int? = null,     vararg options: Option): JsonObjectApiAction<User>

Sets some values that users are able to set under the "Account" tab of their settings page. Only the parameters specified will be updated.

Link copied to clipboard
fun Account.updateProfileBackgroundImage(    media: MediaComponent,     tile: Boolean? = null,     includeEntities: Boolean? = null,     skipStatus: Boolean? = null,     vararg options: Option): ApiAction<JsonObjectApiAction<User>>

Update profile background image.

fun Account.updateProfileBackgroundImage(    mediaId: Long,     tile: Boolean? = null,     includeEntities: Boolean? = null,     skipStatus: Boolean? = null,     vararg options: Option): JsonObjectApiAction<User>

Updates the authenticating user's profile background image. This method can also be used to enable or disable the profile background image. Although each parameter is marked as optional, at least one of image or media_id must be provided when making this request. Learn more about the deprecation of this endpoint via our forum post.

Link copied to clipboard
fun Account.updateProfileBanner(    file: ByteArray,     mediaType: MediaType,     width: Int? = null,     height: Int? = null,     offsetLeft: Int? = null,     offsetTop: Int? = null,     vararg options: Option): EmptyApiAction

Uploads a profile banner on behalf of the authenticating user. More information about sizing variations can be found in User Profile Images and Banners and GET users/profile_banner.

Link copied to clipboard
fun Account.updateProfileImage(    file: ByteArray,     mediaType: MediaType,     includeEntities: Boolean? = null,     skipStatus: Boolean? = null,     vararg options: Option): JsonObjectApiAction<User>

Updates the authenticating user's profile image. Note that this method expects raw multipart data, not a URL to an image.

Link copied to clipboard

Shorthand extension property to Account.updateSettings.

fun Account.updateSettings(    sleepTimeEnabled: Boolean? = null,     startSleepTime: Int? = null,     endSleepTime: Int? = null,     timeZone: String? = null,     trendLocationWoeid: Int? = null,     lang: String? = null,     vararg options: Option): JsonObjectApiAction<Account.Settings>

Updates the authenticating user's settings.

Link copied to clipboard

Shorthand property to Account.verifyCredentials.

fun Account.verifyCredentials(    includeEntities: Boolean? = null,     skipStatus: Boolean? = null,     includeEmail: Boolean? = null,     vararg options: Option): JsonObjectApiAction<Account.VerifyCredentials>

Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not. Use this method to test if supplied user credentials are valid.