{"__v":0,"_id":"5845a4a99f6fbb1b00430807","category":{"version":"5845a4a89f6fbb1b004307b7","project":"54d3007669578e0d002730c9","_id":"5845a4a89f6fbb1b004307bd","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-08T18:48:02.369Z","from_sync":false,"order":5,"slug":"integrations","title":"Integrations"},"parentDoc":null,"project":"54d3007669578e0d002730c9","user":"55a04a395730f40d001104d2","version":{"__v":1,"_id":"5845a4a89f6fbb1b004307b7","project":"54d3007669578e0d002730c9","createdAt":"2016-12-05T17:32:24.708Z","releaseDate":"2016-12-05T17:32:24.708Z","categories":["5845a4a89f6fbb1b004307b8","5845a4a89f6fbb1b004307b9","5845a4a89f6fbb1b004307ba","5845a4a89f6fbb1b004307bb","5845a4a89f6fbb1b004307bc","5845a4a89f6fbb1b004307bd","5845a4a89f6fbb1b004307be","5845a4a89f6fbb1b004307bf","5845a4a89f6fbb1b004307c0"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"25.0.0","version":"25"},"updates":["5836c18eb1fd6c1b00e359b0"],"next":{"pages":[],"description":""},"createdAt":"2016-06-10T17:06:17.560Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":12,"body":"* [Overview](#overview)\n* [Create a Bot in Cisco Spark](#create-a-bot-in-cisco-spark)\n* [Integrate API.AI Agent with Spark Bot](#integrate-apiai-agent-with-spark-bot)\n* [Test Your Bot](#test-your-bot)\n* [Hosting Spark Bot with Heroku](#hosting-spark-bot-with-heroku)\n * [Create a Bot in Cisco Spark](#section-creating-a-cisco-spark-bot)\n * [Enabling Spark Integration in API.AI with Heroku Hosting](#section-enabling-spark-integration-in-api-ai-with-heroku-hosting)\n * [Configuring Heroku App](#section-configuring-heroku-app)\n * [Testing Your Bot](#section-testing-your-bot)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Overview\"\n}\n[/block]\n**API.AI Spark Integration** allows you to easily create Spark bots with natural language understanding based on the API.AI technology.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Create a Bot in Cisco Spark\"\n}\n[/block]\nLog in to your Spark account and go to <a href=\"https://developer.ciscospark.com/apps.html\" target=\"_blank\">My Apps</a>.\n\nTo add a new app, click on the plus button in the right upper conner.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/4rcUqqYRsC1TcEmskxkw_Spark_My_Apps.png\",\n        \"Spark_My_Apps.png\",\n        \"2602\",\n        \"516\",\n        \"#049cdc\",\n        \"\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nChoose 'Create a Bot' option.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/5e2b535-Spark_New_App.png\",\n        \"Spark_New_App.png\",\n        2600,\n        1102,\n        \"#b8d0c8\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nFill in the following fields: Display Name, Bot Username, Icon, and click 'Add Bot'.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/z56DWLWOT6W4CwoqkVuB_Spark_Add_Bot.png\",\n        \"Spark_Add_Bot.png\",\n        \"2582\",\n        \"1452\",\n        \"#049cdc\",\n        \"\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\n After the validation, copy the Access token.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0wtFRw5VR2ipAwvG5hUQ_Spark_Copy_Access_token.png\",\n        \"Spark_Copy_Access_token.png\",\n        \"2588\",\n        \"1656\",\n        \"#049cdc\",\n        \"\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Integrate API.AI Agent with Spark Bot\"\n}\n[/block]\n<a href=\"https://console.api.ai/api-client/#/newAgent\" target=\"_blank\">Create an API.AI agent</a> with the help of the <a href=\"https://docs.api.ai/docs/key-concepts\" target=\"_blank\">API.AI NLU technology tools</a>.\n\nIn your API.AI agent Integrations menu, enable Cisco Spark integration.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7a2574e-Spark-integration-enable.png\",\n        \"Spark-integration-enable.png\",\n        2044,\n        1356,\n        \"#fbfbfb\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nIn the settings, paste the Access Token that you copied in your Spark app settings.\n\nThen, click 'Start'. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/91cbef6-Spark_Insert_Access-Token.png\",\n        \"Spark_Insert_Access-Token.png\",\n        2158,\n        1208,\n        \"#4a5261\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nNow, your bot is ready for conversation.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Test Your Bot\"\n}\n[/block]\nGo to the Cisco Spark app and search for your bot.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/077f02f-Spark_search_bot_in_app.png\",\n        \"Spark_search_bot_in_app.png\",\n        2300,\n        1505,\n        \"#2c9d5f\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nClick 'Chat with :::at:::your_bot_name' and you'll be able to chat with your bot 1-to-1.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/2b753f0-Spark-1-to-1.png\",\n        \"Spark-1-to-1.png\",\n        2142,\n        1508,\n        \"#f0f0f0\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nYou can also add your bot to chat rooms. To address you bot in a chat room, mention its name at the beginning of every message in the format `@your_bot_name`. You can start typing `@` and then select your bot name from the suggested options.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/U6R2hm6DQWwrpk51IKgw_Spark_integration_testing.png\",\n        \"Spark_integration_testing.png\",\n        \"2790\",\n        \"1652\",\n        \"#13a1b9\",\n        \"\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nInstead of hosting your bot with API.AI, you can host it with Heroku or any other service.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Hosting Spark Bot with Heroku\"\n}\n[/block]\nHere’s an example of how you can host and launch your Spark bot with Heroku.\n\n\n## Creating a Cisco Spark Bot\n\nCreate a Spark bot as described [here](#create-a-bot-in-cisco-spark).\n\n## Enabling Spark Integration in API.AI with Heroku Hosting\n\n<a href=\"https://console.api.ai/api-client/#/newAgent\" target=\"_blank\">Create an API.AI agent</a> with the help of the <a href=\"https://docs.api.ai/docs/key-concepts\" target=\"_blank\">API.AI NLU technology tools</a>.\n\nIn the left side menu, click Integrations and enable Cisco Spark integration. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/b838587-CiscoSpark_enable.png\",\n        \"CiscoSpark_enable.png\",\n        2038,\n        1366,\n        \"#fbfbfb\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nThen, click the ‘Deploy to Heroku’ button (you need to be logged in to your Heroku account).\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7a5da85-Spark_Deploy-to-Heroku.png\",\n        \"Spark_Deploy-to-Heroku.png\",\n        2154,\n        1228,\n        \"#4b5162\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\n## Configuring Heroku App\n\nOn the Heroku app settings page, fill in the following fields:\n\n**App Name** – insert your app name (can be any string containing lowercase letters, numbers, and hyphens).\n\n**SPARK_ACCESS_TOKEN** – access token generated in your Cisco Spark bot settings.\n\n**PERSON_TO_INVITE** – a login email address.\n\n**ROOM_NAME** – room name to chat with the bot.\n\n**APIAI_LANG** – the language should be the same as in your API.AI agent.\n\nThen, click the ‘Deploy for Free’ button and wait until “Your app was successfully deployed.” appears.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/4e9d018-CiscoSpark_HerokuSettings.png\",\n        \"CiscoSpark_HerokuSettings.png\",\n        1812,\n        1598,\n        \"#8073a5\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\n## Testing Your Bot\n\nTest your Spark bot as described [here](#test-your-bot).","excerpt":"","slug":"spark-integration","type":"basic","title":"Spark Integration"}
* [Overview](#overview) * [Create a Bot in Cisco Spark](#create-a-bot-in-cisco-spark) * [Integrate API.AI Agent with Spark Bot](#integrate-apiai-agent-with-spark-bot) * [Test Your Bot](#test-your-bot) * [Hosting Spark Bot with Heroku](#hosting-spark-bot-with-heroku) * [Create a Bot in Cisco Spark](#section-creating-a-cisco-spark-bot) * [Enabling Spark Integration in API.AI with Heroku Hosting](#section-enabling-spark-integration-in-api-ai-with-heroku-hosting) * [Configuring Heroku App](#section-configuring-heroku-app) * [Testing Your Bot](#section-testing-your-bot) [block:api-header] { "type": "basic", "title": "Overview" } [/block] **API.AI Spark Integration** allows you to easily create Spark bots with natural language understanding based on the API.AI technology. [block:api-header] { "type": "basic", "title": "Create a Bot in Cisco Spark" } [/block] Log in to your Spark account and go to <a href="https://developer.ciscospark.com/apps.html" target="_blank">My Apps</a>. To add a new app, click on the plus button in the right upper conner. [block:image] { "images": [ { "image": [ "https://files.readme.io/4rcUqqYRsC1TcEmskxkw_Spark_My_Apps.png", "Spark_My_Apps.png", "2602", "516", "#049cdc", "" ], "sizing": "full" } ] } [/block] Choose 'Create a Bot' option. [block:image] { "images": [ { "image": [ "https://files.readme.io/5e2b535-Spark_New_App.png", "Spark_New_App.png", 2600, 1102, "#b8d0c8" ], "sizing": "full" } ] } [/block] Fill in the following fields: Display Name, Bot Username, Icon, and click 'Add Bot'. [block:image] { "images": [ { "image": [ "https://files.readme.io/z56DWLWOT6W4CwoqkVuB_Spark_Add_Bot.png", "Spark_Add_Bot.png", "2582", "1452", "#049cdc", "" ], "sizing": "full" } ] } [/block] After the validation, copy the Access token. [block:image] { "images": [ { "image": [ "https://files.readme.io/0wtFRw5VR2ipAwvG5hUQ_Spark_Copy_Access_token.png", "Spark_Copy_Access_token.png", "2588", "1656", "#049cdc", "" ], "sizing": "full" } ] } [/block] [block:api-header] { "type": "basic", "title": "Integrate API.AI Agent with Spark Bot" } [/block] <a href="https://console.api.ai/api-client/#/newAgent" target="_blank">Create an API.AI agent</a> with the help of the <a href="https://docs.api.ai/docs/key-concepts" target="_blank">API.AI NLU technology tools</a>. In your API.AI agent Integrations menu, enable Cisco Spark integration. [block:image] { "images": [ { "image": [ "https://files.readme.io/7a2574e-Spark-integration-enable.png", "Spark-integration-enable.png", 2044, 1356, "#fbfbfb" ], "sizing": "full" } ] } [/block] In the settings, paste the Access Token that you copied in your Spark app settings. Then, click 'Start'. [block:image] { "images": [ { "image": [ "https://files.readme.io/91cbef6-Spark_Insert_Access-Token.png", "Spark_Insert_Access-Token.png", 2158, 1208, "#4a5261" ], "sizing": "full" } ] } [/block] Now, your bot is ready for conversation. [block:api-header] { "type": "basic", "title": "Test Your Bot" } [/block] Go to the Cisco Spark app and search for your bot. [block:image] { "images": [ { "image": [ "https://files.readme.io/077f02f-Spark_search_bot_in_app.png", "Spark_search_bot_in_app.png", 2300, 1505, "#2c9d5f" ], "sizing": "full" } ] } [/block] Click 'Chat with @your_bot_name' and you'll be able to chat with your bot 1-to-1. [block:image] { "images": [ { "image": [ "https://files.readme.io/2b753f0-Spark-1-to-1.png", "Spark-1-to-1.png", 2142, 1508, "#f0f0f0" ], "sizing": "full" } ] } [/block] You can also add your bot to chat rooms. To address you bot in a chat room, mention its name at the beginning of every message in the format `@your_bot_name`. You can start typing `@` and then select your bot name from the suggested options. [block:image] { "images": [ { "image": [ "https://files.readme.io/U6R2hm6DQWwrpk51IKgw_Spark_integration_testing.png", "Spark_integration_testing.png", "2790", "1652", "#13a1b9", "" ], "sizing": "full" } ] } [/block] Instead of hosting your bot with API.AI, you can host it with Heroku or any other service. [block:api-header] { "type": "basic", "title": "Hosting Spark Bot with Heroku" } [/block] Here’s an example of how you can host and launch your Spark bot with Heroku. ## Creating a Cisco Spark Bot Create a Spark bot as described [here](#create-a-bot-in-cisco-spark). ## Enabling Spark Integration in API.AI with Heroku Hosting <a href="https://console.api.ai/api-client/#/newAgent" target="_blank">Create an API.AI agent</a> with the help of the <a href="https://docs.api.ai/docs/key-concepts" target="_blank">API.AI NLU technology tools</a>. In the left side menu, click Integrations and enable Cisco Spark integration. [block:image] { "images": [ { "image": [ "https://files.readme.io/b838587-CiscoSpark_enable.png", "CiscoSpark_enable.png", 2038, 1366, "#fbfbfb" ], "sizing": "full" } ] } [/block] Then, click the ‘Deploy to Heroku’ button (you need to be logged in to your Heroku account). [block:image] { "images": [ { "image": [ "https://files.readme.io/7a5da85-Spark_Deploy-to-Heroku.png", "Spark_Deploy-to-Heroku.png", 2154, 1228, "#4b5162" ], "sizing": "full" } ] } [/block] ## Configuring Heroku App On the Heroku app settings page, fill in the following fields: **App Name** – insert your app name (can be any string containing lowercase letters, numbers, and hyphens). **SPARK_ACCESS_TOKEN** – access token generated in your Cisco Spark bot settings. **PERSON_TO_INVITE** – a login email address. **ROOM_NAME** – room name to chat with the bot. **APIAI_LANG** – the language should be the same as in your API.AI agent. Then, click the ‘Deploy for Free’ button and wait until “Your app was successfully deployed.” appears. [block:image] { "images": [ { "image": [ "https://files.readme.io/4e9d018-CiscoSpark_HerokuSettings.png", "CiscoSpark_HerokuSettings.png", 1812, 1598, "#8073a5" ], "sizing": "full" } ] } [/block] ## Testing Your Bot Test your Spark bot as described [here](#test-your-bot).