fbmessenger-api-0.1.0.1: High-level bindings to Facebook Messenger Platform API

Safe HaskellNone
LanguageHaskell2010

Web.FBMessenger.API.Bot.Responses

Contents

Description

This module contains responses from Messenger Platform Bot API

Synopsis

Types

data MessageResponse Source #

This object contais the response after a message has been succesfully sent

data SendErrorCode Source #

Send API Error Codes (see: https://developers.facebook.com/docs/messenger-platform/send-api-reference#errors)

Code Description 2 Send message failure. Internal server error. 10 Application does not have permission to use the Send API 100 No matching user found 613 Calls to this api have exceeded the rate limit.

data SendErrorObject Source #

Send API Error response object (see: https://developers.facebook.com/docs/messenger-platform/send-api-reference#errors)

{ "error":{ "message":"Invalid parameter", "type":FacebookApiException, "code":100, "error_data":"No matching user found.", "fbtrace_id":D2kxCybrKVw }

Instances

data UserProfileResponse Source #

This objects contains the User Profile informations

Instances

Eq UserProfileResponse Source # 
Show UserProfileResponse Source # 
Generic UserProfileResponse Source # 
ToJSON UserProfileResponse Source # 
FromJSON UserProfileResponse Source # 
type Rep UserProfileResponse Source # 
type Rep UserProfileResponse = D1 (MetaData "UserProfileResponse" "Web.FBMessenger.API.Bot.Responses" "fbmessenger-api-0.1.0.1-KiBYdpfyJ4MK1Fa6nGNanN" False) (C1 (MetaCons "UserProfileResponse" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "usr_first_name") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) ((:*:) (S1 (MetaSel (Just Symbol "usr_last_name") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) (S1 (MetaSel (Just Symbol "usr_profile_pic") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))) ((:*:) (S1 (MetaSel (Just Symbol "usr_locale") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) ((:*:) (S1 (MetaSel (Just Symbol "usr_timezone") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) (S1 (MetaSel (Just Symbol "usr_gender") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))))))

Functions

errorInfo :: SendErrorObject -> (SendErrorCode, Text) Source #

Take a Send API error object and return a tuple containing the error code and the error_data (seems to always be the description)

extractSendError :: ServantError -> Maybe SendErrorObject Source #

Extracts a Send API Error object from the ServantError (when possible).