import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
azure_api_for_fhir: {
type: "app",
app: "azure_api_for_fhir",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://${this.azure_api_for_fhir.$auth.account_name}.azurehealthcareapis.com/Patient`,
headers: {
Authorization: `Bearer ${this.azure_api_for_fhir.$auth.oauth_access_token}`,
},
})
},
})
Azure API for FHIR uses OAuth authentication. When you connect your Azure API for FHIR account, Pipedream will open a popup window where you can sign into Azure API for FHIR and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Azure API for FHIR API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://login.microsoftonline.com/{{custom_fields.tenant_id}}/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
&
resource=https://{{custom_fields.account_name}}.azurehealthcareapis.com
POST
https://login.microsoftonline.com/{{custom_fields.tenant_id}}/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
&
resource=https://{{custom_fields.account_name}}.azurehealthcareapis.com