Create an Event Driven API REST Call

  • Shawn Lynch
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 2 months ago #149365 by Shawn Lynch
Create an Event Driven API REST Call was created by Shawn Lynch
Need to create an Event driven API REST call using a 3rd party.

Basically, when the "submit" button is click and validation has occurred I need to be able to send the form data to a 3rd party service (an outbound REST call). 

If there's a solution for this already please let me know, otherwise I would need to know what to do and where to do it to ensure this works as needed. Also, need to be able to ensure this isn't overwritten when updates happen (override option).

Thank you.

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
2 years 2 months ago - 2 years 2 months ago #149473 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Create an Event Driven API REST Call
Hello

When a ticket is submitted, the system trigger event onAfterStoreTicket
Code:
PluginHelper::importPlugin('helpdeskpro'); $this->container->app->triggerEvent('onAfterStoreTicket', [$row]);

When a comment is added to a ticket, the system trigger onAfterStoreComment event
Code:
PluginHelper::importPlugin('helpdeskpro'); $this->container->app->triggerEvent('onAfterStoreComment', [$row, $ticket]);

So all you need to do is writing plugin for helpdeskpro group (see some sample plugins under plugins/helpdeskpro folder), listen for these events and pass data to the place you want

Hope it helps

Tuan
Last edit: 2 years 2 months ago by Tuan Pham Ngoc.

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc