{ "info": { "author": "Paul van Gool", "author_email": "pvangool@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# rcs_chatbot\n\nA Python SDK for [RCS MaaP chatbots](https://www.gsma.com/futurenetworks/wp-content/uploads/2017/11/FNW.11_v1.0.pdf).\n\n## Installation\n\n```bash\npip install rcs_chatbot\n```\n\n## Example\n\nSee more examples in [the example folder](https://github.com/pvangool/py-rcs-chatbot/tree/master/example).\n\n```python\nimport flask\nimport logging\nimport rcs_chatbot\n\nchatbot = rcs_chatbot.Chatbot(\n \"API_URL\",\n \"BOT_ID\",\n \"TOKEN\",\n None,\n logging.DEBUG\n)\n\napp = flask.Flask(__name__)\n\n@app.route('/', methods=['POST'])\ndef event():\n try:\n chatbot.processEvent(flask.request.get_json())\n return \"ok\", 200\n except maap.RequestFailed as ex:\n print(\"Request failed: \" + str(ex))\n return \"ok\", 200\n\n@chatbot.registerEventHandler(rcs_chatbot.EventType.MESSAGE)\ndef messageHandler(event):\n userContact = None\n chatId = None\n\n if \"userContact\" in event[\"messageContact\"]:\n userContact = event[\"messageContact\"][\"userContact\"]\n if \"chatId\" in event[\"messageContact\"]:\n chatId = event[\"messageContact\"][\"chatId\"]\n\n contact = rcs_chatbot.MessageContact(userContact, chatId)\n\n suggestions = rcs_chatbot.Suggestions()\n suggestions.addReply(\"reply\", \"reply\")\n suggestions.addUrlAction(\"url\", \"url\", \"http://example.com\")\n\n chatbot.sendMessage(\n contact,\n \"You wrote: \" + event[\"RCSMessage\"][\"textMessage\"],\n suggestions\n )\n\n@chatbot.registerEventHandler(rcs_chatbot.EventType.ISTYPING)\ndef isTypingHandler(event):\n print(\"isTypingHandler\")\n\n@chatbot.registerEventHandler(rcs_chatbot.EventType.MESSAGESTATUS)\ndef messageStatusHandler(event):\n print(\"messageStatusHandler\")\n\n@chatbot.registerEventHandler(rcs_chatbot.EventType.FILESTATUS)\ndef fileStatusHandler(event):\n print(\"fileStatusHandler\")\n\n@chatbot.registerEventHandler(rcs_chatbot.EventType.RESPONSE)\ndef responseHandler(event):\n print(\"responseHandler\")\n\n@chatbot.registerEventHandler(rcs_chatbot.EventType.ALIAS)\ndef aliasHandler(event):\n print(\"aliasHandler\")\n\n@chatbot.registerEventHandler(rcs_chatbot.EventType.NEWUSER)\ndef newUserHandler(event):\n print(\"newUserHandler\")\n\nif __name__ == '__main__':\n app.run(port=5000, debug=False)\n```\n\nInstead of a simple message, you can also use `sendMessage` to send an `AudioMessage`, etc. Show below is\nhow to send a `RichcardCarousel` message.\n\n```python\n@chatbot.registerEventHandler(maap.EventType.MESSAGE)\ndef messageHandler(event):\n userContact = None\n chatId = None\n\n if \"userContact\" in event[\"messageContact\"]:\n userContact = event[\"messageContact\"][\"userContact\"]\n if \"chatId\" in event[\"messageContact\"]:\n chatId = event[\"messageContact\"][\"chatId\"]\n\n contact = maap.MessageContact(userContact, chatId)\n\n card1 = maap.Richcard()\n card1.setTitle(\"title\")\n\n card2 = maap.Richcard()\n card2.setTitle(\"title\")\n\n carousel = maap.RichcardCarousel()\n carousel.addRichcard(card1)\n carousel.addRichcard(card2)\n\n chatbot.sendMessage(\n contact,\n carousel\n )\n```\n\n## Usage\n\n### Chatbot Functions\n\n#### constructor\n\n#### sendMessage(recipient, content, suggestions = None)\n\nSends a message with `content` and optional `suggestions` to the target `recipient`.\n\n* `recipient` - Object: A `MessageContact` object.\n* `content` - Object: The message payload. Either a string, an `AudioMessage` object, a `FileMessage` object, a `GeolocationPushMessage` object, a `Richcard` object, or a `RichcardCarousel` object.\n* `suggestions` - (Optional) Object: A `Suggestions` object.\n\n#### getMessageStatus(messageId)\n\nGets the status of a message with `messageId`.\n\n* `messageId` - String: The message identifier.\n\n#### updateMessageStatus(messageId, status)\n\nUpdates the status of a message with `messageId` to `status`.\n\n* `messageId` - String: The message identifier.\n* `status` - String: The requested status. Needs to be either `rcs_chatbot.MessageStatus.CANCELLED` or `rcs_chatbot.MessageStatus.DISPLAYED`.\n\n#### getContactCapabilities(userContact, chatId)\n\nGets the capabilities for a subscriber. Either `userContact` or `chatId` needs to be specified.\n\n* `userContact` - String: The subscriber's MSISDN.\n* `chatId` - String: The user's anonymous token.\n\n#### uploadFile(path, url, fileType, until)\n\nUploads a file of type `fileType` to the MaaP content storage until it expires at date `until`Either `path` or `url` needs to be specified.\n\n* `path` - String: The path to the file.\n* `url` - String: The URL to the file.\n* `fileType` - String: The file's content type.\n* `until` - Date: The date at which time the content should be expired.\n\n#### deleteFile(fileId)\n\nDeletes a file with identifier `fileId` from the MaaP content storage.\n\n* `fileId` - String: The file identifier.\n\n#### getFile(fileId)\n\nGets info for a file with identifier `fileId` from the MaaP content storage.\n\n* `fileId` - String: The file identifier.\n\n#### startTyping(recipient)\n\nStarts the 'is typing' indicator for the target `recipient`.\n\n* `recipient` - Object: A `MessageContact` object.\n\n#### stopTyping(recipient)\n\nStops the 'is typing' indicator for the target `recipient`.\n\n* `recipient` - Object: A `MessageContact` object.\n\n#### processEvent(json)\n\nThe main middleware for your bot's webhook. It parses the message payload, and fire the appropriate event.\n\n### FileMessage Functions\n\nAn `FileMessage` object representes a file and has the following properties:\n\n| Property | Type | Mandatory | Description |\n| --- | --- | --- | --- |\n| `fileUrl` | String | Yes | The URL of the file. |\n| `fileName` | String | No | The file name. |\n| `fileMIMEType` | String | No | The MIME type of the file. |\n| `fileSize` | Number | No | The size of the file. |\n| `thumbnailUrl` | String | No | The URL of the thumbnail. |\n| `thumbnailFileName` | String | No | The file name of the thumbnail. |\n| `thumbnailMIMEType` | String | No | The MIME type of the thumbnail. |\n| `thumbnailFileSize` | Number | No | The size of the thumbnail. |\n\n#### constructor(fileUrl)\n\nReturns a new `FileMessage` instance.\n\n* `fileUrl` - String: The URL of the file.\n\n#### setFileName(fileName)\n\nSet the `fileName` property.\n\n* `fileName` - String: The file name.\n\n#### setFileMIMEType(fileMIMEType)\n\nSet the `fileMIMEType` property.\n\n* `fileMIMEType` - String: The MIME type of the file.\n\n#### setFileSize(fileSize)\n\nSet the `fileSize` property.\n\n* `fileSize` - Number: The size of the file.\n\n#### setThumbnailUrl(thumbnailUrl)\n\nSet the `thumbnailUrl` property.\n\n* `thumbnailUrl` - String: The URL of the thumbnail.\n\n#### setThumbnailFileName(thumbnailFileName)\n\net the `thumbnailFileName` property.\n\n* `thumbnailFileName` - String: The file name of the thumbnail.\n\n#### setThumbnailMIMEType(thumbnailMIMEType)\n\nSet the `thumbnailMIMEType` property.\n\n* `thumbnailMIMEType` - String: The MIME type of the thumbnail.\n\n#### setThumbnailFileSize(thumbnailFileSize)\n\nSet the `thumbnailFileSize` property.\n\n* `thumbnailFileSize` - Number: The size of the thumbnail.\n\n### AudioMessage Functions\n\nAn `AudioMessage` object representes an audio file and has the following properties:\n\n| Property | Type | Mandatory | Description |\n| --- | --- | --- | --- |\n| `fileUrl` | String | Yes | The URL of the file. |\n| `fileName` | String | No | The file name. |\n| `fileMIMEType` | String | No | The MIME type of the file. |\n| `fileSize` | Number | No | The size of the file. |\n| `playingLength` | Number | No | The playing length of the audio. |\n\n#### constructor(fileUrl)\n\nReturns a new `AudioMessage` instance.\n\n* `fileUrl` - String: The URL of the file.\n\n#### setFileName(fileName)\n\nSet the `fileName` property.\n\n* `fileName` - String: The file name.\n\n#### setFileMIMEType(fileMIMEType)\n\nSet the `fileMIMEType` property.\n\n* `fileMIMEType` - String: The MIME type of the file.\n\n#### setFileSize(fileSize)\n\nSet the `fileSize` property.\n\n* `fileSize` - Number: The size of the file.\n\n#### setPlayingLength(playingLength)\n\nSet the `playingLength` property.\n\n* `playingLength` - Number: The playing length of the audio.\n\n### GeolocationPushMessage\n\n Property | Type | Mandatory | Description |\n| --- | --- | --- | --- |\n| `pos` | String | Yes | This are the coordinates in WGS 84 (latitude, longitude) decimal notation. Example \"26.118 1289 - 80.1283921\" |\n| `label` | String | No | This can be used to tag the nature of the location. |\n| `timestamp` | String | No | This is the time when the location information was pushed. |\n| `expiry` | String | No | This is an absolute date at which time the recipient is no longer permitted to possess the location information. |\n| `timeOffset` | Number | No | This is the time zone where the location information was pushed, expressed as the number of minutes away from UTC. |\n| `radius` | Number | No | The radius of the circle will be represented in meters. |\n\n#### constructor(pos)\n\nReturns a new `GeolocationPushMessage` instance. This is a geolocation push to be sent via RCS Geolocation Push.\n\n* `pos` - String: This are the coordinates in WGS 84 (latitude, longitude) decimal notation.\n\n#### setLabel(label)\n\nSet the `label` property.\n\n* `label` - String: This can be used to tag the nature of the location.\n\n#### setTimestamp(timestamp)\n\nSet the `timestamp` property.\n\n* `timestamp` - String: This is the time when the location information was pushed.\n\n#### setExpiry(expiry)\n\nSet the `expiry` property.\n\n* `expiry` - String: This is an absolute date at which time the recipient is no longer permitted to possess the location information.\n\n#### setTimeOffset(timeOffset)\n\nSet the `timeOffset` property.\n\n* `timeOffset` - Number: This is the time zone where the location information was pushed, expressed as the number of minutes away from UTC.\n\n#### setRadius(radius)\n\nSet the `radius` property.\n\n* `radius` - Number: The radius of the circle will be represented in meters.\n\n### Richcard Functions\n\n#### constructor()\n\nReturns a new `Richcard` instance.\n\nReturns a new `Richcard` instance.\n\n#### setCardOrientation(cardOrientation)\n\nSet the orientation of the card.\n\n* `cardOrientation` - String: Either `rcs_chatbot.CardOrientation.HORIZONTAL` or `rcs_chatbot.CardOrientation.VERTICAL`.\n\n#### setImageAlignment(imageAlignment)\n\nSet the alignment of the image on the card.\n\n* `imageAlignment` - String: Either `rcs_chatbot.ImageAlignment.LEFT` or `rcs_chatbot.ImageAlignment.RIGHT`.\n\n#### setMedia(mediaUrl, mediaContentType, mediaFileSize, height, [thumbnailUrl], [thumbnailContentType], [thumbnailFileSize], [contentDescription])\n\nSet the media (image) to be displayed on the richcard.\n\n* `mediaUrl` - String: The URL to the image.\n* `mediaContentType` - String: The content type of the image.\n* `mediaFileSize` - Number: The size of the image.\n* `height` - String: Either `rcs_chatbot.MediaHeight.SHORT` or `rcs_chatbot.MediaHeight.MEDIUM` or `rcs_chatbot.MediaHeight.TALL`.\n* `thumbnailUrl` - (Optional) String: The URL to the thumbnail for the image.\n* `thumbnailContentType` - (Optional) String: The content type of the thumbnail.\n* `thumbnailFileSize` - (Optional) Number: The size of the thumbnail.\n* `contentDescription` - (Optional) String: Textual description of media content.\n\nThe `thumbnailUrl` property is optional, but if used, `thumbnailContentType` and `thumbnailFileSize` must be provided as well.\n\n#### setTitle(title)\n\nSet the title of the card.\n\n* `title` - String: The title.\n\n#### setDescription(description)\n\nSet the description of the card.\n\n* `description` - String: The description.\n\n#### setSuggestions(suggestions)\n\nAdd suggestions to the card.\n\n* `suggestions` - Suggestions: The suggestions.\n\n### RichcardCarousel Functions\n\n#### constructor()\n\nReturns a new `RichcardCarousel` instance.\n\n#### setCardWidth(cardWidth)\n\nSet the width of the cards in the carousel.\n\n* `cardWidth` - String: Either `rcs_chatbot.CardWidth.SMALL` or `rcs_chatbot.CardWidth.MEDIUM`.\n\n#### addRichcard(richcard)\n\nAdd a card to the carousel.\n\n* `richcard` - Richcard: The `Richcard` object.\n\n### Suggestions Functions\n\nSuggested Replies consist of a display text and a set of postback data.\n\nSuggested Actions are grouped into seven different categories supporting a total of twelve different suggested actions:\n\n* urlAction:\n * openUrl - Opens a web site or app via deep linking.\n* dialerAction:\n * dialPhoneNumber - Calls a phone number via the user's dialer app.\n * dialEnrichedCall - Start an Enriched Call via the user\u2019s dialer app.\n * dialVideoCall - Start a video call via the user\u2019s dialer app.\n* mapAction:\n * showLocation - Show location(s) on a map for given coordinates or search query.\n * requestLocationPush - Request for a one-time geo location push.\n* calendarAction:\n * createCalendarEvent - Creates a new event on the user's calendar.\n* composeAction:\n * composeTextMessage - Compose a draft text message.\n * composeRecordingMessage - Compose a draft message and start recording audio or video.\n* deviceAction:\n * requestDeviceSpecifics - Request for a one-time share of device specifics (device model, operating system version, messaging client identifier and version, and remaining battery charge in minutes).\n* settingsAction:\n * disableAnonymization - Ask the user to disable the anonymization setting.\n * enableDisplayedNotifications - Ask the user to enable sending displayed notifications.\n\nMost actions allow fallback URLs in case a user does not have any app of the required type installed. Chatbot platforms can use the fallback URL to suggest an appropriate app to the user.\n\n#### constructor()\n\nReturns a new `Suggestions` instance.\n\n#### addReply(displayText, postbackData)\n\nOn-the-wire example:\n\n```json\n{\n \"reply\": {\n \"displayText\": \"Yes\",\n \"postback\": {\n \"data\": \"set_by_chatbot_reply_yes\"\n }\n }\n}\n```\n\n#### addUrlAction(displayText, postbackData, url)\n\nOn-the-wire example:\n\n```json\n{\n \"action\": {\n \"urlAction\": {\n \"openUrl\": {\n \"url\": \"https://www.google.com\"\n }\n },\n \"displayText\": \"Open website or deep link\",\n \"postback\": {\n \"data\": \"set_by_chatbot_open_url\"\n }\n }\n}\n```\n\n#### addDialerAction(displayText, postbackData, dialType, phoneNumber, fallbackUrl, subject = None)\n\nOn-the-wire example:\n\n```json\n{\n \"action\": {\n \"dialerAction\": {\n \"dialPhoneNumber\": {\n \"phoneNumber\": \"+1650253000\"\n }\n },\n \"displayText\": \"Call a phone number\",\n \"postback\": {\n \"data\": \"set_by_chatbot_dial_phone_number\"\n }\n }\n},\n{\n \"action\": {\n \"dialerAction\": {\n \"dialEnrichedCall\": {\n \"phoneNumber\": \"+1650253000\",\n \"subject\": \"The optional subject for the enriched call\"\n }\n },\n \"displayText\": \"Start enriched call\",\n \"postback\": {\n \"data\": \"set_by_chatbot_dial_enriched_call\"\n }\n }\n},\n{\n \"action\": {\n \"dialerAction\": {\n \"dialVideoCall\": {\n \"phoneNumber\": \"+1650253000\"\n }\n },\n \"displayText\": \"Start video call\",\n \"postback\": {\n \"data\": \"set_by_chatbot_dial_video_call\"\n }\n }\n}\n```\n\n#### addRequestLocationPushMapAction(displayText, postbackData)\n\nOn-the-wire example:\n\n```json\n{\n \"action\": {\n \"mapAction\": {\n \"requestLocationPush\": {}\n },\n \"displayText\": \"Request a geo location\",\n \"postback\": {\n \"data\": \"set_by_chatbot_request_location_push\"\n }\n }\n}\n```\n\n#### addShowLocationMapAction(displayText, postbackData, latitude, longitude, label, query, fallbackUrl)\n\nOn-the-wire example:\n\n```json\n{\n \"action\": {\n \"mapAction\": {\n \"showLocation\": {\n \"location\": {\n \"latitude\": 37.4220041,\n \"longitude\": -122.0862515,\n \"label\": \"Googleplex\"\n },\n \"fallbackUrl\": \"https://www.google.com/maps/@37.4219162,-122.078063,15z\"\n }\n },\n \"displayText\": \"Show location on a map\",\n \"postback\": {\n \"data\": \"set_by_chatbot_show_location\"\n }\n }\n},\n{\n \"action\": {\n \"mapAction\": {\n \"showLocation\": {\n \"location\": {\n \"query\": \"restaurants\"\n },\n \"fallbackUrl\": \"https://www.google.com/maps/search/restaurants\"\n }\n },\n \"displayText\": \"Search location(s) on map\",\n \"postback\": {\n \"data\": \"set_by_chatbot_search_locations\"\n }\n }\n}\n```\n\n#### addCalendarAction(displayText, postbackData, startTime, endTime, title, description, fallbackUrl)\n\nOn-the-wire example:\n\n```json\n{\n \"action\": {\n \"calendarAction\": {\n \"createCalendarEvent\": {\n \"startTime\": \"2017-03-14T00:00:00Z\",\n \"endTime\": \"2017-03-14T23:59:59Z\",\n \"title\": \"Meeting\",\n \"description\": \"GSG review meeting\"\n }\n },\n \"displayText\": \"Schedule Meeting\",\n \"postback\": {\n \"data\": \"set_by_chatbot_create_calendar_event\"\n }\n }\n}\n```\n\n#### addTextComposeAction(displayText, postbackData, phoneNumber, text)\n\nOn-the-wire example:\n\n```json\n{\n \"action\": {\n \"composeAction\": {\n \"composeTextMessage\": {\n \"phoneNumber\": \"+1650253000\",\n \"text\": \"Draft to go into the send message text field.\"\n }\n },\n \"displayText\": \"Draft a text message\",\n \"postback\": {\n \"data\": \"set_by_chatbot_compose_text_message\"\n }\n }\n}\n```\n\n#### addRecordingComposeAction(displayText, postbackData, phoneNumber, type)\n\nOn-the-wire example:\n\n```json\n{\n \"action\": {\n \"composeAction\": {\n \"composeRecordingMessage\": {\n \"phoneNumber\": \"+1650253000\",\n \"type\": \"VIDEO\"\n }\n },\n \"displayText\": \"Record audio or video\",\n \"postback\": {\n \"data\": \"set_by_chatbot_compose_recording_message\"\n }\n }\n}\n```\n\n#### addDeviceAction(displayText, postbackData)\n\nOn-the-wire example:\n\n```json\n{\n \"action\": {\n \"deviceAction\": {\n \"requestDeviceSpecifics\": {}\n },\n \"displayText\": \"Request device specifics\",\n \"postback\": {\n \"data\": \"set_by_chatbot_request_device_specifics\"\n }\n }\n}\n```\n\n#### addSettingsAction(displayText, postbackData, settingsType)\n\nOn-the-wire example:\n\n```json\n{\n \"action\": {\n \"settingsAction\": {\n \"disableAnonymization\": {}\n },\n \"displayText\": \"Share your phone number\",\n \"postback\": {\n \"data\": \"set_by_chatbot_disable_anonymization\"\n }\n }\n},\n{\n \"action\": {\n \"settingsAction\": {\n \"enableDisplayedNotifications\": {}\n },\n \"displayText\": \"Send read receipts\",\n \"postback\": {\n \"data\": \"set_by_chatbot_enable_displayed_notifications\"\n }\n }\n}\n```\n\n### Events\n\nA different event is triggered for each type of event an RCS chatbot can receive. Below are all\nthe possible events with an example of the payload they provide.\n\n#### EventType.MESSAGE\n\nTriggered when a 'message' event is sent to the bot.\n\n* `event` - Object: An object containing the 'message' event payload.\n\nExample usage:\n\n```python\n@chatbot.registerEventHandler(rcs_chatbot.EventType.MESSAGE)\ndef messageHandler(event):\n print(\"messageHandler\")\n```\n\nSample payload:\n\n```json\n{\n \"RCSMessage\": {\n \"msgId\": \"Xs8CI3tdf\",\n \"textMessage\": \"hello world\",\n \"timestamp\": \"2017-09-26T01:33:20.315Z\"\n },\n \"messageContact\": {\n \"userContact\": \"+14251234567\"\n },\n \"event\": \"message\"\n}\n```\n\n#### EventType.ISTYPING\n\nTriggered when an 'isTyping' event is sent to the bot.\n\n* `event` - Object: An object containing the 'isTyping' event payload.\n\nExample usage:\n\n```python\n@chatbot.registerEventHandler(rcs_chatbot.EventType.ISTYPING)\ndef isTypingHandler(event):\n print(\"isTypingHandler\")\n```\n\nSample payload:\n\n```json\n{\n \"RCSMessage\": {\n \"msgId\": \"Xs8CI3tdf\",\n \"isTyping\": \"active\",\n \"timestamp\": \"2017-09-26T01:33:20.315Z\"\n },\n \"messageContact\": {\n \"userContact\": \"+14251234567\"\n },\n \"event\": \"isTyping\"\n}\n```\n\n#### EventType.MESSAGESTATUS\n\nTriggered when a 'messageStatus' event is sent to the bot.\n\n* `event` - Object: An object containing the 'messageStatus' event payload.\n\nExample usage:\n\n```python\n@chatbot.registerEventHandler(rcs_chatbot.EventType.MESSAGESTATUS)\ndef messageStatusHandler(event):\n print(\"messageStatusHandler\")\n```\n\nSample payload:\n\n```json\n{\n \"RCSMessage\": {\n \"msgId\": \"MzJmajlmamVzZGZ8bmk5MHNlbmRmZTAz\",\n \"status\": \"displayed\",\n \"timestamp\": \"2017-09-26T01:33:20.315Z\"\n },\n \"messageContact\": {\n \"userContact\": \"+14251234567\"\n },\n \"event\": \"messageStatus\"\n}\n```\n\n#### EventType.FILESTATUS\n\nTriggered when a 'fileStatus' event is sent to the bot.\n\n* `event` - Object: An object containing the 'fileStatus' event payload.\n\nExample usage:\n\n```python\n@chatbot.registerEventHandler(rcs_chatbot.EventType.FILESTATUS)\ndef fileStatusHandler(event):\n print(\"fileStatusHandler\")\n```\n\nSample payload:\n\n```json\n{\n \"file\": {\n \"fileId\": \"MzJmajlmamVzZGZ8bmk5MHNlbmRmZTAz\",\n \"fileUrl\": \"http://www.example.com/files/f.jpg\",\n \"fileSize\": 123456,\n \"status\": \"ready\",\n \"validity\": \"2017-10-03T22:31:00.597Z\"\n },\n \"event\": \"fileStatus\"\n}\n```\n\n#### EventType.RESPONSE\n\nTriggered when a 'response' event is sent to the bot.\n\n* `event` - Object: An object containing the 'response' event payload.\n\nExample usage:\n\n```python\n@chatbot.registerEventHandler(rcs_chatbot.EventType.RESPONSE)\ndef responseHandler(event):\n print(\"responseHandler\")\n```\n\nSample payload:\n\n```json\n{\n \"RCSMessage\": {\n \"msgId\": \"MzJmajlmamVzZGZ8bmk5MHNlbmRmZTAz\",\n \"suggestedResponse\": {\n \"response\": {\n \"action\": {\n \"displayText\": \"Visit Website\",\n \"postback\": {\n \"data\": \"set_by_chatbot_reply_yes\"\n }\n }\n }\n },\n \"timestamp\": \"2017-09-26T01:33:20.315Z\"\n },\n \"messageContact\": {\n \"userContact\": \"+14251234567\"\n },\n \"event\": \"response\"\n}\n```\n\n#### EventType.ALIAS\n\nTriggered when a 'alias' event is sent to the bot.\n\n* `event` - Object: An object containing the 'alias' event payload.\n\nExample usage:\n\n```python\n@chatbot.registerEventHandler(rcs_chatbot.EventType.ALIAS)\ndef aliasHandler(event):\n print(\"aliasHandler\")\n```\n\nSample payload:\n\n```json\n{\n \"RCSMessage\": {\n \"msgId\": \"MzJmajlmamVzZGZ8bmk5MHNlbmRmZTAz\",\n \"timestamp\": \"2017-09-26T01:33:20.315Z\"\n },\n \"messageContact\": {\n \"userContact\": \"+14251234567\",\n \"chatId\": \"93JF93SEIJFE\"\n },\n \"event\": \"alias\"\n}\n```\n\n#### EventType.NEWUSER\n\nTriggered when a 'newUser' event is sent to the bot.\n\n* `event` - Object: An object containing the 'newUser' event payload.\n\nExample usage:\n\n```python\n@chatbot.registerEventHandler(rcs_chatbot.EventType.NEWUSER)\ndef newUserHandler(event):\n print(\"newUserHandler\")\n```\n\nSample payload:\n\n```json\n{\n \"RCSMessage\": {\n \"msgId\": \"MzJmajlmamVzZGZ8bmk5MHNlbmRmZTAz\",\n \"suggestedResponse\": {\n \"response\": {\n \"reply\": {\n \"displayText\": \"Start Chat\",\n \"postback\": {\n \"data\": \"new_bot_user_initiation\"\n }\n }\n }\n },\n \"timestamp\": \"2017-09-26T01:33:20.315Z\"\n },\n \"messageContact\": {\n \"userContact\": \"+14251234567\"\n },\n \"event\": \"newUser\"\n}\n```\n\n## To Do\n\n* Verify constraints before sending\n* Look for missing fields like trafficType (there may be more)\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pvangool/py-rcs-chatbot", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "rcs-chatbot", "package_url": "https://pypi.org/project/rcs-chatbot/", "platform": "", "project_url": "https://pypi.org/project/rcs-chatbot/", "project_urls": { "Homepage": "https://github.com/pvangool/py-rcs-chatbot" }, "release_url": "https://pypi.org/project/rcs-chatbot/0.0.6/", "requires_dist": null, "requires_python": "", "summary": "Python SDK for RCS MaaP chatbot", "version": "0.0.6" }, "last_serial": 5396867, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "1e3b24fdcb8e6e197ea003fb9b3dca15", "sha256": "5fcf829cdf36884167fb75ec69961dd0b5c944d439b55e39de2ee7e344b4c09e" }, "downloads": -1, "filename": "rcs_chatbot-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "1e3b24fdcb8e6e197ea003fb9b3dca15", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6409, "upload_time": "2019-06-10T15:01:10", "url": "https://files.pythonhosted.org/packages/01/b4/31e9d1466eac30aed92f601ff1b7717b689b15c5876ebf297719f243bcb3/rcs_chatbot-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0c6c077b77342ba4378cb130baf6e5fd", "sha256": "f28d3fdc1b8f25d8710e34bba7c6cb7036da192333e75e324bf6721f281a50fb" }, "downloads": -1, "filename": "rcs_chatbot-0.0.2.tar.gz", "has_sig": false, "md5_digest": "0c6c077b77342ba4378cb130baf6e5fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3369, "upload_time": "2019-06-10T15:01:12", "url": "https://files.pythonhosted.org/packages/21/31/bba5acc11eec3a2788e5ba7968edc7849beac77e892b6916280d7660d40f/rcs_chatbot-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "8587b6325dca4406d26abb4c58eed145", "sha256": "4b3e6cd4f9c0be08cfed2a06aae8640a8809e1774c52f267be0567251d8ebeef" }, "downloads": -1, "filename": "rcs_chatbot-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8587b6325dca4406d26abb4c58eed145", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6937, "upload_time": "2019-06-10T16:20:02", "url": "https://files.pythonhosted.org/packages/02/f9/99bbbdfbe115e79347e65f01062f8c2086a53bcfd9071684e3a3f01f26c1/rcs_chatbot-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b5e2bd2d5266fa996b7555ec738e553", "sha256": "b3626a8ac518d1d661b425b551117ee7f7f9d6336fd8e84c02e94d9af8331632" }, "downloads": -1, "filename": "rcs_chatbot-0.0.3.tar.gz", "has_sig": false, "md5_digest": "7b5e2bd2d5266fa996b7555ec738e553", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7926, "upload_time": "2019-06-10T16:20:04", "url": "https://files.pythonhosted.org/packages/fd/db/396767ddd4726c0aeeba0810d800000e7e0ee7220aa7d1564e4b738ec3d6/rcs_chatbot-0.0.3.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "6ce81549b001bd7cd24b8ee3d9fbf99a", "sha256": "e2dd1d49fb1ad82878a0f8c7258b96ceb82dd5afb559eee94bfad8cd045e1206" }, "downloads": -1, "filename": "rcs_chatbot-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "6ce81549b001bd7cd24b8ee3d9fbf99a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10433, "upload_time": "2019-06-10T20:07:06", "url": "https://files.pythonhosted.org/packages/3e/08/29706838fff80c8f4ea79b3536fde92bec6f134b8e9aaf07b261a1048b5d/rcs_chatbot-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c5d61149960db73ed852391efcbb73a3", "sha256": "b3df51bf7f9c06fa2d23714c75ccfda9ea8550b0922a0da4db91aa093ebda11e" }, "downloads": -1, "filename": "rcs_chatbot-0.0.5.tar.gz", "has_sig": false, "md5_digest": "c5d61149960db73ed852391efcbb73a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15771, "upload_time": "2019-06-10T20:07:07", "url": "https://files.pythonhosted.org/packages/f4/1c/ff0ee3e904c0c1c72be16b068384a48294afa3aebe967570a458c811cd6d/rcs_chatbot-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "d18dcdc15556555223e0303f5f695b64", "sha256": "1590f7d75a9337bd0435445abe114e8bb1d796240f3e69eb76a50d3a8f145fd8" }, "downloads": -1, "filename": "rcs_chatbot-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "d18dcdc15556555223e0303f5f695b64", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10612, "upload_time": "2019-06-13T16:58:57", "url": "https://files.pythonhosted.org/packages/de/7f/2c89eba85499a92bbc45dfd5b9a8c6bb5b840734ee4f0c65999f6bcd1a7e/rcs_chatbot-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "35457a5c11adf83c36d73e7820fc076a", "sha256": "842a9203f2aa0569672e77597db36804f9ebb02189160afe6f317ca3695a4a6a" }, "downloads": -1, "filename": "rcs_chatbot-0.0.6.tar.gz", "has_sig": false, "md5_digest": "35457a5c11adf83c36d73e7820fc076a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15987, "upload_time": "2019-06-13T16:58:59", "url": "https://files.pythonhosted.org/packages/88/17/efe5e0016f2af7b9c6d435534d749440acb50343ff0548e1b19ad56a4927/rcs_chatbot-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d18dcdc15556555223e0303f5f695b64", "sha256": "1590f7d75a9337bd0435445abe114e8bb1d796240f3e69eb76a50d3a8f145fd8" }, "downloads": -1, "filename": "rcs_chatbot-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "d18dcdc15556555223e0303f5f695b64", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10612, "upload_time": "2019-06-13T16:58:57", "url": "https://files.pythonhosted.org/packages/de/7f/2c89eba85499a92bbc45dfd5b9a8c6bb5b840734ee4f0c65999f6bcd1a7e/rcs_chatbot-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "35457a5c11adf83c36d73e7820fc076a", "sha256": "842a9203f2aa0569672e77597db36804f9ebb02189160afe6f317ca3695a4a6a" }, "downloads": -1, "filename": "rcs_chatbot-0.0.6.tar.gz", "has_sig": false, "md5_digest": "35457a5c11adf83c36d73e7820fc076a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15987, "upload_time": "2019-06-13T16:58:59", "url": "https://files.pythonhosted.org/packages/88/17/efe5e0016f2af7b9c6d435534d749440acb50343ff0548e1b19ad56a4927/rcs_chatbot-0.0.6.tar.gz" } ] }