{"id":37005885,"url":"https://github.com/smsglobal/smsglobal-php","last_synced_at":"2026-01-14T00:41:20.782Z","repository":{"id":47652256,"uuid":"291226943","full_name":"smsglobal/smsglobal-php","owner":"smsglobal","description":"PHP Client library for SMSGlobal REST API","archived":false,"fork":false,"pushed_at":"2025-11-06T06:15:54.000Z","size":51,"stargazers_count":9,"open_issues_count":5,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-12T20:54:56.898Z","etag":null,"topics":["php","php-library","sdk","smsglobal"],"latest_commit_sha":null,"homepage":null,"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/smsglobal.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}},"created_at":"2020-08-29T07:53:38.000Z","updated_at":"2025-03-18T12:45:58.000Z","dependencies_parsed_at":"2022-09-22T14:42:52.655Z","dependency_job_id":null,"html_url":"https://github.com/smsglobal/smsglobal-php","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/smsglobal/smsglobal-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smsglobal%2Fsmsglobal-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smsglobal%2Fsmsglobal-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smsglobal%2Fsmsglobal-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smsglobal%2Fsmsglobal-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smsglobal","download_url":"https://codeload.github.com/smsglobal/smsglobal-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smsglobal%2Fsmsglobal-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"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":["php","php-library","sdk","smsglobal"],"created_at":"2026-01-14T00:41:20.644Z","updated_at":"2026-01-14T00:41:20.765Z","avatar_url":"https://github.com/smsglobal.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SMSGlobal PHP Client Library\n\n![Build](https://github.com/smsglobal/smsglobal-php/workflows/Build/badge.svg)\n![Coverage](https://img.shields.io/codecov/c/gh/smsglobal/smsglobal-php)\n[![Latest Version](https://img.shields.io/github/release/smsglobal/smsglobal-php.svg?style=flat)](https://github.com/smsglobal/smsglobal-php/releases)\n[![Total Downloads](https://img.shields.io/packagist/dt/smsglobal/smsglobal-php.svg?style=flat)](https://packagist.org/packages/smsglobal/smsglobal-php)\n\n### SMSGlobal REST API and Libraries for PHP\n\nThis is a PHP Client library for SMSGlobal’s REST API to integrate SMS capabilities into your PHP application.\n\nSign up for a [free SMSGlobal account](https://www.smsglobal.com/mxt-sign-up/?utm_source=dev\u0026utm_medium=github\u0026utm_campaign=php_sdk) today and get your API Key from our advanced SMS platform, MXT. Plus, enjoy unlimited free developer sandbox testing to try out your API in full!\n\n### Requirements\n\n* PHP 7.3 and above\n* Guzzle7 (PHP HTTP client)\n\n### Installation\n\nTo install the PHP client library to your project, we recommend using [Composer](https://getcomposer.org/).\n\n```bash\ncomposer require smsglobal/smsglobal-php\n```\n\n### Usage\n\nCheck out `examples` folder\n\n**Send SMS**\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n// get your REST API keys from MXT https://mxt.smsglobal.com/integrations\n\\SMSGlobal\\Credentials::set('YOUR_API_KEY', 'YOUR_SECRET_KEY');\n\n$sms = new \\SMSGlobal\\Resource\\Sms();\n\ntry {\n    $response = $sms-\u003esendToOne('DESTINATION_NUMBER', 'This is a test message.');\n    print_r($response['messages']);\n} catch (\\Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n**Send OTP**\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n// get your REST API keys from MXT https://mxt.smsglobal.com/integrations\n\\SMSGlobal\\Credentials::set('YOUR_API_KEY', 'YOUR_SECRET_KEY');\n\n$otp = new \\SMSGlobal\\Resource\\Otp();\n\ntry {\n    $response = $otp-\u003esend('DESTINATION_NUMBER', '{*code*} is your SMSGlobal verification code.');\n    print_r($response);\n} catch (\\Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\nThe following json response will be returned by the server:\n\n```json\n\n{\n    \"requestId\": \"404372541683674336263499\",\n    \"validUnitlTimestamp\": \"2020-11-18 16:24:51\",\n    \"createdTimestamp\": \"2020-11-18 16:22:51\",\n    \"lastEventTimestamp\": \"2020-11-18 16:22:51\",\n    \"destination\": \"61400000000\",\n    \"status\": \"Sent\"\n}\n\n```\n\n\n**Verify OTP**\n\nThe OTP code entered by your user can be verified by either using `requestId` or `destination number`. The followings are examples of each method:\n\n```php\n\n\u003c?php\n\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n// get your REST API keys from MXT https://mxt.smsglobal.com/integrations\n\\SMSGlobal\\Credentials::set('YOUR_API_KEY', 'YOUR_SECRET_KEY');\n\n$otp = new \\SMSGlobal\\Resource\\Otp();\n\ntry {\n    $response = $otp-\u003everifyByRequestId('request Id', 'OTP code enterted by your user.');\n    print_r($response);\n} catch (\\Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n// get your REST API keys from MXT https://mxt.smsglobal.com/integrations\n\\SMSGlobal\\Credentials::set('YOUR_API_KEY', 'YOUR_SECRET_KEY');\n\n$otp = new \\SMSGlobal\\Resource\\Otp();\n\ntry {\n    $response = $otp-\u003everifyByDestination('destination number', 'OTP code enterted by your user.');\n    print_r($response);\n} catch (\\Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\nThe following json response will be returned by the server if verification is successfull:\n\n```json\n\n{\n    \"requestId\": \"404372541683674336263499\",\n    \"validUnitlTimestamp\": \"2020-11-18 16:24:51\",\n    \"createdTimestamp\": \"2020-11-18 16:22:51\",\n    \"lastEventTimestamp\": \"2020-11-18 16:22:51\",\n    \"destination\": \"61400000000\",\n    \"status\": \"Verified\"\n}\n\n```\n\n**Cancel OTP**\n\nThe OTP request can be cancelled if an OTP is not expired and verified yet. It can be done by either using `requestId` or `destination number`. The followings are examples of each method:\n\n```php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n// get your REST API keys from MXT https://mxt.smsglobal.com/integrations\n\\SMSGlobal\\Credentials::set('YOUR_API_KEY', 'YOUR_SECRET_KEY');\n\n$otp = new \\SMSGlobal\\Resource\\Otp();\n\ntry {\n    $response = $otp-\u003ecancelByRequestId('request Id');\n    print_r($response);\n} catch (\\Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n\n```php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n// get your REST API keys from MXT https://mxt.smsglobal.com/integrations\n\\SMSGlobal\\Credentials::set('YOUR_API_KEY', 'YOUR_SECRET_KEY');\n\n$otp = new \\SMSGlobal\\Resource\\Otp();\n\ntry {\n    $response = $otp-\u003ecancelByDestination('destination number');\n    print_r($response);\n} catch (\\Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n\nThe following json response will be returned by the server if cancellation is successfull:\n\n```json\n\n{\n    \"requestId\": \"404372541683674336263499\",\n    \"validUnitlTimestamp\": \"2020-11-18 16:24:51\",\n    \"createdTimestamp\": \"2020-11-18 16:22:51\",\n    \"lastEventTimestamp\": \"2020-11-18 16:22:51\",\n    \"destination\": \"61400000000\",\n    \"status\": \"Cancelled\"\n}\n\n```\n\n\n### Available REST API Resources  \n\n* Sms\n* Sms Incoming\n* OTP (beta)\n* User\n\n\n### Unit Tests\nInstall development dependencies\n\n```bash\ncomposer require smsglobal/smsglobal-php\n```\n\nRun unit tests\n\n```bash\n./vendor/bin/phpunit tests\n```\n\nWith coverage (requires extension pcov or xdebug)\n```bash\n./vendor/bin/phpunit --coverage-text tests\n```\n\n### Getting help\n\nView the [REST API](https://www.smsglobal.com/rest-api/?utm_source=dev\u0026utm_medium=github\u0026utm_campaign=php_sdk) documentation for a list of available resources.\n\nFor any query [contact us](https://www.smsglobal.com/contact/?utm_source=dev\u0026utm_medium=github\u0026utm_campaign=php_sdk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmsglobal%2Fsmsglobal-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmsglobal%2Fsmsglobal-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmsglobal%2Fsmsglobal-php/lists"}