About the Translation Published Content API

Developer Preview
APIs in Developer Preview are subject to change and are not intended for use in production.
Send us your suggestions for improving this API. Your feedback is valuable to us.

 

Introduction

The Translation Published Content API allows you to query translated content that has been marked as ready to publish and listen for events when this content is created, updated, or deleted. Use the API to ensure that site visitors see the relevant translation for their locale, providing a seamless multilingual experience.

With the Translation Published Content API, your app can:

  • Query translation content that has been marked as ready to publish.
  • Keep content up-to-date by listening for events when content that is ready to publish is created, updated, or deleted.

This API is based on Wix Multilingual.

Before you begin

It's important to note the following points before starting to code:

  • You can only query content that has been marked as ready to publish. This happens when:

    • A content field is set to "published": true with the Create Content or Update Content methods of the Translation Content API.
    • The Wix user saves translations in the Translation Manager, which triggers the Translation Manager to call the Translation Content API and set the content's published status to true.
  • You can only use this API on sites where the Wix user has installed the Wix Multilingual app.

Use cases

Did this help?

Translation Published Content: Sample Flows

This article presents possible use cases and corresponding sample flows that your app can support. It provides a useful starting point as you plan your app's implementation.

Fetch translations for hotel listings

Suppose you're developing a hotel booking app that lists various hotels. To ensure your app displays the most up-to-date hotel descriptions in multiple languages, your app should automatically fetch and display new translations when Wix users add, update, and delete them.

  1. Listen for the Published Content Created, Published Content Updated, and Published Content Deleted events to detect when hotel translations marked for publication have been added, updated, or deleted. Retrieve the latest translations for hotel descriptions in the relevant locales from the event object.

  2. Display the updated hotel listings in the appropriate languages for users browsing the app in different locales.

Update translated content for seasonal menu items

Suppose your restaurant app has seasonal menu items. As the seasons change, you need to update the translations for these items to reflect the new offerings. This process ensures that site visitors see the latest translated content relevant for the current season.

  1. Use the Query Published Content method to retrieve the current published translations for seasonal menu items. Filter the query by locale to ensure you get the right translations.

  2. Collect the new seasonal menu items in the primary language (English) from the Wix user. Once you have the original content, use an external service or a translator to translate these seasonal items into the different languages.

  3. Call the Bulk Update Content method to update the existing published translations with the new seasonal content. Set "published": true to mark the updated content as ready to publish.

  4. Make sure that the updated translations for the seasonal menu items are displayed correctly in the appropriate locales for site visitors browsing the site in different languages.

Did this help?

Translation Published Content: Supported Filters and Sorting

This article covers field support for filtering and sorting in the Translation Published Content API.

The following table shows field support for filters and sorting for the translation published content object when using Query Published Content:

FieldRequiredSupported FiltersSortable
idNoeq, ne, exists, in, hasSome, startsWith, ascending, descendingSortable
schemaKey.appIdYeseq, ne, exists, in, hasSome, startsWith, ascending, descendingSortable
schemaKey.entityTypeYeseq, ne, exists, in, hasSome, startsWith, ascending, descendingSortable
schemaKey.scopeYeseq, ne, exists, in, hasSome, startsWith, ascending, descendingSortable
entityIdNoeq, ne, exists, in, hasSome, startsWith, ascending, descendingSortable
localeNoeq, ne, exists, in, hasSome, startsWith, ascending, descendingSortable
parentEntityIdNoeq, ne, exists, in, hasSome, startsWith, ascending, descendingSortable
Did this help?

Published Content Object


Properties
idstringRead-onlyformat GUID

Published content ID.


schemaKeySchemaKey

Schema key of the published content.


entityIdstringRead-onlymaxLength 100

A unique identifier defined by the app developer to differentiate translation content for various entities within the site. For example, if an app developer is creating translation content for blog posts, the entityId can be 'blog-posts-1'.


localestringRead-onlyformat LANGUAGE_TAG

Published content locale.


fieldsArray <PublishedContentField>minItems 0maxItems 2000

