Method: Twitter::REST::Users#update_profile_image

Defined in:
lib/twitter/rest/users.rb

#update_profile_image(image, options = {}) ⇒ Twitter::User

Note:

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

Note:

This method asynchronously processes the uploaded file before updating the user's profile image URL. You can either update your local cache the next time you request the user's information, or, at least 5 seconds after uploading the image, ask for the updated URL using GET users/show.

Updates the authenticating user's profile image

Parameters:

  • image (File)

    The avatar image for the profile, base64-encoded. Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down. Animated GIFs will be converted to a static GIF of the first frame, removing the animation.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

Raises:

See Also:

Rate Limited?:

  • No

Authentication:

  • Requires user context



112
113
114
# File 'lib/twitter/rest/users.rb', line 112

def update_profile_image(image, options = {})
  post_profile_image("/1.1/account/update_profile_image.json", image, options)
end