Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is seeking information on how to use the REST API with WPML to retrieve pages in different languages and understand the relationship between translations.

Solution:
We recommend checking the following guides for more information:

Additionally, you may find this forum thread helpful: How to use REST APIs to set/retrieve post translations.

Please note that the solution provided might be outdated or not applicable to your case. If so, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 11 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
March 6, 2024 at 7:56 am #15377369

Neil Hillman

I am trying to figure out how to use REST-API with WPML, and there doesn't seem to be any information in the documentation or support forums.

For example, "/wp-json/wp/v2/pages?lang=ar" will get me the Arabic content, but I have no way of knowing which pages are translations of what. How do I get the translation ids?

"/wp-json/wp/v2/pages/20" will get me a specific record in English, (primary language), but how do I find the translations of this record?

Is there any documentation on WPML and the REST-API?

March 6, 2024 at 9:59 am #15378314

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Neil,

Thank you for contacting the support.

I'll recommend checking the following guides for more information:

- https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/
- https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/
- https://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/

And this thread https://wpml.org/forums/topic/how-to-use-rest-apis-to-set-retrieve-post-translations/ for some related understanding.

Regards.