Skip Navigation

[Resolved] Rest api 2

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

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Alessandro 4 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1721791

I reopen the ticket In reference to this post:
https://toolset.com/forums/topic/rest-api-3/

This is and example of json paginated
hidden link
hidden link
hidden link

This is ordered by id

But i would output the json like a view ordered by date via parameter/function (now/today)

-------

I have a website about events in rome and i would create an app in flutter to show my visitors nearest location and events

In toolset location and events has a relationship

I'd need this routes:

Next events

- Filter events(cpt) by today()/now() (date/param)
- Ordering by desc data
- Ordering by geo (lat/lon)

Event

- My custom fields
- Location ID (via relationship in toolset location-events)

Location

- My Custom Fields

Location next events

The events in the location-events relationship to show next events in that single location
ordering desc filtered by date

Nearest Locations
- Ordering by geo (lat/lon)

#1722941

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand - you want to filter your view by date.

Have you checked the date filters?
=> https://toolset.com/documentation/user-guides/views/date-filters/

#1722949

Hi Minesh,
No, I have to output the view in json format

#1726481

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - I understand, to output the view in JSON format you need to chose the loop style of your view - when you format your view's loop output, you need to adjust your output so that it should return JSON format and chose the loop style "List with separators" as show with the following image as last option:
=> https://toolset.com/wp-content/uploads/2019/07/toolset-views-loop-wizard-layout-options.png

More info:
=> https://toolset.com/documentation/legacy-features/views-plugin/view-layouts-101/

#1731751

Ok I'll try thank you