Web-API:Knowledgebase Articles
From Cerberus Helpdesk Wiki
Contents |
Knowledgebase Articles
Create
- content (string)
- format (integer; 0=Plaintext, 1=HTML, 2=Markdown)
- title (string)
- updated (timestamp)
- views (integer)
- custom_*
$postfields = array( array('title','New KB Article'), array('content',"#Header#\n\n**BOLD**\n\n_Italics_\n\nSome list\n\n1. One\n1. Two\n1. Three\n"), array('format',"2"), array('category_id[]','+661'), array('category_id[]','662'), //array('custom_1','Americas'), ); $out = $cerb5->post($base_url . 'kbarticles/create.xml', $postfields);
Retrieve
$out = $cerb5->get($base_url . 'kbarticles/4.xml');
Update
- content (string)
- format (integer; 0=Plaintext, 1=HTML, 2=Markdown)
- title (string)
- updated (timestamp)
- views (integer)
- custom_*
$postfields = array( array('title','New KB Article Title via API'), array('views','100'), array('content',"<h1>Header</h1><br><b>BOLD</b><br><i>Italics</i><br>Some list<br><ol><li>One</li><li>Two</li><li>Three</li></ol>"), array('format',"1"), array('category_id[]','-661'), array('category_id[]','-662'), //array('custom_1','Europe'), ); $out = $cerb5->put($base_url . 'kbarticles/2.xml', $postfields);
Search
- category_id (integer)
- content (string)
- id (integer)
- format (integer; 0=Plaintext, 1=HTML, 2=Markdown)
- title (string)
- updated (timestamp)
- views (integer)
$postfields = array( // array('criteria[]','category_id'), // array('oper[]','='), // array('value[]','957'), array('criteria[]','content'), array('oper[]','fulltext'), array('value[]','+html +header1'), // array('criteria[]','title'), // array('oper[]','like'), // array('value[]','*mailparse*'), array('sortBy','id'), array('sortAsc','1'), array('page','1'), ); $out = $cerb5->post($base_url . 'kbarticles/search.xml', $postfields);