Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lazyvalue/167087f88ad38865646080bee9004601 to your computer and use it in GitHub Desktop.
Save lazyvalue/167087f88ad38865646080bee9004601 to your computer and use it in GitHub Desktop.
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