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

API v2 Events - AccessLevel and Sorting

Hi,

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?

Thanks.

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

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

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • MikezMikez 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 NKen 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...

      • DmitryDmitry 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

      Wild Apricot Inc. 144 Front Street West Suite 725, Toronto, Ontario, Canada M5J 2L7