Skip to main content

A sample custom connector for ServiceNow using OAuth authentication

Headshot of article author Vasavi Bhaviri Setty

ServiceNow is commonly used by organizations to improves service levels, energizes employees, and enable enterprises to work at light speed. The public ServiceNow connector supports basic authentication. However, if you have a use case to support OAuth authentication, you will need to build a custom connector leveraging ServiceNow APIs. To simplify the process of building a custom connector, we have put together a sample custom connector for ServiceNow that provides OAuth authentication and support for attachments.

You can find the source code for the sample custom connector on GitHub. The sample custom connector supports OAuth authentication, attachments, and CRUD (Create, Read, Update, Delete) operations on an example entity: Incident.

Following are the supported operations of the connector:

  • List Incidents: Retrieves a list of incidents
  • Get Incident: Retrieves the specified incident record using the provided Id parameter
  • Create Incident: Creates a new incident
  • Update Incident: Updates a specified incident record
  • Delete Incident: Deletes a specified incident record
  • Upload Attachment: Uploads a specified binary file as an attachment to the specified record.
  • List Attachments: Returns the metadata for multiple attachments
  • Get Attachment: Returns the metadata of the attachment
  • Get Attachment File: Returns the binary file attachment for the specified record

The connector source code is open sourced, and instructions are provided to download and deploy the custom connector in your choice of environment. Once deployed, you can add CRUD operations for any additional entities of interest and use this connector from Power Apps or Power Automate.

We’ve provided a sample Power Apps canvas application and Power Automate flow that show how to use the custom connector. The customer connector readme file contains the instructions to download and use the app and flow.