import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
botx: {
type: "app",
app: "botx",
}
},
async run({steps, $}) {
const data = {
"Action": "Execute",
"UserSays": "[{\"DCSField\":\"Could you be my assistant today?\"}]"
}
return await axios($, {
method: "post",
url: `https://api.botx.cloud/CognitiveDiagram/${this.botx.$auth.cognitive_diagram_id}/Execute`,
headers: {
Authorization: `Bearer ${this.botx.$auth.oauth_access_token}`,
"Content-Type": "application/json"
},
data,
})
},
})
BotX uses OAuth authentication. When you connect your BotX account, Pipedream will open a popup window where you can sign into BotX and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any BotX API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://api.botx.cloud/token
accept: application/json
Content-Type: application/json
Email={{custom_fields.username}}
&
Password={{custom_fields.password}}
POST
https://api.botx.cloud/token
accept: application/json
Email={{custom_fields.username}}
&
Password={{custom_fields.password}}