{"id":19778896,"url":"https://github.com/dialogflow/fulfillment-bike-shop-nodejs","last_synced_at":"2025-04-30T21:31:17.774Z","repository":{"id":82729657,"uuid":"127785321","full_name":"dialogflow/fulfillment-bike-shop-nodejs","owner":"dialogflow","description":"Integrating Google Calendar API with Dialogflow's Fulfillment \u0026 Knowledge Connectors","archived":false,"fork":false,"pushed_at":"2019-01-10T18:17:15.000Z","size":50,"stargazers_count":79,"open_issues_count":3,"forks_count":62,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-06T04:41:47.222Z","etag":null,"topics":["add-to-dialogflow","dialogflow-fulfillment-nodejs","google-calendar-api","knowledge-connectors"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dialogflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-02T16:54:25.000Z","updated_at":"2024-08-18T18:19:01.000Z","dependencies_parsed_at":"2023-03-18T08:00:30.470Z","dependency_job_id":null,"html_url":"https://github.com/dialogflow/fulfillment-bike-shop-nodejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dialogflow%2Ffulfillment-bike-shop-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dialogflow%2Ffulfillment-bike-shop-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dialogflow%2Ffulfillment-bike-shop-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dialogflow%2Ffulfillment-bike-shop-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dialogflow","download_url":"https://codeload.github.com/dialogflow/fulfillment-bike-shop-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251785406,"owners_count":21643475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["add-to-dialogflow","dialogflow-fulfillment-nodejs","google-calendar-api","knowledge-connectors"],"created_at":"2024-11-12T05:32:34.798Z","updated_at":"2025-04-30T21:31:17.742Z","avatar_url":"https://github.com/dialogflow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dialogflow Bike Shop Sample\n\n## Setup Instructions\n### Dialogflow and Fulfillment Setup\n\nTo create this agent from our template:\n\n\u003ca href=\"https://console.dialogflow.com/api-client/oneclick?templateUrl=https://oneclickgithub.appspot.com/dialogflow/fulfillment-bike-shop-nodejs\u0026agentName=BikeShopSample\" target=\"blank\"\u003e\n  \u003cimg src=\"https://dialogflow.com/images/deploy.png\"\u003e\n\u003c/a\u003e\n\n#### Service Account Setup\n1. In [Dialogflow's console](https://console.dialogflow.com), go to settings ⚙ and under the general tab, you'll see the project ID section with a Google Cloud link to open the Google Cloud console. Open **Google Cloud**.\n1. In the Cloud console, go to the menu icon **☰ \u003e APIs \u0026 Services \u003e Library**\n1. Select **Google Calendar API** and then **Enable** to enable the API on your cloud project.\n1. Under the menu icon **☰ \u003e APIs \u0026 Services \u003e Credentials \u003e Create Credentials \u003e Service Account Key**.\n1. Under **Create service account key**, select **New Service Account** from the dropdown and enter `bike-shop-calendar` for the name and click **Create**. In the popup, select **Create Without Role**.\n    + JSON file will be downloaded to your computer that you will need in the setup sections below.\n\n#### Bike Shop Calendar Setup\n1. Open the JSON file that was downloaded in the previous section and copy the email address indicated by the `client_email` field\n```js\n// Ex:\nbike-shop-calendar@${PROJECTID}.iam.gserviceaccount.com\n```\n1. [Open Google Calendar](https://calendar.google.com). On the left, next to **Add a friend's calendar** click the **+** and select **New Calendar**\n1. Enter `Bike Shop` for the name of the calendar and select **Create Calendar**. Next, go to the `Bike Shop` calendar that will appear on the left column.\n1. Paste the email copied from the first step into the **Add people** field of the **Share with specific people** section and then select **Make changes to events** in the permissions dropdown and select **Send**.\n1. While still in Settings, scroll down and copy the **Calendar ID** in the **Integrate Calendar** section.\n\n#### Add Service Account and Calendar ID to Fulfillment\n1. Go to the `index.js` file in [Dialogflow's Fulfillment section](https://console.dialogflow.com/api-client/#/agent//fulfillment)\n1. Take the **Calendar ID** copied from the prior section and replace `\u003cINSERT CALENDAR ID HERE\u003e` on line 24 of `index.js`.\n```js\n// Ex:\nconst calendarId = '6ujc6j6rgfk02cp02vg6h38cs0@group.calendar.google.com';\n```\n1. Next copy the contents of the JSON file downloaded in the \"Service Account Setup\" section and paste it into the empty object on line 25 of `index.js` `const serviceAccount = {}`.\n```js\n//Ex:\n    const serviceAccount = {\n      \"type\": \"service_account\",\n      \"project_id\": \"bikesample\",\n    ...\n  };\n```\n1. Click **Deploy** at at the bottom of the page.\n\n#### [OPTIONAL] Add Bike Shop FAQ Knowledge Connector\n1. Go to `bike-shop-faq.csv` in this repo \u003e  Raw \u003e Copy the contents to a file on your computer.\n1. In Dialogflow's console go to **Settings (⚙) \u003e General** tab **\u003e Enable Beta Features and APIs \u003e Save**.\n1. Go to the **Knowledge** tab in the left menu \u003e **Create Knowledge Base**.  \n    + Name the knowledge base `Bike Shop` then **Save**\n1. Next, click **Create the first one**.\n    + Use `Bike Shop FAQ` for document name,\n    + `text/csv` for the \"Mime Type\",\n    + `FAQ` for the \"Knowledge type\",\n    + Under \"Data source\" \u003e select `Upload file from computer` to upload `bike-shop-faq.csv`\u003e **Create**.\n1. In the response section \u003e click **Add Response**. In text response you should see `$Knowledge.Answer[1]` \u003e **Save**.\n1. Try it out! In the simulator on the right enter `do you sell ebikes?`. You should see the exact response from the CSV you just uploaded: \"We sell Electric bikes. We also can outfit your existing bike with a retrofit Bionx electric wheel kit. We do not do gas powered conversions.\"\n\n## Running the sample\n1. In [Dialogflow's console](https://console.dialogflow.com), in the simulator on the right, query your Dialogflow agent with `My bike is broken` and respond to the questions your Dialogflow agent asks.   After getting the required information, an appointment will be added to the \"Bike Shop Calendar\" calendar.\n\n## How to make contributions?\nPlease read and follow the steps in the CONTRIBUTING.md.\n\n## License\nSee [LICENSE](LICENSE).\n\n## Terms\nYour use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the [Google APIs Terms of Service](https://developers.google.com/terms/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdialogflow%2Ffulfillment-bike-shop-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdialogflow%2Ffulfillment-bike-shop-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdialogflow%2Ffulfillment-bike-shop-nodejs/lists"}