Site iconAxway Blog

Amplify Central custom API subscription approval flow – CRM contact check flow using API Builder

In a previous blog post, we described how to use Integration Builder to create an Amplify Central custom API Subscription approval flow that checks to see if the subscriber exists in Salesforce, based on the subscriber’s email address. If so, we approve the request. If not, we send a notification to Teams as follows:

MS Teams Notification Example

Then the approval team can add the user to Salesforce which will cause the request to be approved or they can manually reject the request in Central.

An additional feature in the flow is that if the subscriber’s email is in a whitelist that you define, then the subscription is automatically approved. This is useful for allowing employees and partners to be automatically approved.

Now, we’ll do the same flow but we’ll use API Builder. This will give you more flexibility in choosing which Amplify product suits your needs better.

API Builder project

There are two flows in the project:

API Builder Main Approval Flow
API Builder Subscriptions Checker Flow

Here are the major aspects of the flows:

The following Environment variables are used in the project:

You can read about creating an Amplify Service Account and retrieving your client id and secret here.

You can read about Salesforce REST APIs and how to create a connected app here. In addition, you need to modify two OAuth Policies from their default state: Permitted Users and IP Relaxation.

To use this API Builder project simply setup your Salesforce connected account and Amplify service account and collect all the environment variables and run the API Builder project. It will check the requested API subscriptions based on the timer interval. Set the timer properly to avoid spamming MS Teams with the same subscription notifications. For example, add the environment variables to the /conf/.env file and run the project using npm start

The API Builder project can be downloaded here.

Summary

In this Amplify Central custom API Subscription Flow example we saw how API Builder enables a robust subscription flow that integrates with your CRM based business processes for customers and prospects and also enables you to automatically approve employee and partner subscription requests via a whitelist.

Need help with API Builder? Extend your skills with Axway University.

Exit mobile version