import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
_1shop_api: {
type: "app",
app: "_1shop_api",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.1shotapi.com/v0/chains`,
headers: {
Authorization: `Bearer ${this._1shop_api.$auth.oauth_access_token}`,
},
})
},
})
1Shot API uses OAuth authentication. When you connect your 1Shot API account, Pipedream will open a popup window where you can sign into 1Shot API and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any 1Shot API API.
Pipedream requests the following authorization scopes when you connect your account:
POSThttps://api.1shotapi.com/v0/tokencontent-type: application/x-www-form-urlencodedaccept: application/jsonclient_id={{custom_fields.client_id}}&client_secret={{custom_fields.client_secret}}&grant_type=client_credentialsPOSThttps://api.1shotapi.com/v0/tokencontent-type: application/x-www-form-urlencodedaccept: application/jsonclient_id={{custom_fields.client_id}}&client_secret={{custom_fields.client_secret}}&grant_type=client_credentials