Forum Discussion

Kev_B's avatar
Kev_B
Advisor
10 months ago

Send data to third-party API when posting/updating post

Hi,

I'm exploring automating the Ideas front-end of our community with the different system our product teams use on the back-end.

The first issue I'm attempting to solve - creating an API call when a new idea is posted, or an idea is updated on the community. I think this should flow something like follows:

  • Get the ID when a message is posted/updated (assume I need a POST request)
  • This triggers an endpoint to pull out the message data via GET request and pass relevant information to the third-party API
  • Third-party API receives relevant data and their information is updated

I have two sticking points I'm trying to answer currently:

  1. What's the best way to trigger something from the post page? Is an additional click event on the 'Submit' button acceptable practice?
  2. How do I then get the ID so I can use it in a GET request to get relevant data? (Alternatively - is it better to just grab that data - subject, message body, etc, from the post page?)

Appreciate any input or suggestions. I'm quite new to POST requests, I think I understand the basics, but I can't find anything in developer docs that breaks down the steps I'm trying to take.

Thanks,

  • While you're waiting for Khoros I think you have the right idea already until they provide a better alternative. I have added event listeners to the submit button without any issues.

    However, I don't know of a way to get the id of the post at that point since it doesn't really exist yet. So, I think you might want to grab the info on your own like you suggested in number 2 above directly from the post page.

    Then you would need to use http.client.request (khoros.com) to make an external API call to send out your info.

  • Kev_B We plan to publish Community activity events, including post creation/updation, via a Firehose that customers can utilise and take appropriate actions. I currently do not have an estimated time for this feature to be accessible to our customers, though, as it is still a work in progress.