xing-api-0.1.3: Wrapper for the XING API, v1.

Safe HaskellNone

Web.XING

Contents

Synopsis

OAuth

consumerSource

Arguments

:: ByteString

consumer key

-> ByteString

consumer secret

-> OAuth 

Create an OAuth consumer

getRequestTokenSource

Arguments

:: (MonadResource m, MonadBaseControl IO m) 
=> OAuth

OAuth consumer

-> Manager 
-> m (RequestToken, URL)

request token and authorize URL

Create a request token (temporary credentials)

authorizeUrlSource

Arguments

:: OAuth

OAuth consumer

-> Credential

request token getRequestToken

-> ByteString

URL to send the user to

URL to obtain OAuth verifier

getAccessTokenSource

Arguments

:: (MonadResource m, MonadBaseControl IO m) 
=> RequestToken

request token obtained from getRequestToken

-> Verifier

verifier obtained by calling authorizeUrl

-> OAuth

OAuth consumer (see consumer)

-> Manager 
-> m (Credential, ByteString) 

Exchange request token for an access token (token credentials)

token :: Credential -> ByteStringSource

extract the token from the Credential

tokenSecret :: Credential -> ByteStringSource

extract the secret from the Credential

newCredential

Arguments

:: ByteString

value for oauth_token

-> ByteString

value for oauth_token_secret

-> Credential 

Convenient function to create Credential with OAuth Token and Token Secret.

(re)create an OAuth token (for example access token)

oauthCallback :: OAuth -> Maybe ByteString

Callback uri to redirect after authentication (default: Nothing)

extract the OAuth callback from a consumer

API request interface

apiRequestSource

Arguments

:: (MonadResource m, MonadBaseControl IO m) 
=> OAuth

OAuth consumer

-> Manager 
-> AccessToken 
-> Method

HTTP verb

-> ByteString

HTTP path

-> m (Response ByteString) 

Low level API request interface

data Manager

Keeps track of open connections for keep-alive. If possible, you should share a single Manager between multiple threads and requests.

data OAuth

Data type for OAuth client (consumer).

The constructor for this data type is not exposed. Instead, you should use the def method or newOAuth function to retrieve a default instance, and then use the records below to make modifications. This approach allows us to add configuration options without breaking backwards compatibility.

data Status

HTTP Status.

Only the statusCode is used for comparisons.

Please use mkStatus to create status codes from code and message, or the Enum instance or the status code constants (like ok200). There might be additional record members in the future.

Note that the Show instance is only for debugging.

XING data types

data Award Source

Constructors

Award Text Int (Maybe Text) 

newtype UserList Source

Constructors

UserList 

Fields

unUserList :: [FullUser]
 

data Gender Source

Constructors

Male 
Female 

Calls

Common used functions (re-exports)

liftIO :: MonadIO m => forall a. IO a -> m a

Lift a computation from the IO monad.

withManager :: (MonadIO m, MonadBaseControl IO m, MonadThrow m, MonadUnsafeIO m) => (Manager -> ResourceT m a) -> m a

Create a new manager, use it in the provided function, and then release it.

This function uses the default manager settings. For more control, use withManagerSettings.