You are here

public function ApiClient::postToRocketChat in Rocket.Chat 8

Same name and namespace in other branches
  1. 8.2 modules/rocket_chat_api/src/RocketChat/ApiClient.php \Drupal\rocket_chat_api\RocketChat\ApiClient::postToRocketChat()

Send message to Rocket Chat.

Parameters

string $method: The method to call (so the part after '/api/v1/').

array $options: Optional Data payload. for HTTP_POST calls.

Return value

array Result array.

5 calls to ApiClient::postToRocketChat()
ApiClient::channelsCreate in modules/rocket_chat_api/src/RocketChat/ApiClient.php
Create a new Channel.
ApiClient::login in modules/rocket_chat_api/src/RocketChat/ApiClient.php
Do a Login on the Rocket Chat REST API.
ApiClient::logout in modules/rocket_chat_api/src/RocketChat/ApiClient.php
Logout a session.
ApiClient::postMessage in modules/rocket_chat_api/src/RocketChat/ApiClient.php
Send a Message to the rocketchat.
ApiClient::sudo in modules/rocket_chat_api/src/RocketChat/ApiClient.php
Execute as different user.

File

modules/rocket_chat_api/src/RocketChat/ApiClient.php, line 180

Class

ApiClient
Class ApiClient.

Namespace

Drupal\rocket_chat_api\RocketChat

Code

public function postToRocketChat($method = "info", array $options = []) {
  return $this
    ->sendToRocketChat(ApiClient::HTTP_POST, $method, $options);
}