ServiceNow

The smarter way to workflow

Go to site
Explore
/
Apps
/
ServiceNow

ServiceNow API Integrations

Build and run workflows using the ServiceNow API. Use 1000s of source-available triggers and actions across 2,000+ apps. Or write custom code to integrate any app or API in seconds.

Overview

The ServiceNow API enables developers to tap into the robust capabilities of ServiceNow's IT service management platform. With the API, you can create, read, update, and delete records, manage workflows, and integrate with other services. By leveraging these capabilities, you can automate routine tasks, sync data across multiple platforms, and enhance operational efficiencies.

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

Choose an API to Connect with ServiceNow API

1
-
24
of
2,000+
apps by most popular

HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
Node
Node
Anything you can do with Node.js, you can do in a Pipedream workflow. This includes using most of npm's 400,000+ packages.
Python
Python
Anything you can do in Python can be done in a Pipedream Workflow. This includes using any of the 350,000+ PyPi packages available in your Python powered workflows.
OpenAI (ChatGPT)
OpenAI (ChatGPT)
OpenAI is an AI research and deployment company with the mission to ensure that artificial general intelligence benefits all of humanity. They are the makers of popular models like ChatGPT, DALL-E, and Whisper.
Salesforce (REST API)
Salesforce (REST API)
Web services API for interacting with Salesforce
HubSpot
HubSpot
HubSpot's CRM platform contains the marketing, sales, service, operations, and website-building software you need to grow your business.
Zoho CRM
Zoho CRM
Zoho CRM is an online Sales CRM software that manages your sales, marketing, and support in one CRM platform.
Stripe
Stripe
Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes.
Shopify Developer App
Shopify Developer App
Shopify is a user-friendly e-commerce platform that helps small businesses build an online store and sell online through one streamlined dashboard.
WooCommerce
WooCommerce
WooCommerce is the open-source ecommerce platform for WordPress.
Snowflake
Snowflake
A data warehouse built for the cloud
MongoDB
MongoDB
MongoDB is an open source NoSQL database management program.
Supabase
Supabase
Supabase is an open source Firebase alternative.
MySQL
MySQL
MySQL is an open-source relational database management system.
PostgreSQL
PostgreSQL
PostgreSQL is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
AWS
AWS
Amazon Web Services (AWS) offers reliable, scalable, and inexpensive cloud computing services.
Twilio SendGrid
Twilio SendGrid
Send marketing and transactional email through the Twilio SendGrid platform with the Email API, proprietary mail transfer agent, and infrastructure for scalable delivery.
Amazon SES
Amazon SES
Amazon SES is a cloud-based email service provider that can integrate into any application for high volume email automation
Klaviyo
Klaviyo
Email Marketing and SMS Marketing Platform
Zendesk
Zendesk
Zendesk is award-winning customer service software trusted by 200K+ customers. Make customers happy via text, mobile, phone, email, live chat, social media.
ServiceNow
ServiceNow
The smarter way to workflow
Notion
Notion
Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team.
Slack
Slack
Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.
Microsoft Teams
Microsoft Teams
Microsoft Teams has communities, events, chats, channels, meetings, storage, tasks, and calendars in one place.

Example Use Cases

  • Incident Management Automation: Automatically create incidents in ServiceNow when critical alerts are triggered in monitoring tools like Datadog or New Relic. This ensures timely attention to potential issues and streamlines the incident response process.

  • HR Onboarding Workflow: When a new employee is added to an HR system like Workday, trigger a workflow in Pipedream that creates a new user account in ServiceNow, assigns the necessary roles, and initiates onboarding tasks. This can significantly cut the time needed to get a new team member up and running.

  • Customer Support Ticket Sync: Synchronize customer support tickets between ServiceNow and a CRM platform like Salesforce. When a ticket is updated in ServiceNow, automatically reflect those changes in Salesforce to keep all teams aligned and informed about customer issues, ensuring a unified approach to customer service.

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.

Additional Guidance For Hardened or Mature Instances

The instructions above are likely to work on a fresh, out-of-the-box instance but may work imperfectly on ServiceNow instances that have been customized or have applied various security hardening recommendations such as the explicit roles plugin.

Symptoms of problems here may include getting a 504 Gateway Time-out error when completing step 6 above. If you manually test the connection deatails in a tool like Postman, you may get an error like this:

{
  "error_description":"access_denied",
  "error":"server_error"
}

In these instances, the following tips may be helpful:

  • Create a dedicated role for this purpose, and assign it to a service account that is only used for this purpose. You should not set it for web service access only, since interactive access is required to complete Pipedream setup.
  • Ensure that the dedicated role has ACLs configured to allow read for the oauth_credential table - both the table and table.* for all fields.
  • Assign snc_internal to this service account. This is important if you are using the explicit roles plugin as part of instance security hardening.

Finally, while not required, you should also check that the role has associated ACLs for any tables you want to work with; by default they may if you use snc_internal, but some fields extended from task or other tables may require additional ACLs based on your instance's configuration.

Create Table Record with ServiceNow API on New Pull Request (Instant) from BitBucket API
BitBucket + ServiceNow
 
Try it
Get Table Record By SysId with ServiceNow API on New Incoming SMS from Bandwidth API
Bandwidth + ServiceNow
 
Try it
Get Table Records with ServiceNow API on New Tweet in List from Twitter API
X (Twitter) + ServiceNow
 
Try it
Get Table Records with ServiceNow API on New Bot Command Received (Instant) from Telegram Bot API
Telegram Bot + ServiceNow
 
Try it
Get Table Records with ServiceNow API on New Requests from HTTP / Webhook API
HTTP / Webhook + ServiceNow
 
Try it
Create Table Record with the ServiceNow API

Inserts one record in the specified table.

 
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
Get Table Records with the ServiceNow API

Retrieves multiple records for the specified table.

 
Try it
Update Table Record with the ServiceNow API

Updates the specified record with the name-value pairs included in the request body.

 
Try it

Troubleshooting

If you're getting a 504 Gateway Time-out error when attempting to connect your ServiceNow account, review the section above on "Additional Guidance For Hardened or Mature Instances".

Authentication

ServiceNow uses OAuth authentication. When you connect your ServiceNow account, Pipedream will open a popup window where you can sign into ServiceNow and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any ServiceNow API.

Pipedream requests the following authorization scopes when you connect your account:

OAuth Request Configurations:
  1. authorization
    GEThttps://{{custom_fields.instance_name}}.service-now.com/oauth_auth.do?client_id={{custom_fields.client_id}}&redirect_uri={{oauth.redirect_uri}}&state={{oauth.state}}&response_type=code
  2. accessToken
    POSThttps://{{custom_fields.instance_name}}.service-now.com/oauth_token.docontent-type: application/x-www-form-urlencodedaccept: application/json
    client_id={{custom_fields.client_id}}&client_secret={{custom_fields.client_secret}}&redirect_uri={{oauth.redirect_uri}}&grant_type=authorization_code&code={{oauth.code}}
  3. refreshToken
    POSThttps://{{custom_fields.instance_name}}.service-now.com/oauth_token.docontent-type: application/x-www-form-urlencodedaccept: application/json
    client_id={{custom_fields.client_id}}&client_secret={{custom_fields.client_secret}}&grant_type=refresh_token&refresh_token={{oauth.refresh_token}}