View Source Tumbloire (Tumbloire v0.1.0)

A thin wrapper around the Tumblr API v2.

You can find more information on in the Tumblr API v2 official documentation.

Authentication

Tumbloire offers two ways to authenticate:

  • by explicitly passing the API key to the endpoints
  • by using the application's configuration

Refer to each endpoint function and Tumblr documentation to know which endpoints can be accessed with an API key.

To configure the application:

import Config

config :tumbloire,
  consumer_key: "YOUR_CONSUMER_KEY",
  consumer_secret: "YOUR_CONSUMER_SECRET",
  access_token: "YOUR_ACCESS_TOKEN",
  refresh_token: "YOUR_REFRESH_TOKEN"

Req configuration

Tumbloire uses Req as its HTTP client, and can be configured in two ways:

  • by passing Req options to an endpoint function, via the :params argument
  • by using the application's configuration

To configure Req via the application's configuration:

import Config

config :tumbloire,
  req_options: [
    ...
  ]

Examples

Simple console OAuth 2.0 authorization flow

iex> scope = [:write, :offline_access]
iex> state =
...>   :crypto.strong_rand_bytes(32)
...>   |> Base.url_encode64()
...>   |> binary_part(0, 32)
iex> IO.write("Allow the application at the following URL: ")
iex> Tumbloire.Auth.authorization_url(scope, state) |> IO.puts()
iex> IO.write("Paste the callback URL: ")
iex> {:ok, {code, ^state}} =
...>   IO.read(:stdio, :line) |> String.trim() |> Tumbloire.Auth.parse_callback()
iex> {:ok, {access_token, refresh_token}} = Tumbloire.Auth.request_token(code)

Request with explicit API key and Req option retry

iex> Tumbloire.blog_info("someblog", api_key: "YOUR_API_KEY", retry: false)

Summary

Blog

Returns a blog's avatar.

Returns a blog's blocks.

Returns a blog's draft posts.

Returns if a blog is followed by another blog.

Returns a blog's followers.

Returns a blog's following.

Returns general information about a blog.

Returns a blog's liked posts.

Returns a blog's activity items, in reverse chronological order.

Returns a blog's published posts.

Returns a blog's queued posts.

Returns a blog's submission posts.

Creates or reblogs a post.

User

Adds one or more contents to filter.

Returns the user's filtered tags.

Returns the user's filtered content.

Returns the user's filtered tags.

Follows a blog.

Returns the user's dashboard.

Returns the user's liked posts.

Returns the user's account information.

Returns the user's liked posts.

Returns the user's various limits.

Tagged

Returns posts with a specific tag.

Communities

Cancels a pending community invitation for a blog.

Returns the list of joined communities.

Returns information about a community.

Returns a community invitation status for a blog.

Returns members of a community.

Returns a community pending invites.

Returns posts from a community.

Adds a reaction to a community post.

Returns an invitation link with a new hash, invalidating the previous one.

Blog

Link to this function

block_blog(blogname, params \\ [])

