Posted: April 3, 2019 at 4:53 pm
|
I can easily relate a Venue to Event via the REST API: Post to //…/wp-json/ee/v4.8.29/event_venues/ with: 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? |
|
Anyone? |
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? |
|
|
I’ll give that a shot. Thanks! |
|
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: |
The documentation actually shows to use v4.8.36. I do not think the write endpoints were included in v4.8.29. |
|
|
So I need to upgrade Espresso? |
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` |
|
|
The version number made no difference. DELETE `https://…/wp-json/ee/v4.8.36/events/1032/event_venues/598` The response I get is: {“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method”,”data”:{“status”:404}} |
is the syntax if you’re removing venue ID 598 from event ID 1032 |
|
|
That worked, thank you. |
The support post ‘REST API Change an existing Event Venue’ 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.