Skip to content
No results
MEC Knowledgebase
  • Installation
    • Installation
    • Activation
    • Auto Update
    • Manual Update
    • Change License Domain
  • Settings
    • General
    • Archive Page
    • Slugs/Permalinks
    • Currency
    • View All
  • Single Event
    • Single Event Settings
    • How to Add Event In MEC Plugin?
    • MEC Single Sidebar
    • Custom Fields
    • View All
  • Event Modules
    • Speakers
    • Organizers
    • Locations
    • Map
    • View All
  • Booking Settings
    • Booking Module
    • Booking Elements
    • Booking Form
    • Payment Gateways
    • View All
  • Event Submission
    • General
    • Access Level
    • FES Sections
    • Required Fields
    • View All
  • Integrations
    • Mailchimp
    • Paid Memberships Pro
    • BuddyPress
    • LearnDash
    • View All
  • Notifications
    • Booking Notification
    • Booking Confirmation
    • Booking Reminder
    • Admin Notification
    • View All
  • Addons
    • Elementor Single Builder Addon
    • Ticket and Invoice Addon
    • Event Seat Addon
    • Virtual Events Addon
    • View All
  • Other
    • Appearance Settings
    • Translation
    • Knowledge
    • Troubleshooting
    • Developer
MEC Knowledgebase

  • Categories
    • Installation
      • Installation
      • Activation
      • Auto Update
      • Manual Update
      • Change License Domain
    • General Settings
      • General
      • Archive Pages
      • Slugs/Permalinks
      • Currency
      • View All
    • Single Event
      • Single Event Settings
      • MEC Single Sidebar
      • How to Add Event In MEC Plugin?
      • Custom Fields
      • View All
    • Event Modules
      • Speakers
      • Organizers
      • Locations
      • Map
      • View All
    • Booking Settings
      • Booking Module
      • Add a Booking System
      • Booking Form
      • Organizer Payment Settings
      • View All
    • Event Submission
      • General
      • Access Level
      • FES Sections
      • Required Fields
      • View All
    • MEC Integrations
      • Mailchimp
      • BuddyPress
      • LearnDash
      • Paid Memberships Pro
      • View All
    • Notifications
      • Booking Notification
      • Booking Confirmation
      • Booking Reminder
      • Admin Notification
      • View All
    • Addons
      • Elementor Single Builder Addon
      • Ticket and Invoice Addon
      • Event Seat Addon
      • Virtual Events Addon
      • View All
    • Other
      • Appearance Settings
      • Translation
      • Knowledge
      • Troubleshooting
      • Developer

Submit a Ticket
MEC Knowledgebase

Toggle
  • Base URL
  • API Key
  • All Events
    • Request
    • Response
  • Single Event
    • Request
    • Response
  • Login
    • Request
    • Response
  • Upload Image
    • Request
    • Response
  • Upload File
    • Request
    • Response
  • Create Event
    • Request
    • Response
  • Edit Event
    • Request
    • Response
  • My Events
    • Request
    • Response
  • Trash Event
    • Request
    • Response
  • Delete Event
    • Request
    • Response
  • Custom Fields
    • Request
    • Response
  • Icons
    • Request
    • Response
  • Weather
    • Request
    • Response
  • Related Events
    • Request
    • Response
  • Next / Previous Events
    • Request
    • Response
  • Next Occurrences
    • Request
    • Response
  • Attendee Fields
    • Request
    • Response
  • Fixed Fields
    • Request
    • Response
  • Ticket Variations
    • Request
    • Response
  • Booking Tax / Fees
    • Request
    • Response
  • Tickets
    • Request
    • Response

Developer

MEC Restful API

Base URL

The base URL is different per website but the general pattern is like the following.

http://example.com/wp-json/mec/v1.0

API Key

The API key is required for all the following commands. You should send the API key in headers with the name of mec-token If you don’t send mec-token in headers then you will receive an invalid_api_token error.

All Events

GET    /events/

This is a public command, it means all users with an API key can run it.

Request

Send the following parameters as JSON.

NameTypeAccepted ValuesExample
limitinteger 12
orderstringASC / DESCASC
offsetinteger 0
startstringtoday / date / tomorrow / yesterday/ start_last_month / start_current_month / start_next_monthdate
start_datestring(yyyy-mm-dd)2024-12-15
show_only_past_eventsinteger0,10
include_past_eventsinteger0,10
show_only_ongoing_eventsinteger0,10
include_ongoing_eventsinteger0,10

Response

You will receive all events in the events key of the response. Events are categorized based on their start date so you can utilize that to display the events in any format you need like list view, monthly calendar view, weekly timetable view or anything else.

