http://qs1969.pair.com?node_id=11141504

programmingzeal has asked for the wisdom of the Perl Monks concerning the following question:

I am new to foswiki. I want to create a topic on foswiki instance running on web server on local machine with data coming from external system. The new topic data will be sent via POST request from external system to this local machine's (server URL) port XXXX. When the data arrives at the port XXXX some how a new topic or update topic (if exist) event should be triggered on foswiki local instance. How can I achieve this?

I understand that I have to use Perl/CGI Sockets for communication between the two machines but when the payload arrives from client to server, how to trigger an event that will cause updation in foswiki local instance?

Are there any tutorials and CPAN APIs available?

The client and server machines are on LAN

I found a post on foswiki forum similar to my task but the code link there is not working https://foswiki.org/Support/Question1221

Replies are listed 'Best First'.
Re: Create New Topic in Foswiki server based on input from external system
by marto (Cardinal) on Feb 20, 2022 at 12:47 UTC

      I have read the two pages. Also, I did some search and arrived at the conclusion that I have to write a new plugin which acts as a REST CGI script.

      https://foswiki.org/System/DevelopingPlugins#Creating_New_Plugins

      What I understand is that I have to write a script as a Plugin which listens on port XXXX or maybe a cronjob on local web server or maybe when client sends a POST query to the foswiki REST script URL with payload it executes function to create new topic.