Support

Home Forums Event Espresso Premium Get registration questions/answers using json api?

Get registration questions/answers using json api?

Posted: April 12, 2014 at 8:08 am

Viewing 2 reply threads


genesisfan

April 12, 2014 at 8:08 am

I just started using the api and it’s great – it gets me almost all the way to where I need to go. However, the page I’m working on needs to check the answer to a particular registration question for each attendee before proceeding. I can get the attendees using the api, but according to the docs it looks like the ‘answers’ endpoint has yet to be written. I assume I’ll have to use php, which is no problem, but I’m not sure how to best structure my code to retrieve this particular answer. Can you point me in the right direction?


Tony

  • Support Staff

April 14, 2014 at 4:34 am

Hi genesisfan,

You could write your own custom Query to do this but Event Espresso has a shortcode built into core that will pull the answer for you – [EE_ANSWER]

EE_ANSWER requires the Question ID for your specific question (q=”Question_ID”) and the Attendee ID to pull the answer for (a=”Attendee_ID”). So if you have the Attendee ID stored within $id and the Question ID is 12 you could do something like this:

$custom_question_answer = do_shortcode(‘[EE_ANSWER q=”12″ a=”‘.$id.'”]’);

Which will store the answer within $custom_question_answer.

You can find the Question ID by looking within Event Espresso -> Questions. Click on the custom question, you’ll find question_id within the URL.

Does that help?


genesisfan

April 16, 2014 at 5:54 am

That’s very helpful, thank you very much!

Viewing 2 reply threads

The support post ‘Get registration questions/answers using json api?’ 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