Authenticate with ServiceNow

You can authenticate with ServiceNow to create your own instance of the ServiceNow element through the UI or through APIs. Once authenticated, you can use the element instance to access the different functionality offered by the ServiceNow platform.

Authenticate Through the UI

Use the UI to authenticate with ServiceNow and create an element instance. ServiceNow authentication follows a basic authentication framework. You will need your username and password along with the subdomain of your ServiceNow account.

If you are configuring events, see the Events section.

To authenticate an element instance:

  1. Sign in to Cloud Elements, and then search for ServiceNow in our Elements Catalog. Search
  2. Hover over the element card, and then click Authenticate. Create Instance
  3. Enter a name for the element instance.
  4. In The ServiceNow Subdomain enter your subdomain or entire URL. The subdomain is the part of your URL that is specific to your organization, for example in https://domain12345.service-now.com/ domain12345 is the subdomain.
  5. In Username and Password, enter the credentials that you use to log in to ServiceNow.
  6. Optionally type or select one or more Element Instance Tags to add to the authenticated element instance.
  7. Click Create Instance.
  8. Provide your ServiceNow credentials, and then allow the connection.

After successfully authenticating, we give you several options for next steps. Make requests using the API docs associated with the instance, map the instance to a virtual data resource, or use it in a formula template.

Authenticate Through API

Use the /instances endpoint to authenticate with ServiceNow and create an element instance. If you are configuring events, see the Events section.

To create an element instance:

  1. Construct a JSON body as shown below (see Parameters):

    {
      "element": {
        "key": "servicenow"
      },
      "configuration": {
        "username": "<USERNAME>",
        "password": "<PASSWORD>",
        "servicenow.subdomain": "<SUBDOMAIN>",
        "filter.response.nulls": true
      },
      "tags": [
        "<Add_Your_Tag>"
      ],
      "name": "<INSTANCE_NAME>"
    }
    
  2. Call the following, including the JSON body you constructed in the previous step:

    POST /instances
    
  3. Locate the token and id in the response and save them for all future requests using the element instance.

Example cURL


curl -X POST  \
 -H 'Authorization: User <INSERT>, Organization <INSERT>'  \
 -H 'Content-Type: application/json'  \
 --data '{ \
  "name": "My_ServiceNow", \
  "configuration": { \
    "filter.response.nulls": "true", \
    "username": "username", \
    "password": "******", \
    "servicenow.subdomain": "dev12345" \
  } \
}'  \
'https://api.cloud-elements.com/elements/api-v2/elements/145/instances'

Parameters

API parameters not shown in Cloud Elements are in code formatting.

Parameter Description Data Type
key The element key.
servicenow
string
Name
name
The name for the element instance created during authentication. string
Username
username
Your ServiceNow user name.
Password
password
Your ServiceNow password. string
The ServiceNow Subdomain
servicenow.subdomain
This is the part of your URL that is specific to your organization, for example in https://domain12345.service-now.com/ domain12345 is the subdomain string
Filter null values from the response
filter.response.nulls
Optional. Determines if null values in the response JSON should be filtered from the response. Yes or true indicates that Cloud Elements will filter null values.
Default: true.
boolean
tags Optional. User-defined tags to further identify the instance. string

Example Response

{
  "id": 427251,
  "name": "My_ServiceNow",
  "createdDate": "2017-06-06T22:26:22Z",
  "token": "kt6uJ77QG1iCIZNgRvl/BcpJL/JS94sBwwQdicNRZ5s=",
  "element": {
    "id": 145,
    "name": "ServiceNow",
    "hookName": "ServiceNow",
    "key": "servicenow",
    "description": "ServiceNow is changing the way people work, offering service management for every department in the enterprise including IT, human resources, facilities & more.",
    "image": "https://pbs.twimg.com/profile_images/378800000041139697/cf1e6299ecb533ed82725abe96bb96a9_400x400.png",
    "active": true,
    "deleted": false,
    "typeOauth": false,
    "trialAccount": false,
    "resources": [],
    "transformationsEnabled": true,
    "bulkDownloadEnabled": true,
    "bulkUploadEnabled": true,
    "cloneable": true,
    "extendable": true,
    "beta": false,
    "authentication": {
      "type": "basic"
    },
    "extended": false,
    "hub": "helpdesk",
    "protocolType": "http",
    "parameters": [
      {
        "id": 11,
        "createdDate": "2015-04-26T16:11:49Z",
        "name": "servicenow.subdomain",
        "vendorName": "subdomain",
        "type": "configuration",
        "vendorType": "path",
        "source": "request",
        "elementId": 145,
        "required": false
      }
    ],
    "private": false
  },
  "elementId": 145,
  "provisionInteractions": [],
  "valid": true,
  "disabled": false,
  "maxCacheSize": 0,
  "cacheTimeToLive": 0,
  "configuration": {
    "base.url": "https://{subdomain}.service-now.com/api/now/v1/table",
    "bulk.add_metadata": "false",
    "event.notification.subscription.id": null,
    "bulk.query.field_name": "sys_updated_on",
    "pagination.max": "200",
    "servicenow.subdomain": "subdomain123",
    "event.vendor.type": "polling",
    "bulk.query.operator": ">=",
    "filter.response.nulls": "true",
    "bulk.query.date_mask": "yyyy/MM/dd HH:mm:ss",
    "bulk.attribute.created_time": "sys_created_on",
    "bulk.query.download_format": "json",
    "password": "********",
    "bulk.relations": "{}",
    "pagination.type": "offset",
    "event.poller.refresh_interval": "15",
    "event.notification.callback.url": null,
    "event.notification.signature.key": null,
    "event.poller.configuration": "{}",
    "username": "username",
    "event.notification.enabled": "false"
  },
  "eventsEnabled": false,
  "traceLoggingEnabled": false,
  "cachingEnabled": false,
  "externalAuthentication": "none",
  "user": {
    "id": 1234567
  }
}