zzbomb / groupme
Groupme Library for PHP
Installs: 545
Dependents: 0
Suggesters: 0
Security: 0
Stars: 20
Watchers: 4
Forks: 12
Open Issues: 2
Requires
- php: >=8.1
- ext-curl: *
- ext-json: *
Requires (Dev)
- phpstan/phpstan: ^1.11
- phpunit/phpunit: 9.6.19
- symfony/dotenv: ^6.4.7
This package is auto-updated.
Last update: 2024-05-18 20:57:52 UTC
README
Install with Composer
composer require jspaetzel/groupme
Then use the autoloader to load this library in your code
require './vendor/autoload.php';
Examples
These are some basic examples for how to interact with the api via the library. The APIKEY in these examples is the API key of a user, not a groupme bot key or application key.
For all requests you'll need create a Client
$client = new \GroupMePHP\Client('APIKEY');
Send a message to a group
$message_to_send = "Hello Group!" $messages_service = new \GroupMePHP\Services\MessagesService($client); $messages_service->create(12345678, ["THISISAGUID123", $message_to_send]);
Send a direct message to a user
$direct_message_service = new \GroupMePHP\Services\DirectMessagesService($client); $direct_message_service->create([ "source_guid" => "THISISAGUID123", "recipient_id" => 12345678, "text" => 'Hello User' ]);
Get index of groups for authenticated user
$group_service = new \GroupMePHP\Services\GroupsService($client); $response = $group_service->index();
Get only the members of a group as json
$group_service = new \GroupMePHP\Services\GroupsService($client); $response = $group_service->show(1234567); $members = $response['members'];
Want to contribute?
See the contribution guide