{"id":18576882,"url":"https://github.com/greensms-io/greensms-php","last_synced_at":"2025-03-31T10:02:09.936Z","repository":{"id":39449350,"uuid":"311863965","full_name":"greensms-io/greensms-php","owner":"greensms-io","description":"PHP GREENSMS API client: SMS, Call, Voice, VK, WhatsApp, Viber","archived":false,"fork":false,"pushed_at":"2025-02-20T15:47:26.000Z","size":104,"stargazers_count":26,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T07:38:25.122Z","etag":null,"topics":["2fa-codes","call-for-code","sms","sms-api","sms-notifications","sms-verification","viber-api"],"latest_commit_sha":null,"homepage":"https://api.greensms.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greensms-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-11T04:37:52.000Z","updated_at":"2025-03-22T23:55:37.000Z","dependencies_parsed_at":"2024-08-10T01:39:42.446Z","dependency_job_id":"8ca8d644-79af-470d-8f89-f91ccff5cd54","html_url":"https://github.com/greensms-io/greensms-php","commit_stats":{"total_commits":110,"total_committers":5,"mean_commits":22.0,"dds":0.1636363636363637,"last_synced_commit":"8c8c470dbd71a8d89508b5f7219060b460ef1df7"},"previous_names":["greensms-ru/greensms-php"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greensms-io%2Fgreensms-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greensms-io%2Fgreensms-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greensms-io%2Fgreensms-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greensms-io%2Fgreensms-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greensms-io","download_url":"https://codeload.github.com/greensms-io/greensms-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246450408,"owners_count":20779406,"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":["2fa-codes","call-for-code","sms","sms-api","sms-notifications","sms-verification","viber-api"],"created_at":"2024-11-06T23:26:59.125Z","updated_at":"2025-03-31T10:02:09.794Z","avatar_url":"https://github.com/greensms-io.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# greensms-php\n\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/greensms-ru/greensms-php)\n![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/greensms/greensms)\n![Packagist Version](https://img.shields.io/packagist/v/greensms/greensms)\n[![PHP Composer](https://github.com/greensms-ru/greensms-php/actions/workflows/php.yml/badge.svg?event=release)](https://github.com/greensms-ru/greensms-php/actions/workflows/php.yml)\n\n## Documentation\n\nThe documentation for the GREENSMS API can be found [here][apidocs].\n\n## Installation\n\n```bash\ncomposer require greensms/greensms\n```\n\n## Sample Usage\n\nCheck out these [code examples](examples) to get up and running quickly.\n\n```php\n\nuse GreenSMS\\GreenSMS;\n\n# Register at my.greeensms.ru first\n$client = new GreenSMS([\n  'user' =\u003e 'test',\n  'pass' =\u003e 'test'\n]);\n\n$response = $client-\u003esms-\u003esend([\n  'to' =\u003e '79260000121',\n  'txt' =\u003e 'Here is your message for delivery'\n]);\n\n\necho \"Sms Request Id: \" . $response-\u003erequest_id;\n\n```\n\n### Environment Variables\n\n`greensms-php` supports credential storage in environment variables. If no credentials are provided following env vars will be used: `GREENSMS_USER`/`GREENSMS_PASS` OR `GREENSMS_TOKEN`.\n\n### Token Auth\n\n```php\n\nuse GreenSMS\\GreenSMS;\n\n$tokenClient = new GreenSMS([\n  'token' =\u003e 'yourtoken'\n]);\n\n$response = $tokenClient-\u003eaccount-\u003ebalance();\necho \"Balance : \" . $response-\u003ebalance. \"\\n\";\n\n\n```\n\n## Compatibility\n\n`greensms-php` is compatible with PHP 7.3+ onwards until the latest PHP Version\n\n## Methods\n\n- You can either use username/password combination or auth token to create an object with constructor\n- Each API Function is available as `MODULE.FUNCTION()`\n- Parameters for each API can be referred from [here][apidocs]\n- Response keys by default are available in `snake_case`. If you want to use `camelCase`, then pass `'camelCaseResponse'= \u003e true`, in the constructor\n\n## Handling Exceptions\n\n- Exceptions for all APIs are thrown with RestException class. It extends the default PHP Exception class.\n- Each error, will have a message and code similar to PHP Exceptions.\n- In case of _Validation Error_, additional params are available to show field-wise rule failures. Can be accessed by `$e-\u003egetParams()` method on the error object\n\n## Getting help\n\nIf you need help installing or using the library, please contact us: [support@greensms.io](mailto:support@greensms.io).\n\nIf you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!\n\n## Contributing\n\nBug fixes, docs, and library improvements are always welcome. Please refer to our [Contributing Guide](CONTRIBUTING.md) for detailed information on how you can contribute.\nIf you're not familiar with the GitHub pull request/contribution process, [this is a nice tutorial](https://gun.io/blog/how-to-github-fork-branch-and-pull-request/).\n\n### Getting Started\n\nIf you want to familiarize yourself with the project, you can start by [forking the repository](https://help.github.com/articles/fork-a-repo/) and [cloning it in your local development environment](https://help.github.com/articles/cloning-a-repository/). The project requires [Node.js](https://nodejs.org) to be installed on your machine.\n\nAfter cloning the repository, install the dependencies by running the following command in the directory of your cloned repository:\n\n```bash\ncomposer require\n```\n\nGreenSMS has all the unit tests defined under **tests** folder with `*Test.php` extension. It uses PHPUnit, which is added as a dev dependency. You can run all the tests using the following command.\n\n```bash\n./vendor/bin/phpunit tests\n```\n\n[apidocs]: https://api.greensms.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreensms-io%2Fgreensms-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreensms-io%2Fgreensms-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreensms-io%2Fgreensms-php/lists"}