Endpoint
POST https://example.com/wp-json/eventer/v1/create-taxonomy
Headers
Authorization: Basic base64_encode(username:application_password) Content-Type: application/json
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
taxonomy |
String | Yes | The taxonomy to which the term belongs. Supported values: eventer-category, eventer-tag, eventer-venue, eventer-organizer. |
name |
String | Yes | The name of the taxonomy term (e.g., “Music”). |
slug |
String | No | A unique slug for the term (e.g., “music-events”). If not provided, it will be auto-generated from the name. |
description |
String | No | A description for the taxonomy term. |
Example Requests
Create an Eventer Category
curl -X POST https://example.com/wp-json/eventer/v1/create-taxonomy \
-H "Authorization: Basic dXNlcm5hbWU6YXBwbGljYXRpb25fcGFzc3dvcmQ=" \
-H "Content-Type: application/json" \
-d '{
"taxonomy": "eventer-category",
"name": "Music",
"slug": "music-events",
"description": "Events related to live music and performances."
}'
Create an Eventer Tag
curl -X POST https://example.com/wp-json/eventer/v1/create-taxonomy \
-H "Authorization: Basic dXNlcm5hbWU6YXBwbGljYXRpb25fcGFzc3dvcmQ=" \
-H "Content-Type: application/json" \
-d '{
"taxonomy": "eventer-tag",
"name": "Outdoor",
"description": "Events held outdoors."
}'
Example Responses
Success Response
{
"success": true,
"message": "Taxonomy term created successfully.",
"term_id": 456,
"taxonomy": "eventer-category"
}
Error Response (Invalid Taxonomy)
{
"success": false,
"message": "Invalid taxonomy. Supported taxonomies are: eventer-category, eventer-tag, eventer-venue, eventer-organizer"
}
Error Response (Duplicate Term)
{
"success": false,
"message": "A term with the name provided already exists."
}
Notes
- Supported Taxonomies:
eventer-category: Categories for events.eventer-tag: Tags for events.eventer-venue: Venue locations for events.eventer-organizer: Organizers for events.
- Slug Auto-Generation:
- If the
slugis not provided, WordPress will automatically generate one based on thename.
- If the
- Permission Requirements:
- The user must have the
manage_categoriescapability to create taxonomy terms. Typically, administrators have this capability.
- The user must have the
- Error Handling:
- Duplicate terms or invalid inputs will return appropriate error messages.
- Integration with Eventer API:
- Once a taxonomy term is created, it can be assigned to events using the
eventer-category,eventer-tag,eventer-venue, oreventer-organizerfields in the create event API.
- Once a taxonomy term is created, it can be assigned to events using the