List of fields that have been translated and published for the given locale.


parentEntityIdstringminLength 1maxLength 100

A reference to the parent content. For example, if the content is a menu item, this property would contain the entityId of the menu it belongs to.


extendedFieldsExtendedFields

Custom field data for the published content object.

Did this help?

POST

Query Published Content


Developer Preview

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 published translation content given the provided paging, filtering, and sorting. Up to 100 published content items can be returned per request.

The default sort is id in ASC.

The following query filter fields are required:

  • schemaKey.appId
  • schemaKey.entityType
  • schemaKey.scope

For additional field support for filters and sorting, see Translation Published Content: Supported Filters and Sorting.

To learn how to query translation consent items, see API Query Language.

Permissions
Wix Multilingual - Translation Content + Published Content Read
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/translation-published-content/v3/published-contents/query

Body Params
queryQueryRequired

Query options. Note that some query filters are required. See the API description for a list of required filters.

Response Object
publishedContentArray <PublishedContent>

The published translation content.


pagingMetadataPagingMetadata

Details on the paged set of results returned.

Query Published Content
Request
cURL
curl -X POST 'https://www.wixapis.com/translation-published-content/v3/published-contents/query' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-binary '{ "query": { "filter": { "schemaKey.appId": {"$eq": "14271d6f-ba62-d045-549b-ab972ae1f70e"}, "schemaKey.entityType": {"$eq": "Gallery"}, "schemaKey.scope": {"$eq": "GLOBAL"} } } }'
Response
JSON
{ "publishedContent": [ { "id": "076f7724-8e95-44f3-b737-02e2a24913e9", "schemaKey": { "appId": "14271d6f-ba62-d045-549b-ab972ae1f70e", "entityType": "Gallery", "scope": "GLOBAL" }, "entityId": "aa1dfffb-6d02-49da-9cb2-fc7c07b2cd4e", "locale": "en", "fields": [ { "textValue": "The new garden", "schemaFieldKey": "items()-title", "sequenceIds": ["0a672f39-f9ec-405b-b139-353d18dc1fd9"] }, { "textValue": "Grandma's tree", "schemaFieldKey": "items()-title", "sequenceIds": ["a6bf9eb4-cf80-4819-90b7-6a947826f8de"] }, { "textValue": "The orange tree grandma planted many years ago...", "schemaFieldKey": "items()-description", "sequenceIds": ["a6bf9eb4-cf80-4819-90b7-6a947826f8de"] } ] }, { "id": "c54aa1ef-6129-4368-aa0a-0a01775d32a4", "schemaKey": { "appId": "14271d6f-ba62-d045-549b-ab972ae1f70e", "entityType": "Gallery", "scope": "GLOBAL" }, "entityId": "aa1dfffb-6d02-49da-9cb2-fc7c07b2cd4e", "locale": "frr", "fields": [ { "textValue": "Le nouveau jardin", "schemaFieldKey": "items()-title", "sequenceIds": ["0a672f39-f9ec-405b-b139-353d18dc1fd9"] }, { "textValue": "L'arbre de grand-mère'", "schemaFieldKey": "items()-title", "sequenceIds": ["a6bf9eb4-cf80-4819-90b7-6a947826f8de"] }, { "textValue": "L'oranger que grand-mère a planté il y a de nombreuses années...'", "schemaFieldKey": "items()-description", "sequenceIds": ["a6bf9eb4-cf80-4819-90b7-6a947826f8de"] } ] } ], "pagingMetadata": { "count": 2, "cursors": {}, "hasNext": false } }
Did this help?

Published Content Created


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when published content is created.

Permissions
Wix Multilingual - Translation Content + Published Content Read
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.multilingual.localization_public.v3.published_content.


slugstring

Event name. Expected created.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


createdEventCreatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.multilingual.localization_public.v3.published_content_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 } } }

