Okay
  Public Ticket #2582869
Send webhook data to api
Closed

Comments

  • Raul started the conversation

    Hi,

    my client needs to send the appointment webhook data to their API, they told me to use jwt to do this. 

    Can you guys help me to do that? We dont want to use zapier or something like that because they have a lot of appointments so it will be to much money.


    How can i send the webhook data to an api? 

  • [deleted] replied

    Hello Raul,

    You can use the Web hooks feature with any automation tool, that could catch data via a hook, we just provided an example using Zapier, but any automation tool that has such possibility would do. You need to check in that tool how it can catch data via a hook, and in Amelia you need to create a hook for the action you want in Amelia -> Settings -> Integrations -> Web hooks and provide the URL that you take from that tool (which will catch the hook) to the provided URL field. So with this URL you are connecting Amelia and that other tool. This is it from Amelia's side, you need to check in the other program/tool that you will use for this/ how it works and how to take/create a URL that should be provided in Amelia for this purpose.

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help out.

  • Raul replied

    Yeah i know....

    automation tools, but i need to send the data with the credentials of their api inside. In this way we will be able to bypass those automation tools that are really expensive if you are sending a lot of data.


    There is a way to do that?

  • [deleted] replied

    Unfortunately, there isn't such possibility in Amelia with its current built-in features. These web hooks can be connected to a tool that functions in the same way, that can catch data via a hook through URL.

    You can maybe use WordPress hooks for this purpose, we implemented this possibility in the last update of Amelia.

  • Raul replied

    Marija,

    Where can i find that information?

  • [deleted] replied

    Hi Raul,

    If you are asking about the WP hooks, these are the hooks in Amelia, and this should be added to  "wp-content/mu-plugins/functions.php"

    <?php
    function amelia_booking_added_hook($reservation, $bookings, $container) {
    }
    add_action('AmeliaBookingAdded', 'amelia_booking_added_hook', 10, 3);
    function amelia_booking_time_updated_hook($reservation, $bookings, $container) {
    }
    add_action('AmeliaBookingTimeUpdated', 'amelia_booking_time_updated_hook', 10, 3);
    function amelia_booking_status_updated_hook($reservation, $bookings, $container) {
    }
    add_action('AmeliaBookingStatusUpdated', 'amelia_booking_status_updated_hook', 10, 3);
    function amelia_booking_canceled_hook($reservation, $bookings, $container) {
    }
    add_action('AmeliaBookingCanceled', 'amelia_booking_canceled_hook', 10, 3);
    ?>

    So, these functions will be triggered after these actions: booking, cancelling, time update, status update

    $reservation has data about the appointment (startTime, endTime...)

    $bookings contains data about the bookings that started the action (from the front-end there will be one booking, and in the back-end there can be more, if a group appointment is created)

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help out.

  • Raul replied

    Thanks for the help Marija

  • [deleted] replied

    You are welcome, Raul.

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help out.

  • Raul replied

    about that...

    im waiting for help in other tickets but nothing :(

  • [deleted] replied

    Hello Raul, 

    Apologies for replying a bit later, we don't work on weekends. I see the other tickets are responded. Please note that we respond to the tickets in the order we get them, and the response time can vary based on the number of tickets that we have at the moment. There are several support agents, so the number of tickets that we can have at some moment, can vary as well. We try to get back to you as soon as we can. Thank you for understanding!

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help.