You can also use the pagination key of the response to read all events page by page. Just send the next_date value as start_date of your next request and send next_offset as the value of the offset parameter.

{
   "events": {
      "2025-01-15": [{ ... }],
	...
   },
   "pagination": {
       "next_date": "2025-12-15",
       "next_offset": 1,
       "has_more_events": true,
       "found": 12
   }
}

Single Event

GET    /events/{id}

This is a public command, it means all users with an API key can run it.

Request

Send the following parameters as a query string.

NameTypeExample
id *integer1
occurrenceinteger1747335600

Response

You will receive a bunch of information included but not limited to the following. The data key has many useful information about the event that you can use in your application. The dates key has upcoming dates of the event. You can send the start timestamp value that you can see as an occurrence value in the query string to move forward in the time. Also the date key holds information about the current occurrence.

{
   "ID": 1,
   "data": { ... },
   "dates": [{
     "start": {
         "date": "2025-05-15",
         "hour": 7,
         "minutes": "0",
         "ampm": "PM",
         "timestamp": 1747335600
     },
     "end": {
         "date": "2025-05-15",
         "hour": 11,
         "minutes": "0",
         "ampm": "PM",
         "timestamp": 1747350000
     },
     "allday": "0",
     "hide_time": "0",
     "past": 0
   }],
   "date": {}
}

Login

POST    /login

Request

Send the following parameters as regular-form data.

NameTypeExample
username *stringuser
password *string12345678

Response

Use the token to authorize users in other commands. You should send it as a new header named user-token for those commands that require authentication like my-events or trash events commands.

{
   "success": 1,
   "id": 1,
   "token": "W2X53XpClol8TquAIKWaZo0j68L0tuho3o4wmwD0"
}

Upload Image

POST    /images

Users must be authenticated for this command. Both mec-token and user-token should be
included in the headers.

Request

Send following parameters as JSON.

NameTypeExample
image *file

Response

Use the image_id in other commands like creating events, etc.

{
    "success": 1,
    "image_id": 10
}

Upload File

POST    /files

Users must be authenticated for this command. Both mec-token and user-token should be
included in the headers.

Request

Send the following parameters as JSON.

NameTypeExample
file *file

Response

Use the file_id in other commands like creating events, etc.

{
    "success": 1,
    "file_id": 10
}

Create Event

POST    /events

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

Request

Send the following parameters as JSON.

NameTypeExample
title *stringEvent Title
contentstringEvent Content
location[name]stringArt Gallery
location[address]textArt Gallery, City
location[latitude]float
location[longitude]float
location[thumbnail]int10
organizer[name]string John Due
organizer[email] email [email protected]
organizer[tel]tel +13007772299
organizer[url]url https://google.com
organizer[thumbnail]number 10
start_datedate (yyyy-mm-dd)2025-06-01
start_hourint10
start_minutesint15
start_ampmstring AM
end_datedate (yyyy-mm-dd)2025-06-01
end_hourint2
end_minutesint45
end_ampmstringPM

Response

Use the event_id in other commands like get single event, etc.

{
    "success": 1,
    "message": "The event is published.",
    "event_id": 12
}

Edit Event

PUT    /events/{id}

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

Request

The request is exactly like the create event command.

Response

The response is also exactly like the create event command.

My Events

GET    /my-events

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

Request

Send the following parameters as JSON.

NameTypeExample
limit *integer12
pages *integer1

Response

You can loop through the events to display all events. Use the pagination data to navigate through the pages of events.

{
   "events": [
       {
           "id": 2645,
           "title": "Monthly",
           "url": "http://example.com/events/monthly/",
           "status": "publish"
       }
   ],
   "pagination": {
       "current_page": 2,
       "total_pages": 5
   }
}

Trash Event

DELETE    /events/{id}/trash

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
   "success": 1
}

Delete Event

DELETE    /events/{id}

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

This command will force delete an event. It doesn’t matter if the event is already trashed or not.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
   "success": 1
}

Custom Fields

GET    /config/custom-fields

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "fields": {
        "1": {
            "mandatory": "1",
            "type": "text",
            "label": "Your Comment"
        },
        "2": {
            "mandatory": "0",
            "type": "date",
            "label": "Preferred Date"
        },
        "3": {
            "mandatory": "0",
            "ignore": "0",
            "type": "select",
            "label": "Gender",
            "options": {
                "1": {
                    "label": "Male"
                },
                "2": {
                    "label": "Female"
                }
            }
        }
    }
}

Icons

GET    /config/icons

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "icons": [
        {
            "name": "Location Marker Icon",
            "default": "<i class=\"mec-sl-location-pin\"></i>",
            "modules": [
                "single",
                "shortcode"
            ],
            "value": "<img class=\"mec-custom-image-icon\" src=\"http://site.com/wp-content/uploads/2025/03/location.jpg\" alt=\"location-pin\">"
        }
    ]
}

