PHP code example of ova-studio / ips-api

1. Go to this page and download the library: Download ova-studio/ips-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ova-studio / ips-api example snippets


'ips' => [
    // ... other options
    'base_uri' => env('IPS_BASE_URI'),
    'api_key' => env('IPS_API_KEY'),
    'default_user' => env('IPS_DEFAULT_USER_ID')
]

$api = new IpsApi();
$to_user_id = 1;

$api->system()->messages()->create($to_user_id, 'Message title', 'Message body');

$api = new IpsApi();
$from_user_id = 1;
$to_user_id = 1;

$api->system()->messages()->withSender($from_user_id)->create($to_user_id, 'Message title', 'Message body');

$api = new IpsApi();
$topic_id = 1;

$api->forums()->posts()->create($topic_id, '<p>Message HTML body</p>');

$api = new IpsApi();
$from_user_id = 1;
$topic_id = 1;

$api->forums()->posts()
        ->withAuthor($from_user_id) // or ->withAuthor(0, 'Somename')
        ->create($to_user_id, 'Message title', 'Message body');