{"id":20208189,"url":"https://github.com/cubiclesoft/php-twilio-sdk","last_synced_at":"2025-07-06T19:09:43.459Z","repository":{"id":145129747,"uuid":"212205343","full_name":"cubiclesoft/php-twilio-sdk","owner":"cubiclesoft","description":"An ultra-lightweight PHP SDK for accessing Twilio APIs and emitting valid TwiML verbs in response to webhook calls.  Also works with SignalWire!","archived":false,"fork":false,"pushed_at":"2023-02-04T18:00:27.000Z","size":215,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T11:22:45.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cubiclesoft.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":"support/cacert.pem","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-01T21:44:45.000Z","updated_at":"2024-11-26T17:10:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce27717d-5e21-42d8-8bfc-77fa83ec03b8","html_url":"https://github.com/cubiclesoft/php-twilio-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cubiclesoft/php-twilio-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fphp-twilio-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fphp-twilio-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fphp-twilio-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fphp-twilio-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cubiclesoft","download_url":"https://codeload.github.com/cubiclesoft/php-twilio-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fphp-twilio-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261397364,"owners_count":23152485,"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":[],"created_at":"2024-11-14T05:34:29.439Z","updated_at":"2025-06-23T02:05:00.980Z","avatar_url":"https://github.com/cubiclesoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Twilio SDK for PHP\n==================\n\nAn ultra-lightweight PHP SDK for accessing Twilio APIs and emitting valid TwiML verbs in response to webhook calls.  Also works with [SignalWire](https://signalwire.com/).\n\n[![Donate](https://cubiclesoft.com/res/donate-shield.png)](https://cubiclesoft.com/donate/) [![Discord](https://img.shields.io/discord/777282089980526602?label=chat\u0026logo=discord)](https://cubiclesoft.com/product-support/github/)\n\nFeatures\n--------\n\n* Does what it says on the tin in a mere 7KB of code.\n* Works with [Twilio](https://www.twilio.com/) and [SignalWire](https://signalwire.com/).\n* Has a liberal open source license.  MIT or LGPL, your choice.\n* Designed for relatively painless integration into your project.\n* Sits on GitHub for all of that pull request and issue tracker goodness to easily submit changes and ideas respectively.\n\nGetting Started\n---------------\n\nSend a SMS message:\n\n```php\n\u003c?php\n\trequire_once \"support/sdk_twilio.php\";\n\n\t// Twilio Account Sid and Token.\n\t$twilio_sid = \"YOUR_ACCOUNT_SID\";\n\t$twilio_token = \"YOUR_ACCOUNT_TOKEN\";\n\n\t$twilio = new TwilioSDK();\n\t$twilio-\u003eSetAccessInfo($twilio_sid, $twilio_token);\n\n\t// For SignalWire, use:\n//\t$twilio-\u003eSetAccessInfo($twilio_sid, $twilio_token, \"https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01\");\n\n\t$postvars = array(\n\t\t\"From\" =\u003e \"+13145557878\",  // Twilio phone number\n\t\t\"To\" =\u003e \"+13145551212\",    // Destination phone number\n\t\t\"Body\" =\u003e \"SMS message to send.\"\n\t);\n\n\t$result = $twilio-\u003eRunAPI(\"POST\", \"Messages\", $postvars);\n\tif (!$result[\"success\"])\n\t{\n\t\tvar_dump($result);\n\n\t\texit();\n\t}\n?\u003e\n```\n\nHandle an incoming webhook call:\n\n```php\n\u003c?php\n\trequire_once \"support/sdk_twilio.php\";\n\n\t// Twilio Account Sid and Token.\n\t$twilio_sid = \"YOUR_ACCOUNT_SID\";\n\t$twilio_token = \"YOUR_ACCOUNT_TOKEN\";\n\n\t$twilio = new TwilioSDK();\n\t$twilio-\u003eSetAccessInfo($twilio_sid, $twilio_token);\n\n\t// Secure the request.\n\t$twilio-\u003eValidateWebhookRequest();\n\n\t$twilio-\u003eStartXMLResponse();\n\n\tif (isset($_REQUEST[\"CallSid\"]))\n\t{\n\t\tif (isset($_REQUEST[\"Digits\"]) \u0026\u0026 $_REQUEST[\"Digits\"] == \"1\")\n\t\t{\n\t\t\t$twilio-\u003eOutputXMLTag(\"Say\", array(), \"It's sunny and warm outside.\");\n\t\t}\n\t\telse if (isset($_REQUEST[\"Digits\"]) \u0026\u0026 $_REQUEST[\"Digits\"] == \"2\")\n\t\t{\n\t\t\t$twilio-\u003eOutputXMLTag(\"Say\", array(), \"It's going to be a balmy 72 degrees outside today with a very slight chance of delicious pie falling from the sky.\");\n\t\t}\n\n\t\t$options = array();\n\t\t$options[] = \"Press 1 to get the weather.\";\n\t\t$options[] = \"Press 2 to get the forecast.\";\n\n\t\t$twilio-\u003eOpenXMLTag(\"Gather\", array(\"numDigits\" =\u003e \"1\"));\n\t\t$twilio-\u003eOutputXMLTag(\"Say\", array(), implode(\"  \", $options));\n\t\t$twilio-\u003eCloseXMLTag(\"Gather\");\n\n\t\t$twilio-\u003eOutputXMLTag(\"Redirect\", array(), Request::GetFullURLBase());\n\t}\n\n\t$twilio-\u003eEndXMLResponse();\n?\u003e\n```\n\nMore Information\n----------------\n\n* [SDK documentation](https://github.com/cubiclesoft/php-twilio-sdk/blob/master/docs/sdk_twilio.md) - The TwilioSDK class documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubiclesoft%2Fphp-twilio-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcubiclesoft%2Fphp-twilio-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubiclesoft%2Fphp-twilio-sdk/lists"}