PublishedContentCreated
JSON
{ "id": "32e07bda-9b38-4109-a385-e216b9d9d816", "entityFqdn": "wix.multilingual.localization_public.v3.published_content", "slug": "created", "entityId": "160edd15-2836-4340-9d1c-b437085731e3", "createdEvent": { "entityAsJson": "{\"id\":\"160edd15-2836-4340-9d1c-b437085731e3\",\"schemaKey\":{\"appId\":\"cbdb1c1c-5a76-40d6-a9cf-202825ffcefc\",\"entityType\":\"movie-review\",\"scope\":\"GLOBAL\"},\"entityId\":\"377e393e-737b-4dbc-9928-ea26490d8f33\",\"locale\":\"en\",\"fields\":[{\"textValue\":\"Best movie I have ever seen. And I have seen the first!\",\"schemaFieldKey\":\"title\",\"sequenceIds\":[]}],\"parentEntityId\":\"terminator-2\"}" }, "eventTime": "2024-08-15T12:46:35.736477191Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "1" }
Did this help?

Published Content Updated


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when published content is updated.

Permissions
Wix Multilingual - Translation Content + Published Content Read
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.multilingual.localization_public.v3.published_content.


slugstring

Event name. Expected updated.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


updatedEventUpdatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.multilingual.localization_public.v3.published_content_updated", "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 } } }

PublishedContentUpdated
JSON
{ "id": "4f08d6c6-2fc3-42b5-b0c6-633603fdd447", "entityFqdn": "wix.multilingual.localization_public.v3.published_content", "slug": "updated", "entityId": "3f3bca52-a173-4236-8512-1985bbd73616", "updatedEvent": { "currentEntityAsJson": "{\"id\":\"3f3bca52-a173-4236-8512-1985bbd73616\",\"schemaKey\":{\"appId\":\"1380b703-ce81-ff05-f115-39571d94dfcd\",\"entityType\":\"shipping-rule\",\"scope\":\"GLOBAL\"},\"entityId\":\"00000000-0000-0000-0000-000000000002\",\"locale\":\"en\",\"fields\":[{\"textValue\":\"International\",\"schemaFieldKey\":\"shippingRule-name\",\"sequenceIds\":[]},{\"textValue\":\"Fast turtle delivery\",\"schemaFieldKey\":\"shippingRule-option()-title\",\"sequenceIds\":[\"00000000-0000-0000-0000-000000000001\"]},{\"textValue\":\"Up to 30 minutes or the pizza is free\",\"schemaFieldKey\":\"shippingRule-option()-deliveryTime\",\"sequenceIds\":[\"00000000-0000-0000-0000-000000000001\"]}]}", "modifiedFields": { "fields[2].textValue": "" } }, "eventTime": "2024-08-15T12:46:33.348833287Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "3" }
Did this help?

Published Content Deleted


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when published content is deleted.

Permissions
Wix Multilingual - Translation Content + Published Content Read
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.multilingual.localization_public.v3.published_content.


slugstring

Event name. Expected deleted.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


deletedEventstruct

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.multilingual.localization_public.v3.published_content_deleted", "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 } } }

PublishedContentDeleted
JSON
{ "id": "557a2b62-2df7-4459-8a1d-857acb061117", "entityFqdn": "wix.multilingual.localization_public.v3.published_content", "slug": "deleted", "entityId": "146de18d-d208-43fd-a3cf-16c2d4706b7a", "deletedEvent": { "deletedEntityAsJson": "{\"id\":\"146de18d-d208-43fd-a3cf-16c2d4706b7a\",\"schemaKey\":{\"appId\":\"00000000-0000-0000-0000-000000000013\",\"entityType\":\"wysiwyg.viewer.components.WRichText\",\"scope\":\"GLOBAL\"},\"entityId\":\"comp-ikgp3ypw\",\"locale\":\"en\",\"fields\":[{\"textValue\":\"<p class=\\\"font_7\\\">Deleted paragraph</p>\",\"schemaFieldKey\":\"compFeatures-wRichText-data-styledText-text\",\"sequenceIds\":[]}],\"parentEntityId\":\"masterPage\"}" }, "eventTime": "2024-08-15T13:04:12.420887487Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "9223372036854775807" }
Did this help?