Here's basically the same thing being called from an internal script.
PHP Code:
<?php
//stolen from index.php
define('VB_ENTRY', 1);
require_once('includes/vb5/autoloader.php');
vB5_Autoloader::register(dirname(__FILE__));
$app = vB5_Frontend_Application::init('config.php');
error_reporting(E_ALL | E_STRICT);
$config = vB5_Config::instance();
if (!$config->report_all_php_errors) {
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT));
}
$api = Api_InterfaceAbstract::instance();
$input = [
'title' => 'Posting through the API',
'rawtext' => 'My really cool API Post',
'nodeid' => 0,
'parentid' => 3,
'channelid' => 3,
'ret' => '',
'tags' => '',
'reason' => '',
'iconid' => '',
'prefixid' => '',
'hvinput' => '',
'subtype' => '',
'userid' => '1',
'username' => 'User',
];
$options = [];
$nodeId = $api->callApi('content_text', 'add', [$input, $options]);
if(!is_int($nodeId))
{
print_r($nodeId);
exit;
}
print 'Node '. $nodeId . ' created successfully';
This is still just an example of the frontend calling the API. Is this what you're looking for? Or are you trying to call it externally?