Skip Navigation

[Resolved] How to send custom search view results in a json format?

This support ticket is created 5 years, 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 4 replies, has 2 voices.

Last updated by PrakharM1203 5 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#1156825

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?

#1157825

Waqar
Supporter

Languages: English (English )

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

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

#1162665

what is the endpoint to get the results from?

#1162876

Waqar
Supporter

Languages: English (English )

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

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

#1164765

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.