Created
May 27, 2017 20:52
-
-
Save lazyvalue/167087f88ad38865646080bee9004601 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form for PortalCrane: | |
capabilities <- [ | |
form for Capability: | |
type <- "OUTBOUND_MESSAGING" | |
remoteInterface <- form for RestRemoteInterface: | |
httpMethod <- "POST" | |
urlTemplate <- "https://graph.facebook.com/v2.6/me/messages?access_token={{credentials.pageAccessToken}}" | |
headers <- [ httpHeader "Content-Type" "application/json", httpHeader "X-Twilio" "true" ] | |
requestProductions <- [ | |
maybe | |
sometimes regex to "^\\+[0-9]+" then prod to $.recipient.phone_number | |
otherwise prod to $.recipient.id, | |
prod body $.message.text | |
] | |
] | |
authentication <- form for Authentication: | |
credentialType <- "LONG_LIVED" | |
mechanism <- [ | |
credential "pageAccessToken" "displayName" | |
] | |
inboundInterface <- form for Inbound: | |
eventHandlers <- [ | |
form for EventHandler: | |
eventType <- "INBOUND_MESSAGING" | |
path <- $.entry[].messaging | |
senderId <- $.sender.id | |
destinationId <- $.recipient.id | |
messageId <- $.message.mid | |
text <- $.message.text | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment