import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
are_na: {
type: "app",
app: "are_na",
}
},
async run({steps, $}) {
return await axios($, {
url: `http://api.are.na/v2/search/users`,
headers: {
Authorization: `Bearer ${this.are_na.$auth.oauth_access_token}`,
},
params: {
"q": `John Smith`,
},
})
},
})
Are.na uses OAuth authentication. When you connect your Are.na account, Pipedream will open a popup window where you can sign into Are.na and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Are.na API.
Pipedream requests the following authorization scopes when you connect your account:
GET
http://dev.are.na/oauth/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
response_type=code
POST
https://dev.are.na/oauth/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}