import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
hathr_ai: {
type: "app",
app: "hathr_ai",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.hathr.ai/v1/document/list`,
headers: {
Authorization: `Bearer ${this.hathr_ai.$auth.oauth_access_token}`,
},
})
},
})
Hathr AI uses OAuth authentication. When you connect your Hathr AI account, Pipedream will open a popup window where you can sign into Hathr AI and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Hathr AI API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://hathr.auth-fips.us-gov-west-1.amazoncognito.com/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials
&
scope=hathr/llm
POST
https://hathr.auth-fips.us-gov-west-1.amazoncognito.com/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials
&
scope=hathr/llm