Download the PHP package serafim/gitter-api without Composer
On this page you can find all versions of the php package serafim/gitter-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package gitter-api
Gitter API Client 4.0
Installation
composer require serafim/gitter-api
Creating a Gitter Client
Resources
Example
Streaming
Available resources
Groups
List groups the current user is in.
$client->groups->all(): array
List of rooms nested under the specified group.
$client->groups->rooms(string $roomId): array
Messages
List of messages in a room in historical reversed order.
$client->messages->all(string $roomId[, string $query]): \Generator
There is also a way to retrieve a single message using its id.
$client->messages->find(string $roomId, string $messageId): array
Send a message to a room.
$client->messages->create(string $roomId, string $content): array
Update a message.
$client->messages->update(string $roomId, string $messageId, string $content): array
Delete a message.
$client->messages->delete(string $roomId, string $messageId): array
Rooms
List rooms the current user is in.
$client->rooms->all([string $query]): array
Join user into a room.
$client->rooms->joinUser(string $roomId, string $userId): array
Join current user into a room.
$client->rooms->join(string $roomId): array
Join current user into a room by room name (URI).
$client->rooms->joinByName(string $name): array
Find room by room name (URI).
$client->rooms->findByName(string $name): array
Kick user from target room.
$client->rooms->kick(string $roomId, string $userId): array
This can be self-inflicted to leave the the room and remove room from your left menu.
$client->rooms->leave(string $roomId): array
Sets up a new topic of target room.
$client->rooms->topic(string $roomId, string $topic): array
Sets the room is indexed by search engines.
$client->rooms->searchIndex(string $roomId, bool $enabled): array
Sets the tags that define the room
$client->rooms->tags(string $roomId, array $tags): array
If you hate one of the rooms - you can destroy it!
$client->rooms->delete(string $roomId): array
List of users currently in the room.
$client->rooms->users(string $roomId[, string $query]: \Generator
Use the streaming API to listen events.
$client->rooms->events(string $roomId): Observer
Use the streaming API to listen messages.
$client->rooms->messages(string $roomId): Observer
Users
Returns the current user logged in.
$client->users->current(): array
$client->users->currentUserId(): string
List of Rooms the user is part of.
$client->users->rooms([string $userId]): array
You can retrieve unread items and mentions using the following endpoint.
$client->users->unreadItems(string $roomId[, string $userId]): array
There is an additional endpoint nested under rooms that you can use to mark chat messages as read
$client->users->markAsRead(string $roomId, array $messageIds[, string $userId]): array
List of the user's GitHub Organisations and their respective Room if available.
$client->users->orgs([string $userId]): array
List of the user's GitHub Repositories and their respective Room if available.
$client->users->repos([string $userId]): array
List of Gitter channels nested under the user.
$client->users->channels([string $userId]): array
Custom WebHook Notifications
Create a "Custom Webhook":
- Open your chat
- Click on "Room Settings" button
- Click on "Integrations"
- Select "Custom"
- Remember yor Hook Id, like
2b66cf4653faa342bbe8
insidehttps://webhooks.gitter.im/e/
url.
Custom routing
Available route methods:
Route::get(string $route)
- GET http methodRoute::post(string $route)
- POST http methodRoute::put(string $route)
- PUT http methodRoute::patch(string $route)
- PATCH http methodRoute::delete(string $route)
- DELETE http methodRoute::options(string $route)
- OPTIONS http methodRoute::head(string $route)
- HEAD http methodRoute::connect(string $route)
- CONNECT http methodRoute::trace(string $route)
- TRACE http method
Route arguments:
$route->with(string $key, string $value)
- Add route or GET query parameter$route->withMany(array $parameters)
- Add route or GET query parameters$route->withBody(string $key, string $value)
- Add POST, PUT, DELETE, etc body parameter
See more info about API into Documentation
All versions of gitter-api with dependencies
ext-sockets Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ~6.0
react/event-loop Version ~0.4
react/dns Version ~0.4
clue/buzz-react Version ~1.0
psr/log Version ~1.0
serafim/evacuator Version ~3.0