Okay
  Public Ticket #3808659
Why the wp-json send empty info ?
Closed

Comments

  •  2
    amba13 started the conversation

    hi, i try to get information from attendee through the restapi : https://my.bizes.xyz/wp-json/stec/v5/attendance/event-attendance-data/12841/2025-01-30T19:00
    but the are no id or email in the list how to do that please ?

    best regards

  •  924
    Zhivko replied

    Hi,

    The ID and email are intentionally hidden because this REST link is public, and we want to protect your visitors' email addresses from being exposed.


    Stachethemes Developer

  •  2
    amba13 replied

    Hi,

    Thanks for the explanation—I understand, and that’s definitely a great practice. However, I need this for administrative purposes as I want to integrate it with FluentCRM and Uncanny Automator for marketing reasons. I need to list all events—I’ve already found the loop for that—but also to ‘tag’ participants for each event, especially to send emails based on whether they actually attended the event they registered for or not.

  •  924
    Zhivko replied

    Well... what you can do is following:

    Open calendar file: /includes/posts/controllers/class.rest-stec_attend-controller.php

    go to line 737:

    4472773605.png

    and modify it to:

    3686351133.png

     $attendance['attendee_email'] = isset($_GET['secret']) && $_GET['secret'] === 'SECRET_WORD' ? $attendance['attendee_email'] : '';

    With this you can make the restapi to expose the emails by adding ?secret=SECRET_WORD to the url like this:

    https://my.bizes.xyz/wp-json/stec/v5/attendance/event-attendance-data/12841/2025-01-30T19:00?secret=SECRET_WORD

    Of course you can change the SECRET_WORD to whatever you want.


    Stachethemes Developer