Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains functions to deal with the authentication process of Pocket. Read https://getpocket.com/developer/docs/authentication to have all the details of this process.
A user friendly method to interact with the authentication process is through the command:
stack exec follow_pocket_auth
Synopsis
- requestTokenStep :: (MonadThrow m, MonadHttp m) => m (Text, Text)
- accessTokenStep :: (MonadHttp m, MonadThrow m) => Text -> m Text
- jsonPostResponseBody :: (ToJSON b, MonadHttp m, MonadThrow m) => Url scheme -> b -> Option scheme -> m (HashMap Text Value)
- jsonHeaders :: Option scheme
- consumerKey :: Text
Documentation
requestTokenStep :: (MonadThrow m, MonadHttp m) => m (Text, Text) Source #
First auth step. Asks Pocket for a request token. It returns the token itself and the URL that the user must visit in order to grant access before proceeding to the second step.
accessTokenStep :: (MonadHttp m, MonadThrow m) => Text -> m Text Source #
Second auth step. Once a user has granted permission to Follow, it exchanges a request token for an access token. The access token is what it needs to be used in any other Pocket API call.
jsonPostResponseBody :: (ToJSON b, MonadHttp m, MonadThrow m) => Url scheme -> b -> Option scheme -> m (HashMap Text Value) Source #
Gets the JSON response body of a POST request.
jsonHeaders :: Option scheme Source #
Pocket expected headers for a JSON interaction.
consumerKey :: Text Source #
Consumer key for the Follow application in Pocket.