Safe Haskell | None |
---|---|
Language | Haskell2010 |
Web.FBMessenger.API.Bot.Responses
Description
This module contains responses from Messenger Platform Bot API
- data MessageResponse = MessageResponse {}
- data SendErrorCode
- data SendErrorObject = SendErrorObject {
- eoMessage :: Text
- eoType :: Text
- eoCode :: SendErrorCode
- eoErrorData :: Text
- eoFbtraceId :: Text
- data SubscriptionResponse = SubscriptionResponse {}
- data UserProfileResponse = UserProfileResponse {}
- data WelcomeMessageResponse = WelcomeMessageResponse {
- wmr_result :: Text
- errorInfo :: SendErrorObject -> (SendErrorCode, Text)
- extractSendError :: ServantError -> Maybe SendErrorObject
Types
data MessageResponse Source #
This object contais the response after a message has been succesfully sent
Constructors
MessageResponse | |
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.
Instances
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 }
Constructors
SendErrorObject | |
Fields
|
data SubscriptionResponse Source #
This object represents the subscribed_apps
success response
Constructors
SubscriptionResponse | |
Fields |
data UserProfileResponse Source #
This objects contains the User Profile informations
Constructors
UserProfileResponse | |
Fields
|
data WelcomeMessageResponse Source #
This objects contains informations on the succesful setup of a welcome message
Constructors
WelcomeMessageResponse | |
Fields
|
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).