Posted: November 21, 2017 at 3:33 am
|
Hi, I need the mobile ticketing app to work with JSON API. However, it does not display any events currently. 1. I have public access set to “allow” I started troubleshooting according to https://eventespresso.com/wiki/json-api-add-on/ . Opening http://testdrive.eventespresso.com/espresso-api/v1/events/public.pretty_json/ { Trying this: gives me: Whenever I do the same but with a previously requested session id, I get the same results. I’d be very grateful for any advice. Jan |
Hi Jan, The error message indicates that the events’ registration_start (and possibly registration_end) values are not correctly formatted. If you check the demo site: http://testdrive.eventespresso.com/espresso-api/v1/events/public.pretty_json/ you’ll see the registration_start values are formatted like this: or YYYY-MM-DD |
|
|
Hi, Thanks for the quick reply. First of all, I noticed that the first link provided is wrong in that it links to your testdrive site instead of my website, but the error message is the same. Now, I am sorry, but I do not fully understand your response. I am not specifying anything in the request itself when trying to pull some events. But even if I do like this: the error message stays the same. {“status”:”Param registration_start with value -0001-11-30 00:01:00 is not of allowed type datetime.”,”status_code”:400} When I type in something like this: I also get: But the resource is “events”, isn’t it? The mobile app (regardless of whether it is iOS or Android) struggles to get any events. Version 2.26 of the Android app says: “No route was found matching the URL and request” Version 2.0 of the Android app logs in successfully, but then shows “0 events shown of 0 loaded” Version 2.6.3 of the iOS app apparently logs in correctly, but states: “Error Occurred, The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible.” I tried deleting the plugin entirely and reinstalling it, but to no avail. Can you further specify how to solve this problem? Where is the date which is formatted wrongly? Did I set up my events incorrectly? Thanks in advance, |
The dates which are formatted wrong are set within the event editor. The dates labeled “Registration Dates” and “Registration Starts On” and “Registration Ends On”. Those dates need to be formatted as follows:
|
|
|
Hi Josh, I set these dates using the datepicker included in the event editor. I do not type them in by hand. What is in a different format is the overall date setting for WordPress, which is DD/MM/YYYY, eg “23/11/2017”. However, as far as I know, the overall WordPress date setting does not influence the EE3 date format. Now, what I usually do, is leave the registration start field blank, since the created event can immediately be made available for registration. The system then applies the beginning of Unix time automatically, which is fine, and it used to work with JSON API. I tried setting the WordPress date format so that it complies with what you wrote, but to no avail. Can you give me any further advice? |
Its likely just one of your events that have a registration date set with the wrong format. One way to find out which event is causing this is to temporarily disable the validation on the date format so that its output to the JSON output and we can find the event ID. To do this you’ll need to use FTP and navigate to \wp-content\plugins\espresso-json-api\includes\helpers\EspressoAPI_Validator.class.php On line 267-272 you should have:
Change Then check your JSON output and search for -0001-11-30 00:01:00 to find the event, find the event id and fix it within the admin. Note the above file should then be reverted back, the validation confirms your data is in the correct format, removing it will cause you more problems in the long run but the above allows you to find the event causing the problem. |
|
|
Thanks a million Tony, What you described allowed me to identify a few of my events having a negative registration_start date. “Datetimes”: [ I assume this is because I worked on later events in a series, leaving the registration start field blank, which led to it taking the beginning of Unix time. Then, according to the recurring events formula, it set the registration start dates for previous events back, leading to the negative dates. At least now, I can identify exactly the problem and fix it. Thanks again. |
|
One last question and this can be close :). Am I right to assume that the newest mobile app (IOS HD version and Android 2.26 version), simply will not work with EE3? Or is there a way to make them work? Problem is that the IOS version of the App, no longer works with IOS 11. It requires an update apparently, but the newer IOS version of the App, won’t work with EE3. Unfortunately we are dependent on the recurring event functionality of EE3, so we cannot upgrade. |
There’s a version of the apps for EE3 and EE4, from the above I think you are referring to the EE4 versions and if so then no they will not work with EE3.
Not if the above is correct, the structure is completely different for each version. In iOS 11 Apple removed support for 32bit apps so the EE3 app won’t work on iOS and updating the EE3 app is not something we are looking into at this time, meaning you would need to use either an older iOS device or android for EE3. |
|
The support post ‘EE3 JSON API error 400’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.