ServiceNow

The smarter way to workflow

Integrate the ServiceNow API with the Telegram Bot API

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

Create Table Record with ServiceNow API on Channel Updates (Instant) from Telegram Bot API
Telegram Bot + ServiceNow
 
Try it
Create Table Record with ServiceNow API on Message Updates (Instant) from Telegram Bot API
Telegram Bot + ServiceNow
 
Try it
Create Table Record with ServiceNow API on New Bot Command Received (Instant) from Telegram Bot API
Telegram Bot + ServiceNow
 
Try it
Create Table Record with ServiceNow API on New Updates (Instant) from Telegram Bot API
Telegram Bot + ServiceNow
 
Try it
Get Table Record By SysId with ServiceNow API on Channel Updates (Instant) from Telegram Bot API
Telegram Bot + ServiceNow
 
Try it
New Bot Command Received (Instant) from the Telegram Bot API

Emit new event each time a Telegram Bot command is received.

 
Try it
New Channel Updates (Instant) from the Telegram Bot API

Emit new event each time a channel post is created or updated.

 
Try it
New Message Updates (Instant) from the Telegram Bot API

Emit new event each time a Telegram message is created or updated.

 
Try it
New Updates (Instant) from the Telegram Bot API

Emit new event for each new Telegram event.

 
Try it
Create Table Record with the ServiceNow API

Inserts one record in the specified table.

 
Try it
Create Chat Invite Link with the Telegram Bot API

Create an additional invite link for a chat, See the docs for more information

 
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
Delete a Message with the Telegram Bot API

Deletes a message. See the docs for more information

 
Try it
Get Table Records with the ServiceNow API

Retrieves multiple records for the specified table.

 
Try it

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}`,
      },
    })
  },
})

Overview of Telegram Bot

With the Telegram Bot API, you can build bots that perform a variety of tasks,
including:

  • Sending and receiving messages
  • Social networking
  • Content management
  • File sharing
  • Location sharing
  • Bot administration
  • And more!

Connect Telegram Bot

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    telegram_bot_api: {
      type: "app",
      app: "telegram_bot_api",
    }
  },
  async run({steps, $}) {
    return await axios($, {
      url: `https://api.telegram.org/bot${this.telegram_bot_api.$auth.token}/getMe`,
    })
  },
})