{"id":16201886,"url":"https://github.com/ossycodes/nigeriabulksms-php","last_synced_at":"2025-03-19T05:31:08.704Z","repository":{"id":196152533,"uuid":"694149399","full_name":"ossycodes/nigeriabulksms-php","owner":"ossycodes","description":"The Official PHP Library for Nigeriabulksms API","archived":false,"fork":false,"pushed_at":"2023-09-21T18:13:45.000Z","size":203,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T04:21:22.646Z","etag":null,"topics":["nigeriabulksms","php","sdk","sms-gateway"],"latest_commit_sha":null,"homepage":"https://nigeriabulksms.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ossycodes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-20T12:30:20.000Z","updated_at":"2023-09-22T14:24:05.000Z","dependencies_parsed_at":"2023-09-21T19:37:12.146Z","dependency_job_id":null,"html_url":"https://github.com/ossycodes/nigeriabulksms-php","commit_stats":null,"previous_names":["ossycodes/nigeriabulksms-php"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossycodes%2Fnigeriabulksms-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossycodes%2Fnigeriabulksms-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossycodes%2Fnigeriabulksms-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossycodes%2Fnigeriabulksms-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ossycodes","download_url":"https://codeload.github.com/ossycodes/nigeriabulksms-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244364793,"owners_count":20441459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nigeriabulksms","php","sdk","sms-gateway"],"created_at":"2024-10-10T09:44:45.918Z","updated_at":"2025-03-19T05:31:08.340Z","avatar_url":"https://github.com/ossycodes.png","language":"PHP","funding_links":["https://www.paypal.com/paypalme/osaigbovoemmanuel"],"categories":[],"sub_categories":[],"readme":"# The official PHP library for Nigeriabulksms API\n\n\n\nThis repository contains the open source PHP client for Nigeriabulksms's API. Documentation can be found at: https://nigeriabulksms.com/sms-gateway-api-in-nigeria/\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/ossycodes/nigeriabulksms-php.svg?style=flat-square)](https://packagist.org/packages/ossycodes/nigeriabulksms-php)\n[![Total Downloads](https://img.shields.io/packagist/dt/ossycodes/nigeriabulksms-php.svg?style=flat-square)](https://packagist.org/packages/ossycodes/nigeriabulksms-php)\n![GitHub Actions](https://github.com/ossycodes/nigeriabulksms-php/actions/workflows/main.yml/badge.svg)\n\n## Requirements\n\n- [Sign up](http://portal.nigeriabulksms.com/register/?referral=15292322) for a free Nigeriabulksms account\n- after signing up, your username and password will be used for authenticating with the APIs\n- Nigeriabulksms API client for PHP requires PHP \u003e= 7.4.\n\n## Installation\n\n#### Composer installation\n\n- [Download composer](https://getcomposer.org/doc/00-intro.md#installation-nix)\n- Run `composer require ossycodes/nigeriabulksms-php`.\n\n#### Manual installation\n\nWhen you do not use Composer. You can git checkout or download [this repository](https://github.com/ossycodes/nigeriabulksms-php/archive/master.zip) and include the Nigeriabulksms API client manually.\n\n\n## Usage\n\nWe have put some self-explanatory examples in the [src/Examples](https://github.com/ossycodes/nigeriabulksms-php/tree/master/src/Examples) directory, but here is a quick breakdown on how it works. First, you need to set up a **Nigeriabulksms\\Client**. Be sure to replace **YOUR_USERNAME** and **YOUR_PASSWORD** with your real credentials.\n\n```php\nrequire 'autoload.php';\n\n$config = \\Ossycodes\\Nigeriabulksms\\Configuration::getDefaultConfiguration()\n            -\u003esetUsername('YOUR_USERNAME')\n            -\u003esetPassword('YOUR_PASSWORD')\n            -\u003esetTimeout(10) //optional defaults to 10\n            -\u003esetConnectionTimeout(2); //optional defaults to 2\n\n$client = new \\Ossycodes\\Nigeriabulksms\\Client($config);\n\n```\n\nThat's easy enough. Now we can query the server for information. Lets use getting your balance overview as an example:\n\n```php\ntry {\n\n    // Get your balance\n    $balance = $client-\u003ebalance-\u003eread();\n\n    var_dump($balance);\n    \n} catch (\\Ossycodes\\Nigeriabulksms\\Exceptions\\AuthenticateException $e) {\n\n    // That means that your username and/or password is incorrect\n    echo 'invalid credentials';\n\n}\ncatch (\\Ossycodes\\Nigeriabulksms\\Exceptions\\BalanceException $e) {\n\n    // That means that your balance is insufficient\n    echo 'insufficient balance';\n\n}\ncatch (\\Exception $e) {\n \n var_dump($e-\u003egetMessage());\n\n}\n```\n\n\nSending Text SMS Message\n\n```php\n\nrequire_once(__DIR__ . '/../autoload.php');\n\n$config = \\Ossycodes\\Nigeriabulksms\\Configuration::getDefaultConfiguration()\n    -\u003esetUsername('YOUR_USERNAME')\n    -\u003esetPassword('YOUR_PASSWORD')\n    -\u003esetTimeout(10) //optional defaults to 10\n    -\u003esetConnectionTimeout(2); //optional defaults to 2\n\n$client = new \\Ossycodes\\Nigeriabulksms\\Client($config);\n\ntry {\n\n    $message = new \\Ossycodes\\Nigeriabulksms\\Objects\\TextMessage();\n    $message-\u003esender = 'YOUR_SENDER_NAME';\n    $message-\u003erecipients = '2342222222222';\n    $message-\u003ebody =  'body of text message goes in here'; //should be less than 160 characters\n    \n    //send the text sms message\n    $response = $client-\u003emessage-\u003esend($message);\n    \n    var_dump($response);\n\n} catch (\\Ossycodes\\Nigeriabulksms\\Exceptions\\AuthenticateException $e) {\n\n    // That means that your username and/or password is incorrect\n    echo 'invalid credentials';\n\n} catch (\\Ossycodes\\Nigeriabulksms\\Exceptions\\BalanceException $e) {\n\n    // That means that your balance is insufficient\n    echo 'insufficient balance';\n\n} catch (\\Ossycodes\\Nigeriabulksms\\Exceptions\\RequestDeniedException $e) {\n\n    // That means that you do not have permission to perform this action\n    echo 'this action is not permitted';\n\n} catch (\\Exception $e) {\n\n    var_dump($e-\u003egetMessage());\n\n}\n\n```\n\n## Documentation\n\nComplete documentation, instructions, and examples are available at:\n[https://nigeriabulksms.com/sms-gateway-api-in-nigeria/](https://nigeriabulksms.com/sms-gateway-api-in-nigeria/)\n\n### Testing\n\n```bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email osaigbovoemmanuel1@gmail.com instead of using the issue tracker.\n\n## Credits\n\n-   [Osaigbovo Emmanuel](https://github.com/ossycodes)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## How do I say Thank you?\n\nPlease buy me a cup of coffee https://www.paypal.com/paypalme/osaigbovoemmanuel , Leave a star and follow me on [Twitter](https://twitter.com/ossycodes) .\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fossycodes%2Fnigeriabulksms-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fossycodes%2Fnigeriabulksms-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fossycodes%2Fnigeriabulksms-php/lists"}