import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
visualping: {
type: "app",
app: "visualping",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://account.api.visualping.io/describe-user`,
headers: {
Authorization: `Bearer ${this.visualping.$auth.oauth_access_token}`,
},
})
},
})
VisualPing uses OAuth authentication. When you connect your VisualPing account, Pipedream will open a popup window where you can sign into VisualPing and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any VisualPing API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://api.visualping.io/v2/token
?
method=PASSWORD
&
email={{custom_fields.email}}
&
password={{custom_fields.password}}
POST
https://api.visualping.io/v2/token
?
method=REFRESH_TOKEN
&
refreshToken={{custom_fields.refresh_token}}
content-type: application/x-www-form-urlencoded
accept: application/json