Follow

Events admin API call

You can use the Events API call to retrieve information about events, and to create, update, or delete an event. You can retrieve information for all events, and just for a specific event. You can also use the Events API to retrieve the number of events.

Wild Apricot's API is intended for use by developers with technical expertise. If you need assistance, we provide support via email or through our Developers forum.

You can use the Events API call to retrieve information about events, and to create, update, or delete an event. You can retrieve information for all events, and just for a specific event. You can also use the Events API to retrieve the number of events.

Events API functions

The Events API call supports the following functions. To view the Swagger documentation, click the appropriate function below.

Specifying filter criteria

You can filter the results of the Events API call so that only those events that match the filter criteria will be included. For example, you might want to retrieve information only about upcoming events, or events between certain dates.

Within your filter criteria, you can use relational operators to include ranges of events, and use logical operators to combine multiple criteria.

$filter syntax

GET https://api.wildapricot.org/[version]/Accounts/[accountID]/Events?$filter=[filterCriteria]

where filterCriteria is the criteria to be used to filter the search results.

Example:
GET https://api.wildapricot.org/v2/Accounts/58293/Events?$filter=StartDate gt 2015-01-15 AND StartDate lt 2015-06-15

In this example, only events between January 15th, 2015 and June 15th, 2015 will be included in the results.

Filter fields

You can filter events using the following fields:

ID
A list of event IDs.
Supported operators: in

Name
The name of the event.
Supported operators: eq, substringof

IsUpcoming
Indicates whether the event has yet to take place.
Supported operators: eq

Tags
The labels used to categorize events.
Supported operators: in

StartDate
The start date of the event (using the yyyy-mm-dd date format)
Supported operators: eq, gt, ge, lt, le

EndDate
The end date of the event (using the yyyy-mm-dd date format)
Supported operators: eq, gt, ge, lt, le

RegistrationEnabled
Indicates whether registration has been enabled for the event.
Supported operators: eq

TextIndex
Returns events that contain the specified string within the event title, description, location, start date or event tag
Supported operators: substringof

Relational operators

You can use the following relational operators within your search criteria.

Operator

Description

Fields

Example

eq

Equal to

Name, IsUpcoming, StartDate, EndDate, RegistrationEnabled

$filter=RegistrationEnabled eq true

gt

Greater than

StartDate, EndDate

$filter=StartDate gt 2015-01-15

ge

Great than or equal to

StartDate, EndDate

$filter=EndtDate ge 2015-01-15

lt

Less than

StartDate, EndDate

$filter=StartDate lt 2015-06-15

le

Less than or equal to

StartDate, EndDate

$filter=End tDate le 2015-01-15

inIn list of valuesTags$filter=Tags in [social, training]

substringof

Field includes specified value using the following format:
substringof('field', 'value')

Name, TextIndex

$filter=substringof('Name', 'Annual')

Field names that include spaces or special characters (such as ? < & ) must be enclosed within single quotation marks.

Logical operators

You can use logical operators – AND and OR – to group multiple search criteria, and control whether either or both criteria must satisfied.

In the following example...

$filter=RegistrationEnabled eq true AND StartDate gt 2015-01-15

...events must have registration enabled and must be taking place after January 15, 2015 to be included in the results.

In this example...

$filter=substringof('Name', 'training') eq true OR $filter=Tags in [training]

...events will included in the search results if they have the word "training" in their name or their tags.

You can use brackets to control precedence – the order in which multiple criteria are evaluated within your search criteria. Normally, criteria joined by an AND operator are evaluated ahead of criteria joined by an OR operator. However, any criteria surrounded by brackets will be given priority and evaluated ahead of any other criteria.

In the following example....

$filter=A and B or C

...events would have to satisfy both the A and B criteria – or satisfy the C criteria alone – to be included in the results. If, however, you place brackets as shown here...

$filter=A and (B or C)

...then events would have to satisfy either the B or C criteria, as well as the A criteria.

Sorting the results

Using the $sort parameter, you can control the order in which the results of the Events API are sorted.

Syntax
GET https://api.wildapricot.org/[version]/Accounts/[accountID]/Events?$sort=[sortCriteria]

where sortCriteria is one of the following:

  • StartDate asc
    Sorted by event start date, in ascending order
  • StartDate desc
    Sorted by event start date, in descending order
  • StartSession asc
    Sorted by first session date, in ascending order
Example:
GET https://api.wildapricot.org/v2/Accounts/58293/Events?$sort=StartDate asc

Paging

Using the $skip and $top parameters, you can retrieve event records in sets or pages. You use the $top parameter to specify the maximum number of records to be returned, and the $skip parameter to specify the number of records to skip. The $skip parameter is incremented each call to return the next set or page of records.

Example

You want to retrieve records for the 50 events for which registration has been enabled, using an application that can only process 20 records at a time. Using the following calls, the application retrieves the first set of 20 records, then a second set of 20, and finally, the remaining 10 records.

https://api.wildapricot.org/v2/Accounts/58293/Events?$filter=RegistrationEnabled eq true&$skip=0&$top=20
https://api.wildapricot.org/v2/Accounts/58293/Events?$filter=RegistrationEnabled eq true&$skip=20&$top=20
https://api.wildapricot.org/v2/Accounts/58293/Events?$filter=RegistrationEnabled eq true&$skip=40&$top=20

In this example, the $top specifies the maximum number of records to retrieve (20), and the $skip parameter is incremented from 0 to 20 to 40 to skip the records retrieved by the previous call(s).

0 Comments

Please sign in to leave a comment.

Search: WildApricot.com 

About results ( seconds) Sort by: 
Sorry, an error occured when performing search.