Use this app to interact with the Discord API using a bot in your account
Emit new event for each message posted to one or more channels
Emit new event for each forum thread message posted. Note that your bot must have the MESSAGE_CONTENT
privilege intent to see the message content, see the docs here.
Emit new event for every member added to a guild. See docs here
The Pipedream Discord app enables you to build event-driven workflows that interact with the Discord API. When you authorize the Pipedream app's access to your guilds, you can use Pipedream workflows to perform common Discord actions, or write your own code against the Discord API.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
discord_bot: {
type: "app",
app: "discord_bot",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://discord.com/api/users/@me`,
headers: {
"Authorization": `Bot ${this.discord_bot.$auth.bot_token}`,
},
})
},
})
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}`,
},
})
},
})