Flow A is mandatory for all new apps starting 1. Nov 2020.
There are two simple ways the user can initiate the connection between your app and Cloudbeds.
This article will explain the different approaches and how to fully set them up.
A diagram below shows both user flows.
This flow allows the user to connect and disconnect the apps only from Cloudbeds Marketplace. There's no need for you to implement any changes to your app UI.
1. In your Cloudbeds Partner Account, navigate to App Details page and scroll to Connection Settings section. Select the "Use OAuth URL" option.
When a user navigates to your app landing page in Cloudbeds' Marketplace and clicks "Connect App" they will immediately initiate the authorization with your app.
When the user clicks "Approve" and API session is established, "Connect App" button will change to "Login" and redirect to your login page.
2. After the user has authorized the connection you will redirect them to your Login / Register page. Make sure you are able to link the correct auth code to the correct account.

This flow allows you to manage the connection process from your app. Users will have to be logged into your app to initiate the connection process. Cloudbeds Markteplace will redirect the users to your Login/Register page. Users can always disconnect the apps from Cloudbeds.
1. Use our script for "Connect to Cloudbeds" button and implement it into your app's UI. Find the script in App Details page in your Cloudbeds Partner Account.
2. When connection was established hide the Connect to Cloudbeds button or make it clear to the users that there's an active connection, and they can't initiate the connection again.
2.1. If you allow the user to disconnect the apps in your UI, make sure to send us state=disabled in the postAppState call.
2.2 If the user can't disconnect the apps in your UI, make sure you're subscribed to our app state webhook so you're notified when they disconnect the apps in Cloudbeds' myfontdesk.
3. In your Cloudbeds Partner Account, navigate to App Details page and scroll to Connection Settings section. Add your Login/Register page URL and save. When a user navigates to your app landing page in Cloudbeds Marketplace and clicks "Connect App" they will be redirected to your launch URL.
When the user clicks "Approve" and API session is established, "Connect App" button will change to "Login" and redirect to your login page.

"Connect to Cloudbeds" button
We've created a script for a button that can replace OAuth link in your app's UI. We recommend embedding this button instead of building a UI element within your app.
You will find the script in App Details page in your Cloudbeds Partner Account.
Example of the script:
<script src="https://hotels.cloudbeds.com/app_button/clientid"></script>

Always add the URL to your app's login page. After the user has authorized your app (regardless of the flow A or B) the main action button in the Marketplace will change from "Connect App" to "Login". This allows us to send the user directly to your login page.

Comments
0 comments
Please sign in to leave a comment.