Support

Home Forums Event Espresso Premium json – output from /events/ doesnt match docs description

json – output from /events/ doesnt match docs description

Posted: January 25, 2014 at 7:46 am

Viewing 22 reply threads


Tristan Mills

January 25, 2014 at 7:46 am

when querying /events/, trying to get ‘tickets_left’ – that returns null , while instead I have a figure under [prices][remaining] that seems to correspond with the number of tickets allocated, albeit in negative format – whats occurring?


Tristan Mills

January 27, 2014 at 3:57 pm

bump..


Dean

January 29, 2014 at 1:26 am

Hi Tristan,

I’ll ping a developer to see if they can answer this for you.

Please note, we *try* to respond to forum posts in date order, bumping a forum post will only send it to the end of the queue, resulting in a possible longer response time.


Michael Nelson

  • Support Staff

January 29, 2014 at 6:29 pm

hi Tristan, Datetime.ticket_left probably shouldn’t be NULL. What version of the API addon are you using?


Tristan Mills

January 30, 2014 at 4:02 am

2.1p, although i running 3.1.35.2.P EE Core at mo. If you want I can printr the array?


Seth Shoultes

  • Support Staff

January 30, 2014 at 10:27 am

You can also print out the array by appending .pretty_json to the url. Example: https://eventespresso.com/wiki/api-addon/#api_test


Tristan Mills

January 30, 2014 at 12:31 pm

this is what i am getting – for this event the backend shows 33/220 [ie 33 tickets are allocated – all pending or completed] so I would expect the tickets left to be 187 – rather than -10. The -10 figure is actually relating to the number of separate bookings for the event (I have tested) and in the sub array of [prices] the [remaining] figure in both cases is -33 – ie the actual number of tickets sold – I have tested decreasing the number of tickets sold and the [remaining] figure changes to reflect it.

[218] => Array (
[id] => 746
[code] => 1-52cc876e84590
[name] => Bournemouth Show
[description] => The Bournemouth Show
[status] => active
[limit] => 220
[group_registrations_allowed] => 1
[group_registrations_max] => 50
[active] => 1
[member_only] =>
[virtual_url] =>
[call_in_number] =>
[phone] =>
[metadata] => Array (
[default_payment_status] =>
[venue_id] => 5
[additional_attendee_reg_info] => 1
[add_attendee_question_groups] => Array (
[1] => 1
)
[date_submitted] => 07/01/2014
[event_hashtag] =>
[event_format] =>
[event_livestreamed] =>
[_empty_] =>
)
[Datetimes] => Array (
[0] => Array (
[id] => 3615
[is_primary] => 1
[event_start] => 2014-03-22 19:00:00
[event_end] => 2014-03-22 03:00:00
[registration_start] => 2012-09-09 16:00:00
[registration_end] => 2014-03-21 16:00:00
[limit] => 0
[tickets_left] => -10
)
)
[Venues] => Array (
[0] => Array (
[id] => 5
[name] => Bournemouth
[identifier] => 1-528c030615417
[address] => Fir Vale Road
[address2] =>
[city] => Bournemouth
[state] =>
[zip] => BH1 2JA
[country] =>
[user] => 1
)
)
[Categories] => Array (
[0] => Array (
[id] => 3
[name] => Bournemouth
[identifier] => bournemouth
[description] =>
[user] => 1
)
)
[Prices] => Array (
[0] => Array (
[id] => 3615
[name] => General Admission
[amount] => 35
[description] =>
[limit] => 0
[remaining] => -33
[start_date] =>
[end_date] =>
[Pricetype] => Array (
[id] => 1
[name] => Base Price
[is_member] =>
[is_discount] =>
[is_tax] =>
[is_percent] =>
[is_global] => 1
[order] => 0
)
)
[1] => Array (
[id] => 3615.1
[name] => Surcharge for General Admission
[amount] => 1.2
[description] =>
[limit] => 0
[remaining] => -33
[start_date] =>
[end_date] =>
[Pricetype] => Array (
[id] => 2
[name] => Surcharge Amount
[is_member] =>
[is_discount] =>
[is_tax] =>
[is_percent] =>
[is_global] => 1
[order] => 10
)
)
)
)


Tristan Mills

January 30, 2014 at 12:34 pm

when i earlier said tickets left was coming up as null I just meant it wasn’t corresponding with anything meaningful – I only worked out afterwards that it actually is corresponding to the number of bookings [each booking has multiple tickets]


Dean

January 31, 2014 at 4:40 am

Hi Tristan,

It looks like an issue with the latest API, as when swapping from 2.0.4 to 2.1 the issue occurred. I will raise a dev ticket to look into this in more depth.

Thanks for bringing this to our attention!


Tristan Mills

January 31, 2014 at 4:48 am

thank you, please let me know the outcome asap as coding this app for the json api is holding us up on switching to EE.


Dean

January 31, 2014 at 4:52 am

I’ll note the ticket accordingly.


Tristan Mills

February 10, 2014 at 6:53 am

I don’t suppose there is an update on progress on this issue is there?


Michael Nelson

  • Support Staff

February 10, 2014 at 10:35 am

There is actually- we found it was a bug and have a hotfix that’s getting tested right now


Dean

February 14, 2014 at 6:06 am

Testing has looked good, I have passed it back to the developers to check over and add to the next release (hotfix).


Tristan Mills

February 14, 2014 at 6:12 am

great news 🙂


Jonathan Wilson

February 20, 2014 at 3:30 pm

Hi Tristen,

The hotfix has been released. Can you test and let us know if you are still having an issue?


Tristan Mills

February 21, 2014 at 3:18 am

thank you!

where do i get the hotfix from?


Dean

February 21, 2014 at 5:31 am

Hi Tristan,

You can obtain the latest version of any plugin from your Event Espresso account page.


Tristan Mills

February 21, 2014 at 5:38 am

thanks, will let you know how it goes.


Dean

February 21, 2014 at 5:54 am

No problem and please do!


Tristan Mills

February 24, 2014 at 8:01 am

Hi,

With the hotfix api version active the api doesnt respond; in trying to get a session key I get nothing with:
http://mydomain.com/espresso-api/v1/authenticate?username=bla&password=blo

whereas with 2.1p i get
{“status”:”OK”,”status_code”:200,”body”:{“session_key”:”q4cpdlxoey”}}

also, apache log shows:

PHP Fatal error: Call to a member function get() on a non-object in /home/mydomain.com/html/wp-includes/cache.php on line 113

if i switch back to 2.1p the error goes away and i can authenticate and get data


Josh

  • Support Staff

February 24, 2014 at 6:33 pm

Hi there,

Jonathan was not aware that the hotfix for the JSON API had not been released yet. I wanted to let you know that we published it to the site a few hours ago and it’s available to download now.


Tristan Mills

February 25, 2014 at 9:04 am

ah yes – i was using the pre pre version.. doh

the new version is giving valid information now – seems ok but i need to finish the app i am working on to be sure, but at first glance looks fixed, thanks.


Dean

February 26, 2014 at 1:06 am

Please let us know if the situation changes.

Viewing 22 reply threads

The support post ‘json – output from /events/ doesnt match docs description’ 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.

Event Espresso