KobeBryant
KobeBryant

Reputation: 1351

Eventbrite API PHP, how to do sorting and display one event?

I am using the php library of Eventbrite API to get a list of all events from a user. The default call pulls the list as sorted in ascending order:

$events = $eb_client->user_list_events();
  1. What is the correct syntax to get the list in descending order?

  2. Is there a way to pull only the earliest upcoming event instead of the whole list?

Upvotes: 0

Views: 435

Answers (1)

Claire
Claire

Reputation: 169

  1. The default display for user_list_events is in ascending order, but you can modify this using the asc_or_desc parameter. Valid options include ‘asc’ or results in ascending order or ‘desc’ or descending order based on event start_date.

  2. If you only want to display one specific event, you can use the event_get method, which uses the id of the requested event to display only that event.

Upvotes: 2

Related Questions