View Source
@spec block_blog(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Blocks a blog.

See /blocks - Block a Blog (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • blocked_tumblelog: the tumblelog to block
  • post_id: the anonymous post ID to block

Only one parameter is required at a time.

Link to this function

blog_avatar(blogname, params \\ [])

View Source
@spec blog_avatar(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a blog's avatar.

See /avatar - Retrieve Blog Avatar (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • size: the size of the avatar, must be one of 16, 24, 30, 40, 48, 64, 96, 128, 512 (default 64)
Link to this function

blog_blocks(blogname, params \\ [])

View Source
@spec blog_blocks(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a blog's blocks.

See /blocks - Retrieve Blog's Blocks (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • limit: number of blocks to retrieve, 1-20 (default 20)
  • offset: block number to start at (default 0)
Link to this function

blog_drafts(blogname, params \\ [])

View Source
@spec blog_drafts(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a blog's draft posts.

See /posts/draft — Retrieve Draft Posts (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • before_id: returns posts that have appeared before this ID (default 0)
  • filter: the post format to return other than HTML, one of "text", "raw"
Link to this function

blog_followed_by(blogname, other_blogname, params \\ [])

View Source
@spec blog_followed_by(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns if a blog is followed by another blog.

See /followed_by — Check If Followed By Blog (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • other_blogname: a blog identifier
  • params: a keyword list of Req options
Link to this function

blog_followers(blogname, params \\ [])

View Source
@spec blog_followers(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a blog's followers.

See /followers — Retrieve Blog's followers (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • limit: number of followers to retrieve, 1-20 (default 20)
  • offset: result number to start at (default 0)
Link to this function

blog_following(blogname, params \\ [])

View Source
@spec blog_following(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a blog's following.

See /following — Retrieve Blog's following (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • limit: number of results to retrieve, 1-20 (default 20)
  • offset: followed blog number to start at (default 0)
Link to this function

blog_info(blogname, params \\ [])

View Source
@spec blog_info(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns general information about a blog.

See /info - Retrieve Blog Info (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • api_key: the application OAuth Consumer Key
  • fields[blogs]: a list of fields for partial responses
Link to this function

blog_likes(blogname, params \\ [])

View Source
@spec blog_likes(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a blog's liked posts.

See /likes — Retrieve Blog's Likes (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • api_key: the application OAuth Consumer Key
  • limit: number of liked posts to retrieve, 1-20 (default 20)
  • offset: liked post number to start at (default 0)
  • before: retrieves posts liked before this timestamp
  • after: retrieves posts liked after this timestamp
Link to this function

blog_notifications(blogname, params \\ [])

View Source
@spec blog_notifications(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a blog's activity items, in reverse chronological order.

See /notifications — Retrieve Blog's Activity Feed (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • before: UNIX epoch timestamp that begins the page (defaults to request time)
  • types: a list of one or more types to filter by, one of "like", "reply", "follow", "mention_in_reply", "mention_in_post", "reblog_naked", "reblog_with_content", "ask", "answered_ask", "new_group_blog_member", "post_attribution", "post_flagged", "post_appeal_accepted", "post_appeal_rejected", "what_you_missed", "conversational_note"
  • rollups: whether to "roll up" similar activity items into single items
  • omit_post_ids: a list of your own post IDs to filter out
Link to this function

blog_posts(blogname, params \\ [])

View Source
@spec blog_posts(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a blog's published posts.

See /posts – Retrieve Published Posts (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • api_key: the application OAuth Consumer Key
  • type: the type of post to return, one of "text", "quote", "link", "answer", "video", "audio", "photo", "chat"
  • id: a specific post ID
  • tag: limits the response to posts with the specified tag(s), can be a string or a list of strings
  • limit: number of blocks to retrieve, 1-20 (default 20)
  • offset: block number to start at (default 0)
  • reblog_info: whether to return reblog information
  • notes_info: whether to return notes information
  • filter: the post format to return other than HTML, one of "text", "raw"
  • before: retrieves posts liked before this timestamp, in seconds
  • after: retrieves posts liked after this timestamp, in seconds
  • sort: sort order, one of "desc", "asc"
  • npf: whether to return posts' content in NPF format
Link to this function

blog_queue(blogname, params \\ [])

View Source
@spec blog_queue(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a blog's queued posts.

See /posts/queue — Retrieve Queued Posts (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • limit: number of blocks to retrieve, 1-20 (default 20)
  • offset: block number to start at (default 0)
  • filter: the post format to return other than HTML, one of "text", "raw"
Link to this function

blog_reorder_queue(blogname, post_id, params \\ [])

View Source
@spec blog_reorder_queue(String.t(), String.t() | integer(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Reorders a blog's queue.

See /posts/queue/reorder — Reorder Queued Posts (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • post_id: ID of the post to move
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • insert_after: which post ID to move it after (default 0, moves the post to the top)
Link to this function

blog_shuffle_queue(blogname, params \\ [])

View Source
@spec blog_shuffle_queue(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Shuffles a blog's queue.

See /posts/queue/shuffle - Shuffle Queued Posts (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of Req options
Link to this function

blog_submissions(blogname, params \\ [])

View Source
@spec blog_submissions(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a blog's submission posts.

See /posts/submission — Retrieve Submission Posts (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • offset: block number to start at (default 0)
  • filter: the post format to return other than HTML, one of "text", "raw"
Link to this function

bulk_block_blogs(blogname, blocked_blogs, params \\ [])

View Source
@spec bulk_block_blogs(String.t(), [String.t()], keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Blocks multiple blogs.

See /blocks/bulk - Block a list of Blogs (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • blocked_blogs: a list of tumblelogs to block
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • force: whether to force the block even if it requires canceling a Post+ Subscription
Link to this function

create_post(blogname, params \\ [])

View Source
@spec create_post(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Creates or reblogs a post.

See /posts - Create/Reblog a Post (Neue Post Format) (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • content: an array of NPF content blocks to be used to make the post; in a reblog, this is any content you want to add
  • layout: an array of NPF layout objects to be used to lay out the post content
  • state: the initial state of the new post, one of "published" or "queued" (default "published")
  • publish_on: a future date and time in ISO 8601 format to publish the post, only if state is "queued"
  • date: a past date and time in ISO 8601 format to backdate the post
  • tags: a list of tags to associate with the post
  • source_url: a source attribution for the post content
  • send_to_twitter: whether or not to share this via any connected Twitter account on post publish (defaults to the blog's global setting)
  • is_private: whether this should be a private answer, if this is an answer
  • slug: a custom URL slug to use in the post's permalink URL
  • interactability_reblog: who can interact with this when reblogging, one of 'everyone' or 'noone'
  • parent_tumblelog_uuid: the unique public identifier of the Tumblelog that's being reblogged from, required if reblogging a post
  • parent_post_id: the unique public post ID being reblogged, required if reblogging a post
  • reblog_key: the unique per-post hash validating that this is a genuine reblog action, required if reblogging a post
  • hide_trail: whether or not to hide the reblog trail with this new post (default false)
  • exclude_trail_items: instead of hide_trail, use this to specify a list of specific reblog trail item indexes to exclude from your reblog
Link to this function

delete_post(blogname, post_id, params \\ [])

View Source
@spec delete_post(String.t(), integer(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Deletes a blog's post.

See /post/delete – Delete a Post (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • post_id: ID of the post to delete
  • params: a keyword list of Req options
Link to this function

edit_post(blogname, post_id, params \\ [])

View Source
@spec edit_post(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Edits a blog's post.

See /posts/{post-id} - Editing a Post (Neue Post Format) (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • post_id: ID of the post to edit
  • params: a keyword list of Req options
Link to this function

mute_post(blogname, post_id, params \\ [])

View Source
@spec mute_post(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Mutes a blog's post.

See /posts/{post-id}/mute – Muting a Post's Notifications (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • post_id: ID of the post to mute
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • mute_length_seconds: how many seconds the mute should last (default 0, mutes the post forever)
Link to this function

post_notes(blogname, post_id, params \\ [])

View Source
@spec post_notes(String.t(), integer(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a post's notes.

See /notes - Get notes for a specific Post (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • post_id: ID of the post to fetch notes for
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • api_key: the application OAuth Consumer Key
  • before_timestamp: fetch notes created before this timestamp; this is a UNIX timestamp in seconds precision, but microseconds precision for "conversation" mode
  • mode: the response formatting mode, one of "all", "likes", "conversation", "rollup", "reblogs_with_tags"
Link to this function

remove_blog_block(blogname, params \\ [])

View Source
@spec remove_blog_block(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Remove a blog's block.

See /blocks – Remove a Block (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • blocked_tumblelog: the tumblelog whose block to remove
  • anonymous_only: clear all anonymous IP blocks

Only one parameter is required at a time.

Link to this function

unmute_post(blogname, post_id, params \\ [])

View Source
@spec unmute_post(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Unmutes a blog's post.

See /posts/{post-id}/mute – Muting a Post's Notifications (on Tumblr) for more information.

Parameters

  • blogname: a blog identifier
  • post_id: ID of the post to unmute
  • params: a keyword list of Req options

User

Link to this function

add_filtered_content(content, params \\ [])

View Source
@spec add_filtered_content(
  [String.t()],
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Adds one or more contents to filter.

See /user/filtered_content - Content Filtering (on Tumblr) for more information.

Parameters

  • content: the content(s) to add, can be a string or a list of strings
  • params: a keyword list of Req options
Link to this function

add_filtered_tags(tags, params \\ [])

View Source
@spec add_filtered_tags(
  [String.t()],
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns the user's filtered tags.

See /user/filtered_tags - Tag Filtering (on Tumblr) for more information.

Parameters

  • tags: the tag(s) to add, can be a string or a list of strings
  • params: a keyword list of Req options
Link to this function

filtered_content(params \\ [])

View Source
@spec filtered_content(keyword()) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns the user's filtered content.

See /user/filtered_content - Content Filtering (on Tumblr) for more information.

Parameters

  • params: a keyword list of Req options
Link to this function

filtered_tags(params \\ [])

View Source
@spec filtered_tags(keyword()) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns the user's filtered tags.

See /user/filtered_tags - Tag Filtering (on Tumblr) for more information.

Parameters

  • params: a keyword list of Req options
Link to this function

follow_blog(params \\ [])

View Source
@spec follow_blog(keyword()) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Follows a blog.

See /user/follow – Follow a blog (on Tumblr) for more information.

Parameters

  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • url: the blog to follow
  • email: the email of the blog to follow
Link to this function

like_post(post_id, reblog_key, params \\ [])

View Source
@spec like_post(integer(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Likes a post.

See /user/like – Like a Post (on Tumblr) for more information.

Parameters

  • params: a keyword list of Req options
  • post_id: the id of the post to like
  • reblog_key: the reblog key for the post ID
Link to this function

remove_filtered_content(content, params \\ [])

View Source
@spec remove_filtered_content(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Removes a content filter.

See /user/filtered_content - Content Filtering (on Tumblr) for more information.

Parameters

  • content: the content to remove
  • params: a keyword list of Req options
Link to this function

remove_filtered_tag(tag, params \\ [])

View Source
@spec remove_filtered_tag(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Removes a tag filter.

See /user/filtered_tags - Tag Filtering (on Tumblr) for more information.

Parameters

  • tag: the tag to remove
  • params: a keyword list of Req options
Link to this function

unfollow_blog(blogname, params \\ [])

View Source
@spec unfollow_blog(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Unfollows a blog.

See /user/unfollow – Unfollow a blog (on Tumblr) for more information.

Parameters

  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • url: the blog to follow
Link to this function

unlike_post(post_id, reblog_key, params \\ [])

View Source
@spec unlike_post(integer(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Unlikes a post.

See /user/unlike – Unlike a Post (on Tumblr) for more information.

Parameters

  • params: a keyword list of Req options
  • post_id: the id of the post to like
  • reblog_key: the reblog key for the post ID
Link to this function

user_dashboard(params \\ [])

View Source
@spec user_dashboard(keyword()) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns the user's dashboard.

See /user/dashboard – Retrieve a User's Dashboard (on Tumblr) for more information.

Parameters

  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • limit: number of results to retrieve, 1-20 (default 20)
  • offset: post number to start at (default 0)
  • type: the type of post to return, one of "text", "quote", "link", "answer", "video", "audio", "photo", "chat"
  • since_id: returns posts that have appeared after this post ID
  • reblog_info: whether to return reblog information
  • notes_info: whether to return notes information
  • npf: whether to return posts' content in NPF format
Link to this function

user_following(params \\ [])

View Source
@spec user_following(keyword()) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns the user's liked posts.

See /user/following – Retrieve the Blogs a User Is Following (on Tumblr) for more information.

Parameters

  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • limit: number of liked posts to retrieve, 1-20 (default 20)
  • offset: liked post number to start at (default 0)
@spec user_info(keyword()) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns the user's account information.

See /user/info – Get a User's Information (on Tumblr) for more information.

Parameters

  • params: a keyword list of Req options
Link to this function

user_likes(params \\ [])

View Source
@spec user_likes(keyword()) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns the user's liked posts.

See /user/likes — Retrieve a User's Likes (on Tumblr) for more information.

Parameters

  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • limit: number of liked posts to retrieve, 1-20 (default 20)
  • offset: liked post number to start at (default 0)
  • before: retrieves posts liked before this timestamp
  • after: retrieves posts liked after this timestamp
Link to this function

user_limits(params \\ [])

View Source
@spec user_limits(keyword()) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns the user's various limits.

See /user/limits – Get a User's Limits (on Tumblr) for more information.

Parameters

  • params: a keyword list of Req options

Tagged

Link to this function

tagged_posts(tag, params \\ [])

View Source
@spec tagged_posts(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns posts with a specific tag.

See /tagged – Get Posts with Tag (on Tumblr) for more information.

Parameters

  • tag: the tag
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • api_key: the application OAuth Consumer Key
  • limit: number of posts to retrieve, 1-20 (default 20)
  • before: retrieves posts before this timestamp
  • filter: the post format to return other than HTML, one of "text", "raw"

Communities

Link to this function

cancel_community_invitation(community, blogname, params \\ [])

View Source
@spec cancel_community_invitation(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Cancels a pending community invitation for a blog.

See DELETE /v2/communities/{community-handle}/invitations/{blog-identifier} - Cancel an invitation (on Tumblr) for more information.

Parameters

  • community: the community handle
  • blogname: the blog to cancel the invitation for
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • do_not_invite: whether to disallow any future re-invitations
Link to this function

change_member_role(community, blogname, role, params \\ [])

View Source
@spec change_member_role(String.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Changes a community member's role.

See PUT /v2/communities/{community-handle}/members/{blog-identifier} - Change a member's role (on Tumblr) for more information.

Parameters

  • community: the community handle
  • blogname: the blog to change
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • role: the member's new role, one of "member", "moderator", "admin"
Link to this function

communities(params \\ [])

View Source
@spec communities(keyword()) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns the list of joined communities.

See GET /v2/communities - List joined communities (on Tumblr) for more information.

Parameters

  • params: a keyword list of Req options
Link to this function

community_info(community, params \\ [])

View Source
@spec community_info(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns information about a community.

See GET /v2/communities/{community-handle} - Get info about a community (on Tumblr) for more information.

Parameters

  • community: the community handle
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • context: the context of what the info will be used for; at the moment, only "edit" is available
Link to this function

community_invitation_status(community, blogname, params \\ [])

View Source
@spec community_invitation_status(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a community invitation status for a blog.

See GET /v2/communities/{community-handle}/invitations/{blog-identifier} - Check invitation status (on Tumblr) for more information.

Parameters

  • community: the community handle
  • blogname: the blog to check
  • params: a keyword list of Req options
Link to this function

community_members(community, params \\ [])

View Source
@spec community_members(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns members of a community.

See GET /v2/communities/{community-handle}/members - Get community members (on Tumblr) for more information.

Parameters

  • community: the community handle
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • page: the page of results to fetch
  • filter: filters to a specific set of members, one of "all", "admin", "moderator", "following", "mutual"
Link to this function

community_pending_invites(community, params \\ [])

View Source
@spec community_pending_invites(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns a community pending invites.

See GET /v2/communities/{community-handle}/invitations - View pending invites (on Tumblr) for more information.

Parameters

  • community: the community handle
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • before: the timestamp to use for the next page boundary
Link to this function

community_timeline(community, params \\ [])

View Source
@spec community_timeline(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns posts from a community.

See GET /v2/communities/{community-handle}/timeline - Get posts from a community (on Tumblr) for more information.

Parameters

  • community: the community handle
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • type: the type of timeline to visit, one of "recent", "polls", "discover"
Link to this function

edit_community(community, params \\ [])

View Source
@spec edit_community(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Edits a community.

See PUT /v2/communities/{community-handle} - Edit your community (on Tumblr) for more information.

Parameters

  • community: the community handle
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • title: the title of the community
  • description: the description of the community
  • community_name: the handle/URL of the community
  • privacy: the privacy level of the community (0 for public, 1 for private)
  • tags: the list of tags ysed to describe the community
  • about: more information about the community
  • guidelines: a list of guidelines that members need to follow
  • invite_links_enabled: whether invite links are enabled for the community
  • join_type: the type of options for joining, one of "invite", "free"
Link to this function

invite_to_community(community, blogname, params \\ [])

View Source
@spec invite_to_community(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Invites a blog to a community.

See PUT /v2/communities/{community-handle}/invitations - Invite someone to the community (on Tumblr) for more information.

Parameters

  • community: the community handle
  • blogname: the blog to invite
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • message: a message to send with the invite, max length 100 characters
Link to this function

join_community(community, params \\ [])

View Source
@spec join_community(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Joins a community.

See PUT /v2/communities/{community-handle}/members - Join a community (on Tumblr) for more information.

Parameters

  • community: the community handle
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • invite_hash: the invite code/hash
Link to this function

leave_community(community, params \\ [])

View Source
@spec leave_community(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Leaves a community.

See DELETE /v2/communities/{community-handle}/members - Leave a community (on Tumblr) for more information.

Parameters

  • community: the community handle
  • params: a keyword list of Req options
Link to this function

mute_community(community, params \\ [])

View Source
@spec mute_community(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Mutes a community.

See PUT /v2/communities/{community-handle}/mute - Mute a community (on Tumblr) for more information.

Parameters

  • community: the community handle
  • params: a keyword list of Req options
Link to this function

react_community_post(community, post_id, params \\ [])

View Source
@spec react_community_post(String.t(), String.t() | integer(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Adds a reaction to a community post.

See PUT /v2/communities/{community-handle}/posts/{post-id}/reactions - Add reaction to post (on Tumblr) for more information.

Parameters

  • community: the community handle
  • post_id: the ID of the post to react to
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • slug: a specific slug to use, i.e. :thumbs_up:
  • grapheme: a unicode emoji to use, i.e. 👍
Link to this function

regenerate_community_invite(community, params \\ [])

View Source
@spec regenerate_community_invite(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Returns an invitation link with a new hash, invalidating the previous one.

See POST /v2/communities/{community-handle}/invite_hash - Regenerate the invite URL} - Cancel an invitation (on Tumblr) for more information.

Parameters

  • community: the community handle
  • params: a keyword list of Req options
Link to this function

remove_member(community, blogname, reason, params \\ [])

View Source
@spec remove_member(String.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Removes a member from a community.

See DELETE /v2/communities/{community-handle}/members/{blog-identifier} - Remove a member (on Tumblr) for more information.

Parameters

  • community: the community handle
  • blogname: the blog to remove
  • params: a keyword list of endpoint parameters or Req options

Endpoint parameters

  • reason: the reason for removing the member, one of "community_guidelines", "offtopic", "spam", "inappropriate_behavior", "tumblr_guidelines", "other"
  • note: why the member is being removed, max length 1,000 characters, required if reason is "other"
  • ban_user: whether to also ban the user permanently from rejoining
Link to this function

remove_reaction_community_post(community, post_id, reaction_id, params \\ [])

View Source
@spec remove_reaction_community_post(
  String.t(),
  String.t() | integer(),
  String.t(),
  keyword()
) ::
  {:ok, map()} | {:error, Tumbloire.Error.t()}

Removes a reaction from a community post.

See DELETE /v2/communities/{community-handle}/posts/{post-id}/reactions/{reaction-id} - Remove reaction from post (on Tumblr) for more information.

Parameters

  • community: the community handle
  • post_id: the ID of the post to react to
  • reaction_id: the ID or grapheme of the reaction to remove
  • params: a keyword list of Req options
Link to this function

unmute_community(community, params \\ [])

View Source
@spec unmute_community(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Tumbloire.Error.t()}

Unmutes a community.

See DELETE /v2/communities/{community-handle}/mute - Unmute a community (on Tumblr) for more information.

Parameters

  • community: the community handle
  • params: a keyword list of Req options