With the Categories API, you can create robust solutions for organizing and managing event categories. You can use this API to display similar events on different site pages and sort events in your dashboard. For example, you can create separate pages for jazz, blues, and folk events, but also pages for different venues. The same jazz event can be displayed on your jazz page and also on your downtown location page.
With the Wix Event Category Management API, your app can:
It’s important to note the following points before starting to code:
The following table shows field support for filters and sorting for the Category object:
Field | Query Filter Operators | Sortable |
---|---|---|
createdDate | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
name | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | |
states | $hasSome | |
id | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists |
Related content: API Query Language, Query Categories endpoint
This article shares some possible use cases your app could support, as well as a sample flow that could support each use case. This can be a helpful jumping off point as you plan your app's implementation.
If you have multiple event sites using your app, you may need to sync event categories across these sites. For example, if you've added a new city for some of your concerts, such as "Chicago," you’ll need to create a new category named "Chicago" and apply this change to other sites as well.
To sync the category across all sites:
Call Query Categories on the site where you created a new category.
Extract the entire category
object. Remove unnecessary fields, like createdDate
.
For all other sites, call Query Events and extract the IDs of all relevant events.
Call Create Category on the other sites, passing the new category to each.
Call Bulk Assign Events and assign the new category to all the previously extracted events.
Category ID.
Category name.
Date and time when category was created.
The total number of draft and published events assigned to the category.
Category state. Possible values:
MANUAL
: Category is created manually by the user.
AUTO
: Category is created automatically.
RECURRING_EVENT
: Category is created automatically when publishing recurring events.
HIDDEN
: Category can't be seen.
Default: MANUAL
.
Note: The WIX_EVENTS.MANAGE_AUTO_CATEGORIES permission scope is required to use states other than MANUAL
.
Creates a category.
You can only call this method when authenticated as a Wix app or Wix user identity.
Category to create.
Created category.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Creates multipe categories at once.
You can only call this method when authenticated as a Wix app or Wix user identity.
Categories to create.
Bulk create results.
Metadata of results.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Updates an existing category.
You can only call this method when authenticated as a Wix app or Wix user identity.
Category ID.
Category to update.
Updated category.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.