The MDJM REST API includes a number of endpoints and methods allowing you to access data;
- event (GET/POST)
For accessing a specific events information. More details - events (GET/POST)
For accessing information for multiple events - employee (GET/POST)
For retrieving a specific employees information. More details - client (GET/POST)
For retrieving a specific clients information. More details - availability (GET)
For performing availability checks. More details
Endpoints are used like so;
1 |
http://<yoursite.com>/wp-json/mdjm/v1/<endpoint> |
An example of the events endpoint would therefore be;
1 |
http://yoursite.com/wp-json/mdjm/v1/events/ |
and when combined with your API Key and Token;
1 |
http://yoursite.com/wp-json/mdjm/v1/events/?api_key=03e8d350690c06b6106edc7936bd2b96&token=b35b7c30f56e2975dcc7dc171db90cdb |
Visibility
All endpoints with the exception of availability require the API key and token. Availability checks are intended to be public and therefore no authentication is required.
Responses
All API responses are provided in JSON format. An example response for an API request to the event endpoint would look like;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
{ "data": { "request": { "request": "Retrieve Event", "params": {} }, "event": { "id": 5818, "client": "62", "contract": "7955", "contract_status": "Signed", "cost": { "balance": 0, "balance_status": "Paid", "deposit": "47.50", "deposit_status": "Paid", "remaining_deposit": "0", "cost": "475.00" }, "date": "2016-11-30", "duration": "6 hours", "employees": { "employees": { "1": { "role_slug": "dj", "role": "DJ", "wage": "100.00", "payment_status": { "payment_status": "part-paid", "payment_date": "2016-05-17 16:27:00", "payment_txn": 8043, "payment_amount": "0.00", "txn_id": 0 }, "93": { "role_slug": "mdjm-photographer", "role": "Photographer", "wage": "75", "payment_status": "paid", "txn_id": "" } }, "primary_employee": "1" }, "end_date": "2016-12-01", "end_time": "01:00:00", "equipment": { "package": "Standard Disco", "addons": "White Setup<br />Photobooth" }, "name": "40th Birthday Party", "playlist": { "playlist_enabled": true, "playlist_guest_code": "5dw2Z9cHy", "playlist_status": true }, "setup_date": "2016-11-30", "setup_time": "01:00:00", "source": "Google", "status": "Completed", "start_time": "19:00:00", "type": "Child Birthday Party", "venue": { "id": "8691", "name": "Client Address", "address": [ "Address Line 1", "Address Line 2", "London", "County", "AB1 2CD" ], "contact": "Jonathan King", "details": [ "Low Ceiling", "PAT Required", "PLI Required", "Via Stairs" ], "email": "test@test.com", "phone": "0123456789", "notes": "" } } }, "headers": { "Content-type": "application/json" }, "status": 200 } |
Error Checking
If your API call results in an error, the response will include an error message such as;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
{ "data": { "error": "Event does not exist." }, "headers": { "Content-type": "application/json" }, "status": 200 } |
Rate this Article
We're working hard to ensure we provide you with useful and relevant documentation to help you get the most out of MDJM Event Management.
Please take a moment to let us know if you found this article helpful.