I have a custom search view. I want to query the view using a get request from third party app.
How can i send the view results as formatted json?
Hi there,
Thank you for contacting us and I'll be happy to assist.
The Toolset Views plugin includes an "Unformatted" output option, which can be used to generate data in raw formats like JSON, CSV etc, as required.
While creating the view, you can select this option in the "Loop Wizard" and then structure your fields and data accordingly.
( ref: https://toolset.com/documentation/user-guides/view-layouts-101/#unformatted )
I hope this helps.
regards,
Waqar
what is the endpoint to get the results from?
Hi,
To get the results from a view, the endpoint will be the link to a page on which the view's shortcode will be inserted.
Note: to limit the page's output to only the content (from view), without the extra page elements like header, sidebar, footer etc, you can create a custom page template and assign it to that page.
( https://developer.wordpress.org/themes/template-files-section/page-template-files/ )
You can also get the output of the view directly in a PHP code using the "render_view" function.
https://toolset.com/documentation/programmer-reference/views-api/#render_view
regards,
Waqar
My issue is resolved now. Thank you!