Exspotify.Audiobooks (Exspotify v0.1.0)

View Source

Provides functions for interacting with the Audiobooks endpoints of the Spotify Web API. See: https://developer.spotify.com/documentation/web-api/reference/audiobooks

Summary

Functions

Check if one or more audiobooks are saved in the current user's library. Returns a list of booleans corresponding to the audiobook IDs. https://developer.spotify.com/documentation/web-api/reference/check-users-saved-audiobooks

Get Spotify catalog information for a single audiobook by its unique Spotify ID. https://developer.spotify.com/documentation/web-api/reference/get-audiobook

Get Spotify catalog information for several audiobooks based on their Spotify IDs. https://developer.spotify.com/documentation/web-api/reference/get-several-audiobooks

Get a list of the audiobooks saved in the current Spotify user's library (paginated). Returns a Paging struct containing saved audiobooks with added_at timestamps. https://developer.spotify.com/documentation/web-api/reference/get-users-saved-audiobooks

Functions

check_users_saved_audiobooks(audiobook_ids, token)

@spec check_users_saved_audiobooks([String.t()], String.t()) ::
  {:ok, [boolean()]} | {:error, Exspotify.Error.t()}

Check if one or more audiobooks are saved in the current user's library. Returns a list of booleans corresponding to the audiobook IDs. https://developer.spotify.com/documentation/web-api/reference/check-users-saved-audiobooks

get_audiobook(audiobook_id, token)

@spec get_audiobook(String.t(), String.t()) ::
  {:ok, Exspotify.Structs.Audiobook.t()} | {:error, Exspotify.Error.t()}

Get Spotify catalog information for a single audiobook by its unique Spotify ID. https://developer.spotify.com/documentation/web-api/reference/get-audiobook

get_audiobook_chapters(audiobook_id, token, opts \\ [])

@spec get_audiobook_chapters(String.t(), String.t(), keyword()) ::
  {:ok, Exspotify.Structs.Paging.t()} | {:error, Exspotify.Error.t()}

Get Spotify catalog information about an audiobook's chapters (paginated). https://developer.spotify.com/documentation/web-api/reference/get-audiobook-chapters

get_several_audiobooks(audiobook_ids, token)

@spec get_several_audiobooks([String.t()], String.t()) ::
  {:ok, [Exspotify.Structs.Audiobook.t()]} | {:error, Exspotify.Error.t()}

Get Spotify catalog information for several audiobooks based on their Spotify IDs. https://developer.spotify.com/documentation/web-api/reference/get-several-audiobooks

get_users_saved_audiobooks(token, opts \\ [])

@spec get_users_saved_audiobooks(
  String.t(),
  keyword()
) :: {:ok, Exspotify.Structs.Paging.t()} | {:error, Exspotify.Error.t()}

Get a list of the audiobooks saved in the current Spotify user's library (paginated). Returns a Paging struct containing saved audiobooks with added_at timestamps. https://developer.spotify.com/documentation/web-api/reference/get-users-saved-audiobooks

remove_users_saved_audiobooks(audiobook_ids, token)

@spec remove_users_saved_audiobooks([String.t()], String.t()) ::
  {:ok, any()} | {:error, Exspotify.Error.t()}

Remove one or more audiobooks from the current user's library. https://developer.spotify.com/documentation/web-api/reference/remove-audiobooks-user

save_audiobooks_for_current_user(audiobook_ids, token)

@spec save_audiobooks_for_current_user([String.t()], String.t()) ::
  {:ok, any()} | {:error, Exspotify.Error.t()}

Save one or more audiobooks to the current user's library. https://developer.spotify.com/documentation/web-api/reference/save-audiobooks-user