import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
upgrade_chat: {
type: "app",
app: "upgrade_chat",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.upgrade.chat/v1/orders`,
headers: {
Authorization: `Bearer ${this.upgrade_chat.$auth.token}`,
"accept": `application/json`,
},
})
},
})
Upgrade.chat uses OAuth authentication. When you connect your Upgrade.chat account, Pipedream will open a popup window where you can sign into Upgrade.chat and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Upgrade.chat API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://api.upgrade.chat/oauth/token
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials
POST
https://api.upgrade.chat/oauth/token
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials