The Social Media API allows you to track when a loyalty customer follows a social media channel. After following a social media channel, the customer's loyalty account receives some loyalty points.
With the Social Media API, you can:
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.
If multiple Wix sites use your app with a loyalty program, you can synchronize followed social media channels and loyalty points across these sites. This synchronization ensures consistency, eliminates manual updates, and reduces the risk of data discrepancies.
To perform an initial upload and update all social media channels with associated loyalty points from a Wix site to your external system, follow these steps:
channels
and points
fields to the external system.On an ongoing basis, monitor the following webhooks to detect updates to followed social media records and loyalty points:
When the above webhooks are triggered, retrieve the record and loyalty points from the payload. Use the predefined mapping to update the external system with the new information.
Followed social media channel ID.
ID of the account that has followed a social media channel.
Followed social media channel type.
Date when an entity for following a social media channel was created.
{
"id": "3efb39b6-5bae-493d-a8ed-749f3794a8ba",
"accountId": "18de02d0-a88c-49f7-987f-8558ca02162d",
"channel": "TIKTOK",
"createdDate": "2024-08-01T11:51:41.431Z"
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a list of social media channels followed by the account. The list is ordered by creation date.
Note: This method requires visitor or member authentication.
List of followed social media channels.
curl -X POST \ 'https://www.wixapis.com/loyalty-social-media/v1/followed-channels' \
-H 'Authorization: <AUTH>' \
{
"followedChannels": [
{
"id": "3efb39b6-5bae-493d-a8ed-749f3794a8ba",
"accountId": "18de02d0-a88c-49f7-987f-8558ca02162d",
"channel": "X",
"createdDate": "2024-08-01T11:51:41.431Z"
},
{
"id": "744f837a-b6ed-42aa-a7b6-87fcf4c77356",
"accountId": "18de02d0-a88c-49f7-987f-8558ca02162d",
"channel": "LINKEDIN",
"createdDate": "2024-02-03T13:53:43.374Z"
}
]
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates an entity for the specified account ID when the account follows a social media channel.
Members can only follow enabled channels. A site owner has to enable channels in the dashboard.
Note: This method requires visitor or member authentication.
Followed social media channel details.
Followed social media channel details.
curl -X POST \ 'https://www.wixapis.com/loyalty-social-media/v1/followed-channels' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
"followedChannel": {
"channel": "X"
}
}'
{
"followedChannel": {
"id": "3efb39b6-5bae-493d-a8ed-749f3794a8ba",
"accountId": "18de02d0-a88c-49f7-987f-8558ca02162d",
"channel": "X",
"createdDate": "2024-08-01T11:51:41.431Z"
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when an account follows a new channel.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.loyalty.socialmedia.v1.followed_channel
.
Event name. Expected created
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.loyalty.socialmedia.v1.followed_channel_created",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "9aca3895-8c58-48b7-84a5-35bcd431c125",
"entityFqdn": "wix.loyalty.socialmedia.v1.followed_channel",
"slug": "created",
"entityId": "aaf51c30-a61c-473e-96be-a42dfa5064c0",
"eventTime": "2024-08-12T08:12:17.813Z",
"createdEvent": {
"entity": {
"id": "3efb39b6-5bae-493d-a8ed-749f3794a8ba",
"accountId": "18de02d0-a88c-49f7-987f-8558ca02162d",
"channel": "FACEBOOK",
"createdDate": "2024-08-01T11:51:41.431Z"
}
}
}