{"id":15062747,"url":"https://github.com/seven-io/php-client","last_synced_at":"2026-02-05T12:11:55.206Z","repository":{"id":57054071,"uuid":"221235809","full_name":"seven-io/php-client","owner":"seven-io","description":"The official PHP API Client for seven.io","archived":false,"fork":false,"pushed_at":"2026-01-12T12:43:40.000Z","size":7776,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-12T19:46:56.390Z","etag":null,"topics":["api-client","cnam","composer","hlr","mnp","rcs","sdk","sms","text2speech"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/seven.io/api","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/seven-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-11-12T14:21:28.000Z","updated_at":"2026-01-12T12:42:31.000Z","dependencies_parsed_at":"2023-11-14T14:26:48.620Z","dependency_job_id":"c1530dc3-4917-4969-a7e0-3258e132f176","html_url":"https://github.com/seven-io/php-client","commit_stats":{"total_commits":47,"total_committers":2,"mean_commits":23.5,"dds":0.04255319148936165,"last_synced_commit":"3ec6f3b9fa28eeecc7000dafa41c5c3239a138fd"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/seven-io/php-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seven-io%2Fphp-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seven-io%2Fphp-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seven-io%2Fphp-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seven-io%2Fphp-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seven-io","download_url":"https://codeload.github.com/seven-io/php-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seven-io%2Fphp-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29121685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T10:47:47.471Z","status":"ssl_error","status_checked_at":"2026-02-05T10:45:08.119Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api-client","cnam","composer","hlr","mnp","rcs","sdk","sms","text2speech"],"created_at":"2024-09-24T23:45:44.709Z","updated_at":"2026-02-05T12:11:55.199Z","avatar_url":"https://github.com/seven-io.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://www.seven.io/wp-content/uploads/Logo.svg\" width=\"250\" /\u003e\n\n# seven.io PHP SDK\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/seven.io/api.svg)](https://packagist.org/packages/seven.io/api)\n[![Total Downloads](https://img.shields.io/packagist/dt/seven.io/api.svg)](https://packagist.org/packages/seven.io/api)\n[![License](https://img.shields.io/badge/License-MIT-teal.svg)](LICENSE)\n[![PHP Version](https://img.shields.io/packagist/php-v/seven.io/api.svg)](https://packagist.org/packages/seven.io/api)\n\n**The official PHP SDK for the seven.io SMS Gateway API**\n\n[Documentation](https://www.seven.io/en/docs/gateway/http-api/) • [API Reference](/docs) • [Support](https://www.seven.io/en/company/contact/) • [Dashboard](https://app.seven.io/)\n\n---\n\n## 📦 Installation\n\n### Via Composer (recommended)\n\n```bash\ncomposer require seven.io/api\n```\n\n### Manual Installation\n\nDownload the latest release as [ZIP file](https://github.com/seven-io/php-client/releases/latest) and include it in your project.\n\n## 🚀 Quick Start\n\n### Send your first SMS\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse Seven\\Api\\Client;\nuse Seven\\Api\\Resource\\Sms\\SmsParams;\nuse Seven\\Api\\Resource\\Sms\\SmsResource;\n\n// Initialize the client with your API key\n$client = new Client('YOUR_API_KEY');\n\n// Create SMS resource\n$smsResource = new SmsResource($client);\n\n// Send SMS\n$response = $smsResource-\u003edispatch(\n    new SmsParams('Hello from seven.io!', '+491234567890')\n);\n\necho \"SMS sent successfully! ID: \" . $response-\u003egetMessages()[0]-\u003egetId();\n```\n\n## 📱 Features\n\n### SMS Messaging\n- ✅ Send SMS to single or multiple recipients\n- ✅ Bulk SMS support\n- ✅ Flash SMS\n- ✅ Unicode support\n- ✅ Delivery reports\n- ✅ Schedule messages\n\n### Voice Calls\n- ✅ Text-to-Speech calls\n- ✅ Voice message broadcasts\n\n### Number Lookup\n- ✅ HLR (Home Location Register) lookup\n- ✅ Number format validation\n- ✅ Carrier information\n- ✅ Number portability check\n\n### Other Features\n- ✅ Balance inquiry\n- ✅ Pricing information\n- ✅ Webhook management\n- ✅ Contact management\n- ✅ Analytics \u0026 Journal\n\n## 💻 Usage Examples\n\n### Send SMS with custom sender\n\n```php\n$params = (new SmsParams('Your message here', '+491234567890'))\n    -\u003esetFrom('YourBrand')\n    -\u003esetUnicode(true)\n    -\u003esetFlash(false);\n    \n$response = $smsResource-\u003edispatch($params);\n```\n\n### Send bulk SMS\n\n```php\n$params = new SmsParams(\n    'Bulk message to multiple recipients',\n    ['+491234567890', '+491234567891', '+491234567892']\n);\n\n$response = $smsResource-\u003edispatch($params);\n```\n\n### Schedule SMS for later\n\n```php\n$params = (new SmsParams('Scheduled message', '+491234567890'))\n    -\u003esetDelay(new \\DateTime('+1 hour'));\n    \n$response = $smsResource-\u003edispatch($params);\n```\n\n### Perform HLR lookup\n\n```php\nuse Seven\\Api\\Resource\\Lookup\\LookupResource;\n\n$lookupResource = new LookupResource($client);\n$results = $lookupResource-\u003ehlr('+491234567890');\n$hlr = $results[0];\n\necho \"Current Carrier: \" . $hlr-\u003egetCurrentCarrier()-\u003egetName() . \"\\n\";\necho \"Country: \" . $hlr-\u003egetCountryName() . \"\\n\";\necho \"Reachable: \" . $hlr-\u003egetReachable() . \"\\n\";\necho \"Ported: \" . $hlr-\u003egetPorted() . \"\\n\";\n```\n\n### Check account balance\n\n```php\nuse Seven\\Api\\Resource\\Balance\\BalanceResource;\n\n$balanceResource = new BalanceResource($client);\n$balance = $balanceResource-\u003eget();\n\necho \"Current balance: €\" . $balance-\u003egetAmount();\n```\n\n### Text-to-Speech call\n\n```php\nuse Seven\\Api\\Resource\\Voice\\VoiceResource;\nuse Seven\\Api\\Resource\\Voice\\VoiceParams;\n\n$voiceResource = new VoiceResource($client);\n$params = new VoiceParams('+491234567890', 'Hello, this is a test call');\n\n$response = $voiceResource-\u003ecall($params);\n```\n\n## 🔧 Advanced Configuration\n\n### Initialize with signing secret (for webhook validation)\n\n```php\n$client = new Client(\n    apiKey: 'YOUR_API_KEY',\n    signingSecret: 'YOUR_SIGNING_SECRET'\n);\n```\n\n### Error Handling\n\nThe SDK provides specific exceptions for different API error conditions:\n\n```php\nuse Seven\\Api\\Exception\\ApiException;\nuse Seven\\Api\\Exception\\InvalidApiKeyException;\nuse Seven\\Api\\Exception\\MissingAccessRightsException;\nuse Seven\\Api\\Exception\\ForbiddenIpException;\n\ntry {\n    $response = $smsResource-\u003edispatch($params);\n} catch (InvalidApiKeyException $e) {\n    echo \"Invalid API key provided\";\n} catch (MissingAccessRightsException $e) {\n    echo \"Missing access rights for this operation\";\n} catch (ForbiddenIpException $e) {\n    echo \"Your IP address is not allowed\";\n} catch (ApiException $e) {\n    // Handles all other API error codes (100-903)\n    // Common codes: 500 = Insufficient credit, 201 = Invalid sender, 202 = Invalid recipient\n    echo \"API Error: \" . $e-\u003egetMessage() . \" (Code: \" . $e-\u003egetCode() . \")\";\n} catch (\\Exception $e) {\n    echo \"Error: \" . $e-\u003egetMessage();\n}\n```\n\n#### API Error Codes\n\n| Code | Description |\n|------|-------------|\n| 100 | SMS accepted and being sent |\n| 101 | Sending to at least one recipient failed |\n| 201 | Invalid sender |\n| 202 | Invalid recipient number |\n| 301-305 | Parameter validation errors |\n| 500 | Insufficient account credit |\n| 600 | Sending error occurred |\n| 900-903 | Authentication/authorization errors |\n\n## 🧪 Testing\n\nRun the test suite with your API credentials:\n\n```bash\n# Using production API key\nSEVEN_API_KEY=your_api_key php vendor/bin/phpunit tests\n\n# Using sandbox API key\nSEVEN_API_KEY_SANDBOX=your_sandbox_key php vendor/bin/phpunit tests\n```\n\n### Run specific tests\n\n```bash\n# Test only SMS functionality\nphp vendor/bin/phpunit tests/SmsTest.php\n\n# Test with verbose output\nphp vendor/bin/phpunit tests --verbose\n```\n\n## 📚 API Resources\n\nThe SDK provides access to all seven.io API endpoints:\n\n| Resource | Description |\n|----------|-------------|\n| `AnalyticsResource` | Analytics and statistics |\n| `BalanceResource` | Account balance |\n| `ContactsResource` | Contact management |\n| `HooksResource` | Webhook management |\n| `JournalResource` | Message history |\n| `LookupResource` | Number lookup \u0026 validation |\n| `PricingResource` | Pricing information |\n| `RcsResource` | RCS messaging |\n| `SmsResource` | SMS messaging |\n| `StatusResource` | Delivery reports |\n| `SubaccountsResource` | Subaccount management |\n| `ValidateForVoiceResource` | Voice number validation |\n| `VoiceResource` | Voice calls |\n\n## 🔑 Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `SEVEN_API_KEY` | Your production API key |\n| `SEVEN_API_KEY_SANDBOX` | Your sandbox API key for testing |\n| `SEVEN_SIGNING_SECRET` | Webhook signing secret |\n| `SEVEN_TEST_RECIPIENT` | Custom recipient phone number for tests (default: `491716992343`) |\n\n## 📄 Requirements\n\n- PHP 8.2 or higher\n- Composer (for installation)\n- ext-curl\n- ext-json\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 🆘 Support\n\n- 📖 [API Documentation](https://www.seven.io/en/docs/gateway/http-api/)\n- 💬 [Contact Support](https://www.seven.io/en/company/contact/)\n- 🐛 [Report Issues](https://github.com/seven-io/php-client/issues)\n- 💡 [Feature Requests](https://github.com/seven-io/php-client/issues/new?labels=enhancement)\n\n## 📜 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\nMade with ❤️ by [seven.io](https://www.seven.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseven-io%2Fphp-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseven-io%2Fphp-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseven-io%2Fphp-client/lists"}