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:
No matter whether you are looking to extend existing features or build something totally new, the ServiceNow API offers the perfect solution!
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}`,
},
})
},
})
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:
GET
https://{{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
POST
https://{{custom_fields.instance_name}}.service-now.com/oauth_token.do
content-type: application/x-www-form-urlencoded
accept: 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}}
POST
https://{{custom_fields.instance_name}}.service-now.com/oauth_token.do
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}