Skip Navigation

[Closed] Rest api

This support ticket is created 3 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 3 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1688145

Hi, i would like to know how to retrive the rest api url for views/blocks
I can't find any documentation

#1689201

Hello, we don't have any documentation available for working with Views in the REST API because the REST API is not fully, officially, supported in Toolset. With that being said, you could set up your own custom endpoint and use the PHP Views APIs render_view, render_view_template, get_view_query_results, etc. to produce your own custom solution. It depends on what you want to accomplish with the REST API. This ticket includes an example of rendering a post with a specific Content Template and adding the rendered results to a custom field in the custom post endpoint: https://toolset.com/forums/topic/rest-api-v2-does-not-work-with-my-custom-post-type/

There is also an unofficial plugin available that claims to help expose Views and work with them in the REST API using a custom endpoint toolset-views: https://github.com/adrianosferreira/toolset-rest
You could use the plugin source as a reference for setting up your own custom solution, but as it is an unofficial plugin, we do not support it here in the forums.

We also have the Dynamic Sources API available for working with data in blocks, but I'm not sure if this is what you are interested in: https://toolset.com/documentation/programmer-reference/dynamic-sources-api/

If you have something specific you'd like to discuss, please provide more details and I can try to direct you to the correct documentation.

#1704575

I'm trying to format in json a view ordered by distance and pagination.

#1705273

Okay, since there is no JSON output formatting built-in to Views output, you would have to create the JSON structure manually in the View's loop editor and output editor using shortcodes.
- Do you have an example of the JSON format you would like to reproduce?
- What have you tried so far, can I see the results on the site somewhere? Is there a specific problem you are trying to fix in the output?

The topic ‘[Closed] Rest api’ is closed to new replies.