Discord Bot

Use this app to interact with the Discord API using a bot in your account

Integrate the Discord Bot API with the ServiceNow API

Setup the Discord Bot API trigger to run a workflow which integrates with the ServiceNow API. Pipedream's integration platform allows you to integrate Discord Bot and ServiceNow remarkably fast. Free for developers.

Create Table Record with ServiceNow API on New Message in Channel from Discord Bot API
Discord Bot + ServiceNow
 
Try it
Get Table Record By SysId with ServiceNow API on New Message in Channel from Discord Bot API
Discord Bot + ServiceNow
 
Try it
Get Table Records with ServiceNow API on New Message in Channel from Discord Bot API
Discord Bot + ServiceNow
 
Try it
Update Table Record with ServiceNow API on New Message in Channel from Discord Bot API
Discord Bot + ServiceNow
 
Try it
Create Table Record with ServiceNow API on New Forum Thread Message from Discord Bot API
Discord Bot + ServiceNow
 
Try it
New Message in Channel from the Discord Bot API

Emit new event for each message posted to one or more channels

 
Try it
New Forum Thread Message from the Discord Bot API

Emit new event for each forum thread message posted. Note that your bot must have the MESSAGE_CONTENT privilege intent to see the message content, see the docs here.

 
Try it
New Guild Member from the Discord Bot API

Emit new event for every member added to a guild. See docs here

 
Try it
New Thread Message from the Discord Bot API

Emit new event for each thread message posted.

 
Try it
Create Table Record with the ServiceNow API

Inserts one record in the specified table.

 
Try it
Add Role with the Discord Bot API

Assign a role to a user. Remember that your bot requires the MANAGE_ROLES permission. See the docs here

 
Try it
Get Table Record By SysId with the ServiceNow API

Retrieves the record identified by the specified sys_id from the specified table.

 
Try it
Change Nickname with the Discord Bot API

Modifies the nickname of the current user in a guild.

 
Try it
Get Table Records with the ServiceNow API

Retrieves multiple records for the specified table.

 
Try it

Overview of Discord Bot

The Pipedream Discord app enables you to build event-driven workflows that interact with the Discord API. When you authorize the Pipedream app's access to your guilds, you can use Pipedream workflows to perform common Discord actions, or write your own code against the Discord API.

Connect Discord Bot

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    discord_bot: {
      type: "app",
      app: "discord_bot",
    }
  },
  async run({steps, $}) {
    return await axios($, {
      url: `https://discord.com/api/users/@me`,
      headers: {
        "Authorization": `Bot ${this.discord_bot.$auth.bot_token}`,
      },
    })
  },
})

Overview of ServiceNow

Using the ServiceNow API, you can build a variety of powerful applications that
help you extend and enhance the capabilities of your ServiceNow implementation.
The possibilities are endless! You can:

  • Create custom pages and widgets that provide additional functionality and
    data visualizations tailored to your needs
  • Automate user and business processes with the help of integration tools
  • Streamline production deployments and drive up efficiency with workflow
    systems
  • Develop custom plugins to facilitate data exchange with other systems
  • Leverage machine learning to extract knowledge from large data sets and
    create predictive models
  • Create interactive chatbots for providing support or collecting feedback
  • Generate custom reports for tracking performance and resource utilization
  • And much more!

No matter whether you are looking to extend existing features or build
something totally new, the ServiceNow API offers the perfect solution!

Getting Started

Before you can use the ServiceNow REST API from a workflow, you need to configure an OAuth app in your ServiceNow instance that will grant access tokens to your users and authenticate requests to its REST API.

  1. In your ServiceNow instance, visit the Application Registry and create a new app, choosing the Create an OAuth API endpoint for external clients option.
  2. Name it something memorable, then leave every other field blank or keep the defaults, except for the Redirect URL, which should be: https://api.pipedream.com/connect/oauth/oa_g2oiqA/callback. Your app should look something like this:
ServiceNow OAuth app config
  1. Next, you'll need to copy the client ID and secret generated in Step 2, and add another app. This time, select the option to Connect to a third party OAuth Provider.
  2. Name this app something like Pipedream OAuth Validator, and add the client ID / secret from Step 2. Change the grant type to Authorization Code, and set the Token URL to oauth_token.do (without any hostname, this refers to the current instance). Finally, add the same Redirect URL as you did above: https://api.pipedream.com/connect/oauth/oa_g2oiqA/callback. This app's configuration should look something like this when complete:
ServiceNow OAuth validator app config
  1. Visit https://pipedream.com/accounts, and click the button labeled Click Here to Connect An App in the top-right. In the modal that appears, search for ServiceNow and select it. You'll be prompted to enter the client ID and client secret from Step 2 above, as well as the name of your instance. The instance name is the host portion of your instance's URL: that is, the dev98042 in https://dev98042.service-now.com/.
Pipedream app config
  1. Press Connect in the bottom-right of the modal. This should open up a new window asking you to login to your ServiceNow instance. This authorizes Pipedream's access to your ServiceNow account, and you should be ready to connect to your instance's REST API!

Collectively, the two apps you configured in your ServiceNow instance allow your instance to issue new OAuth access tokens for the user who authenticated in Step 6. This allows Pipedream to retrieve a fresh access token before it makes requests to the ServiceNow REST API.

ServiceNow Authorization Reference

This ServiceNow doc describes the general flow we ask you to implement above. In that doc, the app you create in Step 2 is referred to as the client application, and the app in Step 4 is referred to as the OAuth provider application registry record.

Connect ServiceNow

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    servicenow: {
      type: "app",
      app: "servicenow",
    }
  },
  async run({steps, $}) {
    return await axios($, {
      url: `https://${this.servicenow.$auth.instance_name}.service-now.com/api/now/table/incident`,
      headers: {
        Authorization: `Bearer ${this.servicenow.$auth.oauth_access_token}`,
      },
    })
  },
})