Skip Navigation

[Resolved] REST API access to relationship and multilingual fields

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Waqar 9 months, 3 weeks ago.

Assisted by: Waqar.

Author
Posts
#2678545

I want to access custom post data from external application by REST API.

I use rest api url like this: hidden link

But I can't find here relationship data with a custom post type "region"
I also can't find here multilingual data (all city posts also translated to Russian and German languages).

How could I access both relationship and multilingual data by REST API?

#2678695

Hi! Anybody could help?

#2678703

Hi,

Thank you for contacting us and I'd be happy to assist.

By default, the post-relationship data is not returned in the REST API calls.
( ref: https://toolset.com/documentation/programmer-reference/toolset-integration-with-the-rest-api/ )

But you can use Toolset's Relationship API functions to achieve that:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts

You'll find some good usage examples, in the following support forum threads:
https://toolset.com/forums/topic/relationship-in-api-rest/#post-1832713
https://toolset.com/forums/topic/relationship-in-api-rest-2/

I hope this helps and please let me know if you need further assistance.

regards,
Waqar