{"id":20016856,"url":"https://github.com/labsmobile/sms-php","last_synced_at":"2026-06-13T07:32:59.087Z","repository":{"id":211982482,"uuid":"730409316","full_name":"labsmobile/sms-php","owner":"labsmobile","description":"Official PHP library for LabsMobile SMS API.","archived":false,"fork":false,"pushed_at":"2026-06-11T19:08:16.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-11T21:06:27.469Z","etag":null,"topics":["library","php","sms","sms-api","sms-gateway"],"latest_commit_sha":null,"homepage":"https://www.labsmobile.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/labsmobile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","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":"2023-12-11T21:33:15.000Z","updated_at":"2026-06-11T19:08:20.000Z","dependencies_parsed_at":"2023-12-26T20:59:14.064Z","dependency_job_id":null,"html_url":"https://github.com/labsmobile/sms-php","commit_stats":null,"previous_names":["labsmobile/sms-php"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/labsmobile/sms-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labsmobile%2Fsms-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labsmobile%2Fsms-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labsmobile%2Fsms-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labsmobile%2Fsms-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labsmobile","download_url":"https://codeload.github.com/labsmobile/sms-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labsmobile%2Fsms-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34276501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["library","php","sms","sms-api","sms-gateway"],"created_at":"2024-11-13T08:13:25.605Z","updated_at":"2026-06-13T07:32:59.072Z","avatar_url":"https://github.com/labsmobile.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://avatars.githubusercontent.com/u/152215067?s=200\u0026v=4\" height=\"80\"\u003e\n\u003c/p\u003e\n\n# LabsMobile-PHP\n\n![](https://img.shields.io/badge/version-1.0.2-blue.svg)\n \nSend SMS messages through the LabsMobile platform and the PHP library.\n\n## Documentation\n\n- Labsmobile API documentation can be found [here][apidocs].\n\n\n## Features\n- Send SMS messages.\n- Get account credits\n- Get prices by country\n- Manage scheduled sendings\n- HLR Request (Check mobile)\n\n## Requirements\n\n- A user account with LabsMobile. Click on the link to create an account [here][signUp].\n- This library supports php v5.4 and higher versions of php.\n- From php v5.4 to php v7.1 it is recommended to use [Composer 2.2.22][getcomposerdownload].\n\n## Installation\n\nTo install the [labsmobile/sms-php][packages] library, it is recommended to use [composer][getcomposer].\n\n### Installation command\n\n```\ncomposer require labsmobile/sms-php\n```\n\n### Installation by modifying the composer.json file\n\n```\n\"require\": {\n\t\"labsmobile/sms-php\": \"1.0.2\"\n}\n```\n\n## Examples of use cases\n\n**Send SMS**\n\nHere is an example of using the library to send a SMS:\n\n```php\n  public $username = 'myusername';\n  public $token = 'mytoken';\n\n  public function testSms()\n  { \n    try {\n      $message = 'Test SMS';\n      $phone = ['34XXXXXXXXX'];\n      $labsMobileClient = new LabsMobileClient($this-\u003eusername, $this-\u003etoken);\n      $bodySms = new LabsMobileModelTextMessage($phone,$message);\n      $labsMobileClient = $labsMobileClient-\u003esendSms($bodySms);\n      $body = $labsMobileClient-\u003egetBody();\n      $json = json_decode($body);\n      self::assertSame('0',$json-\u003ecode);\n    } catch (RestException $exception) {\n      self::assertSame('Error', $exception-\u003egetStatus() .\" \". $exception-\u003egetMessage());\n    }\n  }\n```\n**Get account credits**\n\nHere is an example to learn credits for an existing account:\n\n```php\n  public $username = 'myusername';\n  public $token = 'mytoken';\n\n  public function testGetCredits()\n  {\n    try{\n      $labsMobileClient = new LabsMobileClient($this-\u003eusername, $this-\u003etoken);\n      $response = $labsMobileClient-\u003egetCredit();\n      $body = $response-\u003egetBody();\n      $json = json_decode($body);\n      self::assertSame(0,$json-\u003ecode);\n    } catch(RestException $exception) {\n      self::assertSame('Error', $exception-\u003egetStatus() .\" \". $exception-\u003egetMessage());\n    }\n  }\n```\n**Manage scheduled sendings**\n\nHere is an example you can cancel or execute the scheduled sendings that are pending for execution:\n\n```php\n  public $username = 'myusername';\n  public $token = 'mytoken';\n\n  public function testScheduledSendings() \n  {\n    try {\n      $subid=\"XXXXXXXXXX\";\n      $cmd=\"XXXX\";\n      $labsMobileClient = new LabsMobileClient($this-\u003eusername, $this-\u003etoken);\n      $bodyScheduled = new LabsMobileModelScheduledSendings($subid, $cmd);\n      $labsMobileClient = $labsMobileClient-\u003escheduledSendings($bodyScheduled);\n      $body = $labsMobileClient-\u003egetBody();\n      $json = json_decode($body);\n      self::assertSame(0,$json-\u003ecode);\n    } catch (RestException $exception) {\n      self::assertSame('Error', $exception-\u003egetStatus() .\" \". $exception-\u003egetMessage());\n    }\n  }\n```\n\n**Get prices by country**\n\nHere is an example  to know the credits that a single sending will take depending on the country of delivery:\n\n```php\n  public $username = 'myusername';\n  public $token = 'mytoken';\n\n  public function testCountryPrice()\n  {\n    try {\n      $countries = [\"CO\",\"ES\"];\n      $labsMobileClient = new LabsMobileClient($this-\u003eusername, $this-\u003etoken);\n      $bodyContries = new LabsMobileModelCountryPrice($countries);\n      $labsMobileClient = $labsMobileClient-\u003egetpricesCountry($bodyContries);\n      $body = $labsMobileClient-\u003egetBody();\n      self::assertTrue(true, $body);\n    } catch (RestException $exception) {\n      self::assertSame('Error', $exception-\u003egetStatus() .\" \". $exception-\u003egetMessage());\n    }\n    \n  }\n```\n\n**HLR Request**\n\nHere is an example queries the mobile phone status with the related information like current operator, format, active, ported information, subscription country, etc:\n\n```php\npublic $username = 'myusername';\n  public $token = 'mytoken';\n\n  public function testHlr()\n  {\n    try {\n      $numbers = [];//[34XXXXXXXX,34XXXXXXXX]\n      $labsMobileClient = new LabsMobileClient($this-\u003eusername, $this-\u003etoken);\n      $bodyHlr = new LabsMobileModelHlrRequest(json_encode($numbers));\n      $labsMobileClient = $labsMobileClient-\u003ehlrRequest($bodyHlr);\n      $body = $labsMobileClient-\u003egetBody();\n      $json = json_decode($body);\n      self::assertSame('ok', $json-\u003eresult);\n    } catch (RestException $exception) {\n      self::assertSame('Error', $exception-\u003egetStatus() .\" \". $exception-\u003egetMessage());\n    }\n  }\n```\n\n## Help\n\nIf you have questions, you can contact us through the support chat or through the support email support@labsmobile.com.\n\n[apidocs]: https://apidocs.labsmobile.com/\n[signUp]: https://www.labsmobile.com/en/signup\n[packages]: https://packagist.org/packages/labsmobile/sms-php\n[getcomposer]: https://getcomposer.org/\n[getcomposerdownload]: https://getcomposer.org/download/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabsmobile%2Fsms-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabsmobile%2Fsms-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabsmobile%2Fsms-php/lists"}