Support

Home Forums Event Espresso Premium How to obtain a Custom Field value for an event using the API?

How to obtain a Custom Field value for an event using the API?

Posted: January 1, 2021 at 7:02 pm


Kevin Pinto

January 1, 2021 at 7:02 pm

I have defined a custom field named OnlineURL for an event as shown in the picture.

Custom Field screenshot

How do I obtain this using the API? I am able to get many Event fields, but cannot figure out where this field value is stored.


Kevin Pinto

January 1, 2021 at 7:03 pm

Link to the image is here


Tony

  • Support Staff

January 4, 2021 at 5:09 am

Hi there,

Which API are you referring to? REST API?

If so you’ll need to send an authenticated request to:

/wp-json/ee/v4.8.36/events/{event_id}/post_metas

Is that what you are looking for?


Kevin Pinto

January 10, 2021 at 6:58 pm

Yes, the REST API.

Is there an easy guide to REST API authentication?


Tony

  • Support Staff

January 11, 2021 at 7:48 am

Using PHP?

You send an additional ‘Authorization’ with the username:password base64 encoded like so:

'Authorization' => 'Basic ' . base64_encode( 'username:password' )

There some details here:

https://code.tutsplus.com/tutorials/wp-rest-api-setting-up-and-using-basic-authentication–cms-24762

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  Tony 2 weeks ago ago

Topic Tags

Tagged: ,

Notifications

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