zzbomb / groupme
Groupme Library for PHP
Installs: 544
Dependents: 0
Suggesters: 0
Security: 0
Stars: 18
Watchers: 4
Forks: 13
Open Issues: 2
Requires
- php: >=5.3.0
- ext-curl: *
- ext-json: *
Requires (Dev)
- phpstan/phpstan: ^0.12.85
- phpunit/dbunit: 1.3.2
- phpunit/phpunit: 4.6.6
- phpunit/phpunit-selenium: 1.4.2
- vlucas/phpdotenv: ^5.3
This package is auto-updated.
Last update: 2021-04-29 06:43:08 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 = json_decode($response)['response']['members'];
Want to contribute?
See the contribution guide