Proxy Actions
A proxy action allows you to make passthrough API calls to the SaaS provider’s API. Ampersand will attach the right authentication headers and also take care of token refreshes when necessary. To define a proxy action, add proxy
as a key in your integration defined in amp.yaml
:
Make API calls
All proxy actions expose an API with the base of https://proxy.withampersand.com
. When making a passthrough call, simply replace the base URL with the Ampersand proxy URL. For example, instead of making a request to https://subdomain.my.salesforce.com/services/data/v56.0/sobjects/Account
, making the same request to https://proxy.withampersand.com/services/data/v56.0/sobjects/Account
.
Please refer to the (Provider Guides)[/provider-guides] for the base URL of each connector.
Keep the request body and HTTP verb the same, and add these additional headers so Ampersand knows how to deliver the API request:
x-amp-proxy-version
: this should always be 1x-amp-project-id
: your Ampersand project ID. You can find it on your project’s General Settings pagex-api-key
: your Ampersand API key, if you don’t have one yet, create one in the Ampersand Dashboard’s API Keys page.
In order for Ampersand to know which SaaS instance to make the API call against, you’ll need to provide either:
x-amp-installation-id
: the installation ID, you’ll get this from the CreateInstallation or ImportInstallation API endpoints, or the InstallIntegration component’s success callback functions.- or both of the following:
x-amp-integration-name
: the integration name that you wrote in theamp.yaml
filex-amp-group-ref
: the ID for the user group that you used in the OAuthConnect or ImportInstallation API endpoints; or the InstallIntegration React component.
If all 3 headers (x-amp-installation-id
, x-amp-integration-name
& x-amp-group-ref
) are provided, then the installation ID is used.
Here is an example API call:
Was this page helpful?