billstclair/elm-mastodon/2.0.0

NOTE: the latest version is 24.0.0

Mastodon

Talk to the Mastodon API.

This module contains re-exposed versions of the most-used parts of Mastodon.Entity and Mastodon.Request.

To authorize access, you need to call the functions in Mastodon.Login.

For API documentation, see https://docs.joinmastodon.org/api/guidelines/

Types

type alias ServerInfo =
{ server : String
, token : Maybe String
}

Used to create the HTTP URL and fill in its authentication token.

It's the host name for the URL.

Example server: "mastodon.social"

A few requests do not require a token. Most do, and will error if you don't include one.

Copy of Mastodon.Request.ServerInfo.

type alias Request =

A request for the REST API.

An alias of Mastodon.Request.Request. See that module's documentation for details.

type alias Response =
Response

A response from the REST API.

An alias of Mastodon.Request.Response. See that module's documentation for details.

type alias Error =

An error from the REST API.

Same as Http.Error, but includes Http.Metadata when it's available.

An alias of Mastodon.Request.Error. See that module's documentation for details.

Creating an HTTP REST request.

(id -> Result Error Response -> msg)
-> List Header
-> ServerInfo
-> id
-> Request
-> Cmd msg

Create a request for the REST API.

The id is whatever will help you to identify the response, if the Request and the Response don't suffice.

This is a copy of Mastodon.Request.serverRequest.

There is a low-level interface for requests in Mastodon.Request.