hunter v0.3.0 Hunter.Api behaviour
Hunter API contract
Summary
Callbacks
Retrieve account
Block a user
Retrieve user’s blocks
Retrieve a card associated with a status
Deletes all notifications from the Mastodon server for the authenticated user
Register a new OAuth client app on the target instance
Create new status
Destroy status
Favorite a status
Fetch a user’s favourites
Follow a user
Follow a remote user
Retrieve a list of follow requests
Get a list of followers
Get a list of followed accounts
Retrieve statuses from a hashtag
Retrieve statuses from the home timeline
Retrieve instance information
Mute a user
Retrieve user’s mutes
Retrieve single notification
Retrieve user’s notifications
Retrieve statuses from the public timeline
Reblog a status
Get the relationships of authenticated user towards given other users
Report a user
Retrieve a user’s reports
Search for content
Search for accounts
Retrieve status
Retrieve status context
Get a list of statuses by a user
Unblock a user
Undo a favorite of a status
Unfollow a user
Unmute a user
Undo a reblog of a status
Upload a media file
Retrieve account of authenticated user
Callbacks
card_by_status(conn :: Hunter.Client.t, id :: non_neg_integer) :: Hunter.Card.t
Retrieve a card associated with a status
Parameters
conn
- connection credentialsid
- status id
Deletes all notifications from the Mastodon server for the authenticated user
Parameters
conn
- connection credentials
create_app(conn :: Hunter.Client.t, name :: String.t, redirect_uri :: URI.t, scopes :: String.t, website :: String.t) :: Hunter.Application.t
Register a new OAuth client app on the target instance
Parameters
conn
- connection credentialsname
- name of your applicationredirect_uri
- where the user should be redirected after authorization, for no redirect, useurn:ietf:wg:oauth:2.0:oob
scopes
- scope list, see the scope section for more detailswebsite
- URL to the homepage of your app
Scopes
read
- read datawrite
- post statuses and upload media for statusesfollow
- follow, unfollow, block, unblock
Multiple scopes can be requested during the authorization phase with the scope
query param
create_status(conn :: Hunter.Client.t, text :: String.t, in_reply_to_id :: non_neg_integer, media_ids :: [non_neg_integer]) :: Hunter.Status.t
Create new status
Parameters
conn
- connection credentialstext
- [String]in_reply_to_id
- [Integer]media_ids
- [Array]
follow_by_uri(conn :: Hunter.Client.t, id :: non_neg_integer) :: Hunter.Account.t
Follow a remote user
Parameters
conn
- connection credentialsuri
- URI of the remote user, in the format ofusername@domain
hashtag_timeline(conn :: Hunter.Client.t, hashtag :: [String.t], options :: Keyword.t) :: [Hunter.Status]
Retrieve statuses from a hashtag
Parameters
conn
- connection credentialshashtag
- list of strings
Options
max_id
- [Integer]since_id
- [Integer]limit
- [Integer]
home_timeline(conn :: Hunter.Client.t, options :: Keyword.t) :: [Hunter.Status.t]
Retrieve statuses from the home timeline
Parameters
conn
- connection credentialsoptions
- option list
Options
max_id
- [Integer]since_id
- [Integer]limit
- [Integer]
notification(conn :: Hunter.Client.t, non_neg_integer) :: Hunter.Notification.t
Retrieve single notification
Parameters
conn
- connection credentialsid
- notification identifier
public_timeline(conn :: Hunter.Client.t, options :: Keyword.t) :: [Hunter.Status.t]
Retrieve statuses from the public timeline
Parameters
conn
- connection credentialsoptions
- option list
Options
max_id
- [Integer]since_id
- [Integer]limit
- [Integer]
relationships(conn :: Hunter.Client.t, ids :: [non_neg_integer]) :: [Hunter.Relationship.t]
Get the relationships of authenticated user towards given other users
Parameters
conn
- connection credentialsid
- list of relationship IDs
report(conn :: Hunter.Client.t, account_id :: non_neg_integer, status_ids :: [non_neg_integer], comment :: String.t) :: Hunter.Report.t
Report a user
Parameters
conn
- connection credentialsaccount_id
- the ID of the account to reportstatus_ids
- the IDs of statuses to reportcomment
- a comment to associate with the report
search(conn :: Hunter.Client.t, query :: String.t, options :: Keyword.t) :: Hunter.Result.t
Search for content
Parameters
conn
- connection credentialsq
- the search queryoptions
- option list
Options
resolve
- whether to resolve non-local accounts
search_account(conn :: Hunter.Client.t, options :: Keyword.t) :: [Hunter.Account.t]
Search for accounts
Parameters
conn
- connection credentialsoptions
- option list
Options
q
: what to search forlimit
: maximum number of matching accounts to return, default: 40
status_context(conn :: Hunter.Client.t, id :: non_neg_integer) :: Hunter.Context.t
Retrieve status context
Parameters
conn
- connection credentialsid
- status identifier
statuses(conn :: Hunter.Client.t, account_id :: non_neg_integer, options :: Keyword.t) :: [Hunter.Status.t]
Get a list of statuses by a user
Parameters
conn
- connection credentialsaccount_id
- account identifieroptions
- option list
Options
max_id
- [Integer]since_id
- [Integer]limit
- [Integer]
Unblock a user
conn
- connection credentialsid
- user identifier
unfavourite(conn :: Hunter.Client.t, id :: non_neg_integer) :: Hunter.Status.t
Undo a favorite of a status
Parameters
conn
- connection credentialsid
- status identifier
unfollow(conn :: Hunter.Client.t, id :: non_neg_integer) :: Hunter.Relationship.t
Unfollow a user
Parameters
conn
- connection credentialsid
- user identifier
upload_media(conn :: Hunter.Client.t, file :: Path.t) :: Hunter.Attachment.t
Upload a media file
Parameters
conn
- connection credentialsfile
- media to be uploaded