The smarter way to workflow
Emit new event each time a Telegram Bot command is received.
Emit new event each time a channel post is created or updated.
Emit new event each time a Telegram message is created or updated.
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!
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.
https://api.pipedream.com/connect/oauth/oa_g2oiqA/callback
. Your app should look something like this: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:dev98042
in https://dev98042.service-now.com/
.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.
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.
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}`,
},
})
},
})
With the Telegram Bot API, you can build bots that perform a variety of tasks,
including:
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`,
})
},
})