Forum Discussion

aniketdorwat's avatar
14 years ago

REST API to post new TKB from scratch

Hi Everybody,

 

"Authoring_TKB" pdf mentions that it is possible to write a new TKB articke from scratch, apart from nomination and approving accepted solutions as TKB. Is there any REST API available to author a new TKB article?

 

The PDF is here

https://lithosphere.lithium.com/t5/Documentation-TKB/Admin-Guide-Authoring-Tribal-Knowledge-Base-Articles/ta-p/5900

 

 

Please let me know.

 

Thanks,

Aniket

1 Reply

  • A TKB article is nothing more than a message on a board.  The board just happens to be a TKB.  That means you can use the messages/post API under the Board class to create a new article.  For example, in PHP, this might look like:

     

    function postMessage($board, $author, $body, $subject) {
        $url = $this->param['h'] . '/restapi/vc/boards/id/' . $board . '/messages/post';
    
        $p = $this->default_params;
        $p['post']['message.body'] = $body;
        $p['post']['message.author'] = $author;
        $p['post']['message.subject'] = $subject;
    
        $raw = $this->doREST($url, $p);
    
        return (!$raw) ? false : true;
    }
    
    postMessage('MyBoard@tkb', 'login/username', 'This is a test', 'Test');