PHP code example of mrferos / zulip-php

1. Go to this page and download the library: Download mrferos/zulip-php 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/ */

    

mrferos / zulip-php example snippets



ent = new \Zulip\Client('http://localhost:9991');
$client->setDefaultAuthentication(new \Zulip\Authentication('[email protected]', '7Rp5bNRVz1dSuDz4HhANaxlpNDcYb6GQ'));
$client->sendMessage([
    'to' => 'Denmark',
    'content' => 'content',
    'type' => \Zulip\Request\MessageParameters::TYPE_STREAM,
    'subject' => 'subject'
]);

// or.. (this is what happens under the code if you pass an array)

$parameters = new \Zulip\Request\MessageParameters();
$parameters->setContent('Content of message');
$parameters->setTo('Denmark');
$parameters->setType(\Zulip\Request\MessageParameters::TYPE_STREAM);
$parameters->setSubject('This is the subject');

$client->sendMessage($parameters);

bash
composer