Skip to content

Latest commit

 

History

History

nodejs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
page_type description products languages extensions urlFragment
sample
Sample code for a generic connector that's easy to customize for any system which supports webhooks.
office-teams
office
office-365
nodejs
contentType createdDate
samples
07-07-2021 13:38:26
officedev-microsoft-teams-samples-connector-generic-nodejs

Sample Connector

This contains the source for a generic connector that's easy to customize for any system which supports webhooks.

Prerequisites

To complete this tutorial, you need the following tools. If you don't already have them you can install them from these links.

Configure your own connector

  1. Start the tunnelling service to get an https endpoint.
    1. Open a new command prompt window.
    2. Change to the directory that contains the ngrok.exe application.
    3. In the command prompt, run the command ngrok http 3978 --host-header=localhost.
    4. Ngrok will fill the entire prompt window. Make note of the https:// Forwarding URL. This URL will be your [BASE_URI] referenced below.
    5. Minimize the ngrok Command Prompt window. It is no longer referenced in these instructions, but it must remain running.
  2. Register a new connector
    1. Open Connector Developer Portal and select New Connector.
    2. Fill in all the basic details such as name, logo, descriptions etc. for the new connector.
    3. For the configuration page, you'll use our sample code's setup endpoint: https://[BASE_URI]/connector/setup
    4. For Valid domains, make enter your domain's http or https URL, e.g. XXXXXXXX.ngrok.io.
    5. Click on Save. After the save completes, you will see your connector ID in address bar.
  3. In the ~/views/connectorconfig.jade file line 27 and replace ngrokURL to the ngrok https forwarding url from the above.
  4. Install all the dependencies by running npm install in root directory.
  5. Run the sample: node server.js
  6. Manifest updates:
    1. Replace ConnectorId field in ~/app manifest/manifest.json file with your newly registered connector ID.
    2. Select all three files (manifest.json, outline_icon.png, color_icon.png) and create a zip file. This is your Teams App Manifest package.
  7. Now you can upload your app manifest package in a team and test your new connector by following instructions in config UI.

More Information

For more information about getting started with Teams, please review the following resources:

Contributing

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.