Support

Home Forums Event Espresso Premium REST API Change an existing Event Venue

REST API Change an existing Event Venue

Posted: April 3, 2019 at 4:53 pm


gncares

April 3, 2019 at 4:53 pm

I can easily relate a Venue to Event via the REST API:

Post to https://…/wp-json/ee/v4.8.29/event_venues/

with:
{ “EVT_ID”: “1029”, “VNU_ID”: “488”}

However, if there is already a Venue related to the event it doesn’t change the venue.

What do I need to do to get it to change which venue is associated with the event?


gncares

April 8, 2019 at 1:35 am

Anyone?


Josh

  • Support Staff

April 8, 2019 at 9:12 am

Hi,

You mentioned doing a POST request but the documentation says to PUT or PATCH when updating an entity. Have you tried sending either a PUT or a PATCH request?


gncares

April 8, 2019 at 5:13 pm

I’ll give that a shot. Thanks!


gncares

April 9, 2019 at 4:35 pm

Using PUT didn’t help. I get a 404 error.

So now I’m looking at the venues related to the event and I’m trying to delete the relationships.

DELETE https://…/wp-json/ee/v4.8.29/events/1031/event_venues/598

and I’m getting a 404 Error for that. The EventID is 1031, the Venue ID is 598.

My DELETE was based on the documentation here:

https://github.com/eventespresso/event-espresso-core/blob/master/docs/C–REST-API/ee4-rest-api-editing-relations.md


Josh

  • Support Staff

April 9, 2019 at 10:16 pm

The documentation actually shows to use v4.8.36. I do not think the write endpoints were included in v4.8.29.


gncares

April 9, 2019 at 11:05 pm

So I need to upgrade Espresso?


Tony

  • Support Staff

April 10, 2019 at 1:50 am

No, theres mutliple version of the EE REST API and right now you are using v4.8.29:

DELETE https://…/wp-json/ee/v4.8.29/events/1031/event_venues/598

The latest version of the API is v4.8.36

DELETE https://…/wp-json/ee/v4.8.36/events/1031/event_venues/598
v4.8.36


gncares

April 10, 2019 at 3:04 pm

The version number made no difference.

DELETE https://…/wp-json/ee/v4.8.36/events/1032/event_venues/598
{ “force”: “1” }

The response I get is:

{“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method”,”data”:{“status”:404}}


Josh

  • Support Staff

April 11, 2019 at 8:01 pm

DELETE /wp-json/ee/v4.8.36/events/1032/venues/598

is the syntax if you’re removing venue ID 598 from event ID 1032


gncares

April 12, 2019 at 1:00 am

That worked, thank you.

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: publish

Updated by  gncares 1 week, 1 day ago ago

Topic Tags

Tagged: 

Notifications

This topic is:
pending
Do NOT follow this link or you will be banned from the site!