Introduction
Certain PMS providers support OAuth connections. This allows for a better, and more secure way to connect to their platform. Currently, the following PMS providers support OAuth connections:- HOSTFULLY
- BOOKINGSYNC
OAuth Flow
The OAuth flow in Zepl follows the standard OAuth 2.0 authorization code flow. Here’s how it works:Creating an OAuth Connection
To create an OAuth connection, you will need to create an OAuth Application. For each PMS provider, you will need to create a new OAuth Application, and this is a one-time process. The OAuth Application will be used when creating an integration account for the PMS provider, to generate and refresh tokens.Creating an OAuth Application
Documentation for creating an OAuth application can be found in the API Reference. When creating an OAuth application, you need to specify the required scopes that your application needs. These scopes are stored with the OAuth application and will be requested during the authorization flow. The scopes determine what level of access your application will have to the PMS provider’s resources. Once an OAuth application is created, you will be able to create integration accounts for the PMS provider.Creating an Integration Account
When creating an integration account withauthType set to OAUTH, you will need to provide the following parameters:
name: The name of the integration account.accountIdentifier: The identifier for the integration account. This should be the same as theaccountIdentifierused in the OAuth application.provider: The PMS provider.authType: Should be set toOAUTH.clientRedirectURL: The final URL that the user will be redirected to after the OAuth flow is complete. This is different from theredirectURLused in the OAuth application. TheredirectURLspecified there, is used for sending the OAuth callback. It should be set to{BASE_ZEPL_URL}/api/v1/oauth/callback. ThisclientRedirectURLshould be used as a final redirect for when the Zepl platform completes the OAuth flow.
Client Redirect URL Behavior
When the OAuth flow completes, Zepl will send a POST request to yourclientRedirectURL with the following information:
clientRedirectURL endpoint is prepared to handle both success and failure cases.
Troubleshooting
Common issues and their solutions:- Invalid Redirect URI: Ensure the redirect URI matches exactly what’s configured in the PMS provider
- Scope Issues: Verify that all required scopes are requested during the OAuth flow