Yotpo Technical Description
I) Authentication Lifecycle
A) Add application
Then click on "Allow Access"
Technical Flow
- On click Ubu create an extension object on Ubu to store the access tokens.
- The client is directed to https://integrations-center.yotpo.com/app/#/install/applications/${import.meta.env.VITE_YOTPO_KONG_APPLICATION_ID}?state=${extension.cbToken}
- The client authorizes the extension on Yotpo, and Yotpo calls back Ubu at the URL https://app.getubu.com/integrations/yotpo/cb?code=XXXX&appKey=XXXX
- Ubu uses the code and appKey to generate a token and save it in the extension object.
- Ubu uses the token to subscribe to an app webhook with the event 'integrations.applications.disconnected.v3' to be able to disconnect the extension on Ubu's side if the client decides to do so on Yotpo.
- The client is redirected away from the callback page to continue their navigation.
https://develop.yotpo.com/reference/generate-a-token
Payload Reference:const payload = {
code: 'Kunf5VC92KtvXXXXXXXX8v1duV8Ci',
appKey: 'eeUT3CShSTSM1XXXXXXXabinDfJ5d5h7JfL'
};
B) Remove application from Ubu
Then click on "Remove Access"
Technical Flow
- On click Ubu call Yotpo on "remove application" endpoint
https://develop.yotpo.com/reference/remove-application
Payload Reference:
const path_params = {
account_id: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
access_token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx'
};
C) Remove application from Yotpo
A webhook is sent to Ubu, and the extension is considered disconnected on Ubu.
II) Usage
A) How to use items
You can add "Action Items" to your flow directly from the "Create Item" interface, by clicking on an "Add item" button.
Inside the Action panel you can choose between Yotpo items.
B) What are the items usable in the flow builder?
1) Update Customer Profile:
This action allows you to synchronize a customer's profile on Yotpo with data from Ubu. You can update various details such as the number of mentions they have received, the date of their last mention, and other relevant information. This ensures that customer profiles in Yotpo are always up-to-date with the latest interactions and activities captured by Ubu.
Payload Reference:
const payload = {
customer: {
email: 'thomas@getubu.com',
custom_properties: {
ubu_follower_count: 500000,
ubu_total_stories: 20,
// ...selectedPropertiesInBuilder
},
},
};
2) Subscribe Customer:
This action enables you to add a customer to a Yotpo list of your choice. When a customer is added, their opt-in email is sent to Yotpo, making them a subscriber. This is particularly useful for including the customer in a targeted Yotpo email flow, allowing you to engage them with personalized email campaigns based on their interactions and preferences.
https://develop.yotpo.com/reference/create-subscriber
Payload Reference:
const payload = {
customer: {
email: 'thomas@getubu.com'
},
channels: {
email: {
marketing: {
consent: 'subscribed',
list_id: '7774207',
source: 'Ubu'
}
}
}
};
3) Send Custom Event:
This action allows you to send a predefined event related to a customer to Yotpo. By doing so, you can trigger a Yotpo flow that uses this event as its initiation point. This is valuable for creating automated workflows that respond to specific customer actions, enabling timely and relevant engagement that enhances the customer experience.
Payload Reference:
const payload = {
customer_event: {
event_source: 'ubu',
event_type: 'comment_mention_received',
event_time: '2024-06-10T10:15:44.716Z',
external_event_id: '37fb97a9-6cfd-4983-bd65-68d104d53b70',
customer: {
email: 'thomas@getubu.com',
custom_properties: {
ubu_username: 'getubu.test',
ubu_follower_count: 500000,
// ...selectedPropertiesInBuilder
},
},
event_properties: {
ubu_event_username: 'getubu.test',
ubu_event_time: '2024-06-10T10:15:44.716Z'
}
}
};
C) How it work
All Yotpo actions operate on the same model.
Once the flow is activated, the items are converted into steps and hydrated with customer data when the customer encounters the item in the flow.
When the item is processed by the flow execution engine, it is transformed into an asynchronous task.
An independent engine is responsible for dequeuing the tasks according to the rate limit applicable to the endpoint on Yotpo.