How to use Foswiki API to access form META data (cell contents) from external system

119 Views Asked by At

I am new to Foswiki and am wondering if it is possible to access the contents of a META form directly using an API call. A simple example of code to do this would be helpful.

1

There are 1 best solutions below

4
On

Do you mean using a REST API or from within Perl?

Here is how to create custom REST API to access a formfield of some source:

(1) Create a topic, say FoswikiAPI, with content:

<verbatim class="tml">
%STARTSECTION{"getformfield"}%%FORMFIELD{
   "%URLPARAM{"formfield"}%"
   topic="%URLPARAM{"source"}%"
}%%ENDSECTION{"getformfield"}%
</verbatim>

(2) call it like this:

http://.../FoswikiAPI?skin=text&section=getformfield&formfield=FooBar&source=SomeWeb.SomeTopic

To read a topic and access its meta data from within perl please have a look at