Welcome to api2teams
The api2teams
and its generated project template is currently under active development. Report any issues to us here
api2teams
is a command line tool to generate a complete conversational style command and response Teams application based on your Open API specification file and represent the API response in the form of Adaptive Cards.
api2teams
is the best way to start integrating your APIs with Teams conversational experience.
Prerequisite
Before running this CLI and deploying your generated Teams App to Azure or your local development machine, please ensure that you have the following prerequisites in place:
Quick start
- Install
api2teams
with npm: npm install @microsoft/api2teams@latest -g
- Prepare the Open API specification. If you don't currently have one, start with a sample we provided by saving a copy of the sample-open-api-spec.yml to your local disk.
- Convert the Open API spec to a Teams app, assuming you are using the
sample-open-api-spec.yml
: api2teams sample-open-api-spec.yml
Available commands and options
The CLI name is api2teams
. Usage is as below:
Usage: api2teams [options] <yaml>
Convert open api spec file to Teams APP project, only for GET operation
Arguments:
yaml yaml file path to convert
Options:
-o, --output [string] output folder for teams app (default: "./generated-teams-app")
-f, --force force overwrite the output folder
-v, --version output the current version
-h, --help display help for command
You can input below command to generate Teams App to default or specific folder:
api2teams sample-open-api-spec.yml
api2teams sample-open-api-spec.yml -o ./my-app
api2teams sample-open-api-spec.yml -o ./my-app -f
api2teams -h
api2teams -v
Getting started with the generated Teams app
-
Open the generated project in Visual Studio Code and make sure you have the latest Teams Toolkit (version 5.0.0 or higher) installed.
-
Follow the instruction provided in the README.md
for the generated project to get started. After installing the Teams app generated from the provided OpenAPI spec, you will receive a welcome message.
-
You can then run a GET /pets/1
command in Teams to receive an Adaptive Card response from the bot.
Current limitations
- The
api2teams
doesn't support Open API schema version < 3.0.0. - The
api2teams
doesn't support Authorization property in Open API specification. - The
api2teams
doesn't support webhooks
property and it would be ignored during convert. - The
api2teams
doesn't support oneOf
, anyOf
, not
keyword (It only support allOf
keyword currently). - The
api2teams
doesn't support POST
, PUT
, PATCH
or DELETE
operations (It only supports GET
operation currently). - The generated Adaptive Card doesn't support array type.
- The generated Adaptive Card doesn't support file upload.
- The generated Teams app can only contain up to 10 items in the command menu.
Further reading