import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
twake: {
type: "app",
app: "twake",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://web.twake.app/api/console/v1/me`,
headers: {
Authorization: `Bearer ${this.twake.$auth.oauth_access_token}`,
"content-type": `application/json`,
},
})
},
})
Twake uses OAuth authentication. When you connect your Twake account, Pipedream will open a popup window where you can sign into Twake and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Twake API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://web.twake.app/api/console/v1/login
accept: application/json
id={{custom_fields.app_id}}
&
secret={{custom_fields.app_secret}}
POST
https://web.twake.app/api/console/v1/login
accept: application/json
id={{custom_fields.app_id}}
&
secret={{custom_fields.app_secret}}