Closed
Description
Description
Google Chat is a similar to Slack for Google Suite consumers.
Specificities :
- Every message creates a new thread or a response to an existing thread (if the
thread.name
is sent) - Authentication uses Google Signin or webhook url for simplicity.
- 2 exclusive formats : basic or card
API Documentation : https://developers.google.com/hangouts/chat
Example
use Symfony\Component\HttpClient\HttpClient;
$httpClient = HttpClient::create();
$webhookURL = '<INCOMING-WEBHOOK-URL>';
$response = $httpClient->request('POST', $webhookURL, [
'json' => ['text' => 'Hello from a PHP script!'],
])->toArray();
$response = $httpClient->request('POST', $webhookURL, [
'json' => ['text' => 'Response to the thread', 'thread' => ['name' => $response['thread']['name']]],
])->toArray();