Weather

GET    /events/{id}/weather

This is a public command, it means all users with an API key can run it.

Request

Send following parameters as query string.

NameTypeExample
datestringyyyy-mm-dd

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "weather": {
        "icon": "//cdn.weatherapi.com/weather/64x64/day/113.png",
        "condition": "Sunny",
        "temp_c": 13.699999999999999,
        "temp_f": 56.700000000000003,
        "wind_kph": 9,
        "wind_mph": 5.5999999999999996,
        "humidity": 58,
        "feelslike_c": 13.199999999999999,
        "feelslike_f": 55.799999999999997
    }
}

Related Events

GET    /events/{id}/related-events

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "related_events": [
        {
            "id": 21,
            "title": "Daily Event",
            "url": "http://site.com/events/daily-event/",
            "timestamp": 1746432000,
            "date": "May 5, 2025"
        }
    ]
}

Next / Previous Events

GET    /events/{id}/next-previous-events

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "next": {
        "id": "21",
        "title": "Daily Event",
        "url": "http://rezamiri.test/events/daily-event/"
    },
    "previous": []
}

Next Occurrences

GET    /events/{id}/next-occurrences

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "occurrences": [
        {
            "start": {
                "date": "2025-05-10",
                "hour": "8",
                "minutes": "0",
                "ampm": "AM",
                "timestamp": 1746864000
            },
            "end": {
                "date": "2025-05-10",
                "hour": 6,
                "minutes": "0",
                "ampm": "PM",
                "timestamp": 1746900000
            },
            "allday": "0",
            "hide_time": "0",
            "past": 0
        }
    ]
}

Attendee Fields

GET    /config/attendee-fields

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "fields": [
        {
            "mandatory": "1",
            "type": "mec_email",
            "label": "Email"
        },
        {
            "mandatory": "1",
            "type": "name",
            "label": "Name"
        },
        {
            "mandatory": "0",
            "type": "textarea",
            "label": "Text",
            "mapping": ""
        }
    ]
}

Fixed Fields

GET    /config/fixed-fields

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "fields": {
        "1": {
            "mandatory": "0",
            "type": "text",
            "label": "Text"
        },
        "2": {
            "mandatory": "1",
            "type": "date",
            "label": "Date"
        }
    }
}

Ticket Variations

GET    /config/ticket-variations

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "ticket_variations": {
        "1": {
            "title": "Pizza",
            "price": "6",
            "max": "2"
        },
        "2": {
            "title": "Juice",
            "price": "4",
            "max": "3"
        }
    }
}

Booking Tax / Fees

GET    /events/{id}/fees

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "fees": {
        "1": {
            "title": "Tax",
            "amount": "12",
            "type": "percent"
        },
        "2": {
            "title": "Deposit",
            "amount": "50",
            "type": "amount_per_booking"
        }
    }
}

Tickets

GET    /events/{id}/tickets

This is a public command, it means all users with an API key can run it.

Request

NameTypeExample
occurrencestringyyyy-mm-dd hh:mm:ss

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "tickets": {
        "1": {
            "name": "Ticket A",
            "ticket_start_time_hour": "08",
            "ticket_start_time_minute": "0",
            "ticket_end_time_hour": "06",
            "ticket_end_time_minute": "0",
            "description": "",
            "private_description": "",
            "price": "8.97",
            "price_label": "$8.97",
            "limit": "",
            "unlimited": "0",
            "seats": "1",
            "minimum_ticket": "1",
            "maximum_ticket": "",
            "stop_selling_value": "0",
            "stop_selling_type": "day",
            "dates": [],
            "ticket_start_time_ampm": "AM",
            "ticket_end_time_ampm": "PM",
            "category_ids": [],
            "id": 1,
            "variations": {
                "1": {
                    "title": "Pizza",
                    "price": "6",
                    "max": "2"
                },
                "2": {
                    "title": "Juice",
                    "price": "4",
                    "max": "3"
                }
            }
        }
    },
    "availability": {
        "1": 100,
        "seats_1": 1,
        "total": 100
    }
}

Share

Report Out Dated Content

If you think the content of this page does not reflect updated information, please let us know.

Report Now
3
Login Submit
0 Comments

No Comment.

Still no luck? We can help!

If you did not find what you were looking for, please submit a ticket in our support system.

Submit a Ticket
Webnus Banner
Modern Events Calendar

Please read our Terms and Conditions and Privacy Policy.

Review us on Trustpilot

Copyright © 2023. All rights reserved. Webnus Inc.