How can we make it easier for you to develop on top of Wild Apricot?

API v2 Events - AccessLevel and Sorting


I'm using the API v2 to extract Events for a custom event list in another site. So far, the API is working.

I can get a list of event objects, but they seem to be in the order in which they were entered, not in the order of their dates! (date order should be the default sort, IMHO) Is there a way I can specify the sort order in the request URL?

Also, the API returns ALL events regardless of access level: is there a way to restrict the returned set to be just public events?


1 vote
Sign in
Password icon
Signed in as (Sign out)

We’ll send you updates on this idea

Ken N shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Sign in
Password icon
Signed in as (Sign out)
  • Mikez commented  ·   ·  Flag as inappropriate

    I agree. the current sort order is useless. adding an order by on the api side is so easy. Most people want the upcoming events first. that i think should be the default sort for the api. that's what you show on the UI also.

  • Ken N commented  ·   ·  Flag as inappropriate

    Thanks for the reply. Of course, it's all possible on the client side, as you say. So that's what I'm doing tonight.

    But - it's easy enough to sort on the API-side, and 9 out of 10 users would want the list in forward chronological order... why wouldn't you do that, if you're not going to make 'sort' a param? The current sort (by order of event entry) is of no use to anyone.

    Likewise, it's easy enough to have access restrictions as a param, and it's arguably a security hole if the API defaults to "show everything", so the safest default would be public...

  • AdminDmitry Smirnov (Product Owner, Wild Apricot by Personify) commented  ·   ·  Flag as inappropriate

    Hi Ken,

    There is no way to set sorting order for any API response, and there are no garantee of default sorting order. If you need to display events in some order, then it's better to sort them on client side. Most programing languages provide tools for it.

    Filtering events by access level is also not supported, you can use "AccessLevel" field to filter events on client side.

Feedback and Knowledge Base