Skip to content

JackyYin/Stride-Bot

Repository files navigation

Hello World Bot for Stride API

This tutorial will teach you the basics of developing apps for Stride using Node.js by looking at an introductory hello world app.

Follow instructions on this page to build a simple Stride app.

Remix this project

Remix on Glitch

View Code

Create an app

The app you will build in this tutorial contains a simple bot that responds to direct messages or mentions of its bot name. To work with the Stride API you will need to create a app at developer.atlassian.com.

To create your first Stride app:

  1. Open the Create an App page.
  2. Give your new app a name in the App name field.
  3. If desired, add a short description in the Description field.
  4. Click Create; you'll be directed to your app's dashboard page.
  5. Click Enable API for the Stride API.
  6. Use the Copy button on the Enabled APIs tab to copy the Client Id and the Client Secret for use below as the {clientId} and {clientSecret}.
  7. In your glitch app put your client ID and client secret in the .env file. You can safely store app secrets in .env (nobody can see this but you and people you invite)

Link the app descriptor

The app descriptor for the hello world for stride app is hosted at /descriptor. You have to link it to your app in the app configuration page where you created your app earlier.

To link the app descriptor to your app:

  1. Navigate to your My Apps page.
  2. Click to open the app and then click the Install tab.
  3. Enter your app descriptor URL, https://{{glitch_project_name}}.glitch.me/descriptor, in the Descriptor URL field.
  4. Click Refresh. When the app descriptor is installed you will see a The descriptor has been updated successfully! message displayed.

Install the app

Now your app is created and configured, and your app descriptor is linked, and you can add the app to a conversation:

Install the app through the user interface

  1. In your app dashboard, in the Install tab, click Copy for the Installation URL.
  2. Open Stride.
  3. Open the conversation in which you'd like to install the app.
  4. Click apps_icon to open the Apps sidebar, and then click the + button to open the Atlassian Marketplace in Stride.
  5. Click Connect your app in the Connect your own app box, and then select the Installation URL tab.
  6. Paste in the Installation URL. Your app information should appear in the window.
  7. Click Agree.

In a few seconds, your newly-installed app should appear in the Apps sidebar, and the app should send a message to the conversation.

Test the app

Your app is ready to roll, so let's see it in action.

When the bot is installed it will give you a simple menu for possible actions:

Stride API Hello World Menu

@ mention or direct message this bot with one of these commands:

  • 1 - Hello World
  • 2 - Sending Markdown
  • 3 - Mentioning Users
  • 4 - Application Cards
  • help - Show this help menu

Inspect all the messages in Stride with the Developer Toolkit.

Next steps

  • Take a look at the files in the skills folder. Each one corresponds to a menu option.
  • Change things up. Try changing the messages sent by the app!
  • Inspect the messages using the Developer Toolkit
  • Read through our Learning section, which has more tutorials and explains different concepts including sites and users, conversations, messages, bots, and more.
  • Take a look at our fully featured Reference App. The reference app has quite a bit more functionality built in, and is really a showcase of what you can do with the API in Stride.

Explore our other glitch projects

Stride on Glitch

<iframe src="https://glitch.com/stride" style="width:100%; height:600px"></iframe>

emoji's provided by twemoji

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors