page_type | description | products | languages | extensions | contentType | createdDate | ||||
---|---|---|---|---|---|---|---|---|---|---|
sample |
Sample code for a generic connector that's easy to customize for any system which supports webhooks. |
|
|
samples |
07-07-2021 13:38:26 |
This contains the source for a generic connector that's easy to customize for any system which supports webhooks.
To complete this tutorial, you need the following tools. If you don't already have them you can install them from these links.
- Git
- Node.js and NPM
- Get any text editor or IDE. You can install and use Visual Studio Code for free.
- An Office 365 account with access to Microsoft Teams, with sideloading enabled.
- If you want to run this code locally, use a tunnelling service. These instructions assume you are using ngrok.
- Start the tunnelling service to get an https endpoint.
- Open a new command prompt window.
- Change to the directory that contains the ngrok.exe application.
- In the command prompt, run the command
ngrok http 3978 --host-header=localhost
. - Ngrok will fill the entire prompt window. Make note of the https:// Forwarding URL. This URL will be your [BASE_URI] referenced below.
- Minimize the ngrok Command Prompt window. It is no longer referenced in these instructions, but it must remain running.
- Register a new connector
- Open Connector Developer Portal and select New Connector.
- Fill in all the basic details such as name, logo, descriptions etc. for the new connector.
- For the configuration page, you'll use our sample code's setup endpoint:
https://[BASE_URI]/connector/setup
- For Valid domains, make enter your domain's http or https URL, e.g. XXXXXXXX.ngrok.io.
- Click on Save. After the save completes, you will see your connector ID in address bar.
- In the
~/views/connectorconfig.jade
file line 27 and replacengrokURL
to the ngrok https forwarding url from the above. - Install all the dependencies by running
npm install
in root directory. - Run the sample:
node server.js
- Manifest updates:
- Replace
ConnectorId
field in~/app manifest/manifest.json
file with your newly registered connector ID. - Select all three files (manifest.json, outline_icon.png, color_icon.png) and create a zip file. This is your Teams App Manifest package.
- Replace
- Now you can upload your app manifest package in a team and test your new connector by following instructions in config UI.
For more information about getting started with Teams, please review the following resources:
- Review Office 365 Connectors
- Review Understanding Teams app capabilities
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.