This article shares some possible use cases your app could support, as well as a sample flow that could support each use case. This can be a helpful jumping off point as you plan your app's implementation.
When a new user installs your app, you can get their email and save it for future communications.
To retrieve new users' email:
data.instanceId
value from the webhook payload.APP_ID
and APP_SECRET_KEY
from your app's OAuth page, as well as the instance ID you collected in Step 1. This will generate an access token you can use to communicate with the user's site.site.ownerInfo.email
. Save this email for future communications.Notes:
ownerInfo
object returns empty, check to make sure you've added the correct permission scope to your app.Your app may require that the site owners have also installed a specific Wix business solution. In this case, you can use the App Management API to verify that the relevant app is installed on their site.
During your app's setup process, you can mark one or more apps built by Wix as requirements. However, if your app supports different use cases depending on which Wix business solution is installed, we recommend following the steps below. For example, your app may offer one flow for a site that includes Wix Stores, and a different flow for a site that uses Wix Bookings. Therefore, you need to identify which one is installed on the site with your app.
To identify a site's installed business solutions:
data.instanceId
value from the webhook payload.APP_ID
and APP_SECRET_KEY
from your app's OAuth page, as well as the instance ID you collected in Step 1. This will generate an access token you can use to communicate with the user's site.site.installedWixApps
array.Get App Instance
repeatedly to stay up to date on a site's installed apps. If a user no longer has a required Wix app installed, you may want to adjust your flow to ask them to reinstall it. This is important to prevent getting errors when calling APIs that rely on a Wix app being installed.