{"id":11767,"date":"2025-03-01T07:48:21","date_gmt":"2025-03-01T07:48:21","guid":{"rendered":"https:\/\/webnus.net\/dox\/modern-events-calendar\/?post_type=knowledgebase&#038;p=11767"},"modified":"2026-01-31T14:56:02","modified_gmt":"2026-01-31T14:56:02","slug":"mec-restful-api","status":"publish","type":"knowledgebase","link":"https:\/\/webnus.net\/dox\/modern-events-calendar\/mec-restful-api\/","title":{"rendered":"MEC Restful API"},"content":{"rendered":"\n<p>The <strong>RESTful API<\/strong> in Modern Events Calendar allows developers to programmatically access, retrieve, and manage event data from external applications, websites, or services. It provides a structured and standardized way to interact with MEC data (such as events, locations, organizers, and schedules) without relying on the WordPress interface. This makes it suitable for integrations with mobile apps, third-party platforms, or custom front-end implementations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Base_URL\"><\/span><a><\/a>Base URL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The base URL is different per website but the general pattern is like the following.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;example.com\/wp-json\/mec\/v1.0<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"API_Key\"><\/span>API Key<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The API key is required for all the following commands. You should send the API key in headers with the name of <strong>mec-token<\/strong> If you don\u2019t send mec-token in headers then you will receive an <strong>invalid_api_token<\/strong> error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"All_Events\"><\/span><a><\/a>All Events<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/events\/<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Send the following parameters as JSON.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Accepted Values<\/strong><\/td><td><strong>Example<\/strong><\/td><\/tr><tr><td>limit<\/td><td>integer<\/td><td>&nbsp;<\/td><td>12<\/td><\/tr><tr><td>order<\/td><td>string<\/td><td>ASC \/ DESC<\/td><td>ASC<\/td><\/tr><tr><td>offset<\/td><td>integer<\/td><td>&nbsp;<\/td><td>0<\/td><\/tr><tr><td>start<\/td><td>string<\/td><td>today \/ date \/ tomorrow \/ yesterday\/ start_last_month \/ start_current_month \/ start_next_month<\/td><td>date<\/td><\/tr><tr><td>start_date<\/td><td>string<\/td><td>(yyyy-mm-dd)<\/td><td>2024-12-15<\/td><\/tr><tr><td>show_only_past_events<\/td><td>integer<\/td><td>0,1<\/td><td>0<\/td><\/tr><tr><td>include_past_events<\/td><td>integer<\/td><td>0,1<\/td><td>0<\/td><\/tr><tr><td>show_only_ongoing_events<\/td><td>integer<\/td><td>0,1<\/td><td>0<\/td><\/tr><tr><td>include_ongoing_events<\/td><td>integer<\/td><td>0,1<\/td><td>0<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You will receive all events in the <strong>events<\/strong> 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.<\/p>\n\n\n\n<p>You can also use the pagination key of the response to read all events page by page. Just send the <strong>next_date<\/strong> value as <strong>start_date<\/strong> of your next request and send <strong>next_offset<\/strong> as the value of the <strong>offset<\/strong> parameter.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n   \"events\": {\n      \"2025-01-15\": &#91;{ ... }],\n\t...\n   },\n   \"pagination\": {\n       \"next_date\": \"2025-12-15\",\n       \"next_offset\": 1,\n       \"has_more_events\": true,\n       \"found\": 12\n   }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Single_Event\"><\/span>Single Event<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/events\/{id}<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-2\"><\/span><a><\/a>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Send the following parameters as a query string.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Example<\/strong><\/td><\/tr><tr><td>id <strong>*<\/strong><\/td><td>integer<\/td><td>1<\/td><\/tr><tr><td>occurrence<\/td><td>integer<\/td><td>1747335600<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-2\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You will receive a bunch of information included but not limited to the following. The <strong>data<\/strong> key has many useful information about the event that you can use in your application. The <strong>dates<\/strong> 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 <strong>date<\/strong> key holds information about the current occurrence.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n   \"ID\": 1,\n   \"data\": { ... },\n   \"dates\": &#91;{\n     \"start\": {\n         \"date\": \"2025-05-15\",\n         \"hour\": 7,\n         \"minutes\": \"0\",\n         \"ampm\": \"PM\",\n         \"timestamp\": 1747335600\n     },\n     \"end\": {\n         \"date\": \"2025-05-15\",\n         \"hour\": 11,\n         \"minutes\": \"0\",\n         \"ampm\": \"PM\",\n         \"timestamp\": 1747350000\n     },\n     \"allday\": \"0\",\n     \"hide_time\": \"0\",\n     \"past\": 0\n   }],\n   \"date\": {}\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Login\"><\/span>Login<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>POST<\/strong>    \/login<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-3\"><\/span><a><\/a>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Send the following parameters as regular-form data.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Example<\/strong><\/td><\/tr><tr><td>username <strong>*<\/strong><\/td><td>string<\/td><td>user<\/td><\/tr><tr><td>password <strong>*<\/strong><\/td><td>string<\/td><td>12345678<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-3\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Use the <strong>token<\/strong> to authorize users in other commands. You should send it as a new header named <strong>user-token<\/strong> for those commands that require authentication like my-events or trash events commands.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n&nbsp;&nbsp; \"success\": 1,\n&nbsp;&nbsp; \"id\": 1,\n&nbsp;&nbsp; \"token\": \"W2X53XpClol8TquAIKWaZo0j68L0tuho3o4wmwD0\"\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Upload_Image\"><\/span>Upload Image<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>POST<\/strong>&nbsp;&nbsp;&nbsp; \/images<\/code><\/pre>\n\n\n\n<p>Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-4\"><\/span><a><\/a>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Send following parameters as JSON.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Example<\/strong><\/td><\/tr><tr><td>image <strong>*<\/strong><\/td><td>file<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-4\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Use the <strong>image_id<\/strong> in other commands like creating events, etc.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"image_id\": 10\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Upload_File\"><\/span>Upload File<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>POST<\/strong>&nbsp;&nbsp;&nbsp; \/files<\/code><\/pre>\n\n\n\n<p>Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-5\"><\/span><a><\/a>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Send the following parameters as JSON.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Example<\/strong><\/td><\/tr><tr><td>file <strong>*<\/strong><\/td><td>file<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-5\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Use the <strong>file_id<\/strong> in other commands like creating events, etc.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"file_id\": 10\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_Event\"><\/span>Create Event<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>POST<\/strong>    \/events<\/code><\/pre>\n\n\n\n<p>Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-6\"><\/span><a><\/a>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Send the following parameters as JSON.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Example<\/strong><\/td><\/tr><tr><td>title <strong>*<\/strong><\/td><td>string<\/td><td>Event Title<\/td><\/tr><tr><td>content<\/td><td>string<\/td><td>Event Content<\/td><\/tr><tr><td>location[name]<\/td><td>string<\/td><td>Art Gallery<\/td><\/tr><tr><td>location[address]<\/td><td>text<\/td><td>Art Gallery, City<\/td><\/tr><tr><td>location[latitude]<\/td><td>float<\/td><td><\/td><\/tr><tr><td>location[longitude]<\/td><td>float<\/td><td><\/td><\/tr><tr><td>location[thumbnail]<\/td><td>int<\/td><td>10<\/td><\/tr><tr><td>organizer[name]<\/td><td>string <\/td><td>John Due<\/td><\/tr><tr><td>organizer[email] <\/td><td>email <\/td><td>john.due@gmail.com<\/td><\/tr><tr><td>organizer[tel]<\/td><td>tel <\/td><td>+13007772299<\/td><\/tr><tr><td>organizer[url]<\/td><td>url <\/td><td>https:\/\/google.com<\/td><\/tr><tr><td>organizer[thumbnail]<\/td><td>number <\/td><td>10<\/td><\/tr><tr><td>start_date<\/td><td>date (yyyy-mm-dd)<\/td><td>2025-06-01<\/td><\/tr><tr><td>start_hour<\/td><td>int<\/td><td>10<\/td><\/tr><tr><td>start_minutes<\/td><td>int<\/td><td>15<\/td><\/tr><tr><td>start_ampm<\/td><td>string <\/td><td>AM<\/td><\/tr><tr><td>end_date<\/td><td>date (yyyy-mm-dd)<\/td><td>2025-06-01<\/td><\/tr><tr><td>end_hour<\/td><td>int<\/td><td>2<\/td><\/tr><tr><td>end_minutes<\/td><td>int<\/td><td>45<\/td><\/tr><tr><td>end_ampm<\/td><td>string<\/td><td>PM<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-6\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Use the <strong>event_id<\/strong> in other commands like get single event, etc.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"message\": \"The event is published.\",\n    \"event_id\": 12\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Edit_Event\"><\/span>Edit Event<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>PUT<\/strong>&nbsp;&nbsp;&nbsp; \/events\/{id}<\/code><\/pre>\n\n\n\n<p>Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-7\"><\/span><a><\/a>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The request is exactly like the create event command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-7\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The response is also exactly like the create event command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"My_Events\"><\/span><a><\/a>My Events<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>&nbsp;&nbsp;&nbsp; \/my-events<\/code><\/pre>\n\n\n\n<p>Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-8\"><\/span><a><\/a>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Send the following parameters as JSON.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Example<\/strong><\/td><\/tr><tr><td>limit <strong>*<\/strong><\/td><td>integer<\/td><td>12<\/td><\/tr><tr><td>pages <strong>*<\/strong><\/td><td>integer<\/td><td>1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-8\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can loop through the events to display all events. Use the pagination data to navigate through the pages of events.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n&nbsp;&nbsp; \"events\": &#91;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"id\": 2645,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"title\": \"Monthly\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"url\": \"http:\/\/example.com\/events\/monthly\/\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"status\": \"publish\"\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n&nbsp;&nbsp; ],\n&nbsp;&nbsp; \"pagination\": {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"current_page\": 2,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"total_pages\": 5\n&nbsp;&nbsp; }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Trash_Event\"><\/span><a><\/a>Trash Event<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>DELETE<\/strong>    \/events\/{id}\/trash<\/code><\/pre>\n\n\n\n<p>Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-9\"><\/span><a><\/a>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-9\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n&nbsp;&nbsp; \"success\": 1\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Delete_Event\"><\/span><a><\/a>Delete Event<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>DELETE<\/strong>    \/events\/{id}<\/code><\/pre>\n\n\n\n<p>Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.<\/p>\n\n\n\n<p>This command will force delete an event. It doesn\u2019t matter if the event is already trashed or not.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-10\"><\/span><a><\/a>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-10\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n&nbsp;&nbsp; \"success\": 1\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Custom_Fields\"><\/span>Custom Fields<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/config\/custom-fields<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-11\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-11\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"fields\": {\n        \"1\": {\n            \"mandatory\": \"1\",\n            \"type\": \"text\",\n            \"label\": \"Your Comment\"\n        },\n        \"2\": {\n            \"mandatory\": \"0\",\n            \"type\": \"date\",\n            \"label\": \"Preferred Date\"\n        },\n        \"3\": {\n            \"mandatory\": \"0\",\n            \"ignore\": \"0\",\n            \"type\": \"select\",\n            \"label\": \"Gender\",\n            \"options\": {\n                \"1\": {\n                    \"label\": \"Male\"\n                },\n                \"2\": {\n                    \"label\": \"Female\"\n                }\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Icons\"><\/span>Icons<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/config\/icons<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-12\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-12\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"icons\": &#91;\n        {\n            \"name\": \"Location Marker Icon\",\n            \"default\": \"&lt;i class=\\\"mec-sl-location-pin\\\"&gt;&lt;\/i&gt;\",\n            \"modules\": &#91;\n                \"single\",\n                \"shortcode\"\n            ],\n            \"value\": \"&lt;img class=\\\"mec-custom-image-icon\\\" src=\\\"http:\/\/site.com\/wp-content\/uploads\/2025\/03\/location.jpg\\\" alt=\\\"location-pin\\\"&gt;\"\n        }\n    ]\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Weather\"><\/span>Weather<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/events\/{id}\/weather<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-13\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Send following parameters as query string.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Example<\/strong><\/td><\/tr><tr><td>date<\/td><td>string<\/td><td>yyyy-mm-dd<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-13\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"weather\": {\n        \"icon\": \"\/\/cdn.weatherapi.com\/weather\/64x64\/day\/113.png\",\n        \"condition\": \"Sunny\",\n        \"temp_c\": 13.699999999999999,\n        \"temp_f\": 56.700000000000003,\n        \"wind_kph\": 9,\n        \"wind_mph\": 5.5999999999999996,\n        \"humidity\": 58,\n        \"feelslike_c\": 13.199999999999999,\n        \"feelslike_f\": 55.799999999999997\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Related_Events\"><\/span>Related Events<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/events\/{id}\/related-events<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-14\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-14\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"related_events\": &#91;\n        {\n            \"id\": 21,\n            \"title\": \"Daily Event\",\n            \"url\": \"http:\/\/site.com\/events\/daily-event\/\",\n            \"timestamp\": 1746432000,\n            \"date\": \"May 5, 2025\"\n        }\n    ]\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Next_Previous_Events\"><\/span>Next \/ Previous Events<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/events\/{id}\/next-previous-events<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-15\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-15\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"next\": {\n        \"id\": \"21\",\n        \"title\": \"Daily Event\",\n        \"url\": \"http:\/\/rezamiri.test\/events\/daily-event\/\"\n    },\n    \"previous\": &#91;]\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Next_Occurrences\"><\/span>Next Occurrences<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/events\/{id}\/next-occurrences<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-16\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-16\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"occurrences\": &#91;\n        {\n            \"start\": {\n                \"date\": \"2025-05-10\",\n                \"hour\": \"8\",\n                \"minutes\": \"0\",\n                \"ampm\": \"AM\",\n                \"timestamp\": 1746864000\n            },\n            \"end\": {\n                \"date\": \"2025-05-10\",\n                \"hour\": 6,\n                \"minutes\": \"0\",\n                \"ampm\": \"PM\",\n                \"timestamp\": 1746900000\n            },\n            \"allday\": \"0\",\n            \"hide_time\": \"0\",\n            \"past\": 0\n        }\n    ]\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Attendee_Fields\"><\/span>Attendee Fields<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/config\/attendee-fields<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-17\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-17\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"fields\": &#91;\n        {\n            \"mandatory\": \"1\",\n            \"type\": \"mec_email\",\n            \"label\": \"Email\"\n        },\n        {\n            \"mandatory\": \"1\",\n            \"type\": \"name\",\n            \"label\": \"Name\"\n        },\n        {\n            \"mandatory\": \"0\",\n            \"type\": \"textarea\",\n            \"label\": \"Text\",\n            \"mapping\": \"\"\n        }\n    ]\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Fixed_Fields\"><\/span>Fixed Fields<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/config\/fixed-fields<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-18\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-18\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"fields\": {\n        \"1\": {\n            \"mandatory\": \"0\",\n            \"type\": \"text\",\n            \"label\": \"Text\"\n        },\n        \"2\": {\n            \"mandatory\": \"1\",\n            \"type\": \"date\",\n            \"label\": \"Date\"\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ticket_Variations\"><\/span>Ticket Variations<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/config\/ticket-variations<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-19\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-19\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"ticket_variations\": {\n        \"1\": {\n            \"title\": \"Pizza\",\n            \"price\": \"6\",\n            \"max\": \"2\"\n        },\n        \"2\": {\n            \"title\": \"Juice\",\n            \"price\": \"4\",\n            \"max\": \"3\"\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Booking_Tax_Fees\"><\/span>Booking Tax \/ Fees<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/events\/{id}\/fees<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-20\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>None.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-20\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"fees\": {\n        \"1\": {\n            \"title\": \"Tax\",\n            \"amount\": \"12\",\n            \"type\": \"percent\"\n        },\n        \"2\": {\n            \"title\": \"Deposit\",\n            \"amount\": \"50\",\n            \"type\": \"amount_per_booking\"\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Tickets\"><\/span>Tickets<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET<\/strong>    \/events\/{id}\/tickets<\/code><\/pre>\n\n\n\n<p>This is a public command, it means all users with an API key can run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Request-21\"><\/span>Request<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Example<\/strong><\/td><\/tr><tr><td>occurrence<\/td><td>string<\/td><td>yyyy-mm-dd hh:mm:ss<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Response-21\"><\/span><a><\/a>Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"success\": 1,\n    \"tickets\": {\n        \"1\": {\n            \"name\": \"Ticket A\",\n            \"ticket_start_time_hour\": \"08\",\n            \"ticket_start_time_minute\": \"0\",\n            \"ticket_end_time_hour\": \"06\",\n            \"ticket_end_time_minute\": \"0\",\n            \"description\": \"\",\n            \"private_description\": \"\",\n            \"price\": \"8.97\",\n            \"price_label\": \"$8.97\",\n            \"limit\": \"\",\n            \"unlimited\": \"0\",\n            \"seats\": \"1\",\n            \"minimum_ticket\": \"1\",\n            \"maximum_ticket\": \"\",\n            \"stop_selling_value\": \"0\",\n            \"stop_selling_type\": \"day\",\n            \"dates\": &#91;],\n            \"ticket_start_time_ampm\": \"AM\",\n            \"ticket_end_time_ampm\": \"PM\",\n            \"category_ids\": &#91;],\n            \"id\": 1,\n            \"variations\": {\n                \"1\": {\n                    \"title\": \"Pizza\",\n                    \"price\": \"6\",\n                    \"max\": \"2\"\n                },\n                \"2\": {\n                    \"title\": \"Juice\",\n                    \"price\": \"4\",\n                    \"max\": \"3\"\n                }\n            }\n        }\n    },\n    \"availability\": {\n        \"1\": 100,\n        \"seats_1\": 1,\n        \"total\": 100\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The RESTful API in Modern Events Calendar allows developers to programmatically access, retrieve, and manage event data from external applications, websites, or services. It provides a structured and standardized way to interact with MEC data (such as events, locations, organizers, and schedules) without relying on the WordPress interface. This makes it suitable for integrations with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","knowledgebase_cat":[50],"class_list":["post-11767","knowledgebase","type-knowledgebase","status-publish","hentry","knowledgebase_cat-developer-other"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/webnus.net\/dox\/modern-events-calendar\/wp-json\/wp\/v2\/knowledgebase\/11767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webnus.net\/dox\/modern-events-calendar\/wp-json\/wp\/v2\/knowledgebase"}],"about":[{"href":"https:\/\/webnus.net\/dox\/modern-events-calendar\/wp-json\/wp\/v2\/types\/knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/webnus.net\/dox\/modern-events-calendar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webnus.net\/dox\/modern-events-calendar\/wp-json\/wp\/v2\/comments?post=11767"}],"version-history":[{"count":10,"href":"https:\/\/webnus.net\/dox\/modern-events-calendar\/wp-json\/wp\/v2\/knowledgebase\/11767\/revisions"}],"predecessor-version":[{"id":12871,"href":"https:\/\/webnus.net\/dox\/modern-events-calendar\/wp-json\/wp\/v2\/knowledgebase\/11767\/revisions\/12871"}],"wp:attachment":[{"href":"https:\/\/webnus.net\/dox\/modern-events-calendar\/wp-json\/wp\/v2\/media?parent=11767"}],"wp:term":[{"taxonomy":"knowledgebase_cat","embeddable":true,"href":"https:\/\/webnus.net\/dox\/modern-events-calendar\/wp-json\/wp\/v2\/knowledgebase_cat?post=11767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}