{"id":24534746,"url":"https://github.com/jaycee0610/rootscratch-sms-api","last_synced_at":"2025-03-15T22:23:46.869Z","repository":{"id":236785602,"uuid":"793146864","full_name":"jaycee0610/RootScratch-SMS-API","owner":"jaycee0610","description":"Android SMS Gateway transforms your Android smartphone into an SMS gateway. It is a lightweight application that enables you to send SMS messages programmatically via an API, making it ideal for integrating SMS functionality into your applications or services.","archived":false,"fork":false,"pushed_at":"2025-02-25T07:50:29.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T08:36:13.346Z","etag":null,"topics":["php","rootscratch","sms","sms-api","sms-gateway"],"latest_commit_sha":null,"homepage":"https://sms.rootscratch.com","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/jaycee0610.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":"2024-04-28T15:04:05.000Z","updated_at":"2025-02-25T07:48:27.000Z","dependencies_parsed_at":"2025-02-12T17:41:18.897Z","dependency_job_id":null,"html_url":"https://github.com/jaycee0610/RootScratch-SMS-API","commit_stats":null,"previous_names":["jaycee0610/rootscratch-sms-api"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaycee0610%2FRootScratch-SMS-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaycee0610%2FRootScratch-SMS-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaycee0610%2FRootScratch-SMS-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaycee0610%2FRootScratch-SMS-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaycee0610","download_url":"https://codeload.github.com/jaycee0610/RootScratch-SMS-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243798021,"owners_count":20349521,"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":["php","rootscratch","sms","sms-api","sms-gateway"],"created_at":"2025-01-22T11:18:33.141Z","updated_at":"2025-03-15T22:23:46.863Z","avatar_url":"https://github.com/jaycee0610.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![Logo](https://repository-images.githubusercontent.com/793146864/6fb1ef96-255c-4946-bd88-3b26e7c17e3d)\n\n# 📱 Android SMS Gateway (PHP)\n\nAndroid SMS Gateway transforms your Android smartphone into an SMS gateway. It is a lightweight application that enables you to send SMS messages programmatically via an API, making it ideal for integrating SMS functionality into your applications or services.\n\n- [https://packagist.org/packages/rootscratch/sms](https://packagist.org/packages/rootscratch/sms)\n- [https://sms.rootscratch.com/](https://sms.rootscratch.com/)\n\n## 🚀 Installation\n\nTo install the `rootscratch/sms` via Composer, run the following command:\n\n```bash\ncomposer require rootscratch/sms\n```\n\n## 📖 Usage/Examples\n\nTo use the Rootscratch SMS in your PHP project, include the Composer autoloader:\n\n```php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nuse Rootscratch\\SMS\\Configuration;\n$configuration = new Configuration();\n\n// Set API Key\n$configuration-\u003esetApiKey('your_api_key');\n```\n\n## ⚙️ Configuration Usage\n\n```php\n/**\n * Configuration\n * \n * Get Devices = getDevices()\n * Get Balance = getBalance()\n * \n * Get Message By ID = getMessageByID($id) : if $id int = message id, if $id string = group id\n * \n * Get Message By Status = getMessagesByStatus($status, $deviceID = null, $simID = null, $time = null, $endTimestamp = null)\n * Get messages \"received\" on SIM 1 of device ID 8 in last 24 hours = getMessagesByStatus(\"Received\", 8, 0, time() - 86400)\n * \n * Get USSD Request By ID = getUssdRequestByID($id)\n * Get USSD requests with request text \"*150#\" sent in last 24 hours. = getUssdRequests(\"*150#\", null, null, time() - 86400)\n * \n * Add a new contact to contacts list 1 or resubscribe the contact if it already exists. = addContact(1, \"+11234567890\", \"Test\", true);\n * Unsubscribe a contact using the mobile number. = unsubscribeContact(1, \"+11234567890\");\n * \n */\necho json_encode($configuration-\u003egetDevices(), JSON_PRETTY_PRINT);\n```\n\n## 📤 Send Single SMS\n\n```php\nuse Rootscratch\\SMS\\Send;\n$sendMessage = new Send();\n\n$send_single = $sendMessage-\u003esendSingleMessage('mobile_number', 'Message');\n\necho json_encode($send_single, JSON_PRETTY_PRINT);\n```\n\n## 📥 Send Bulk Message\n\n```php\n$send_bulk = $sendMessage-\u003esendMessages([\n    [\n        \"number\" =\u003e \"6391234567890\",\n        \"message\" =\u003e \"Message 1\"\n    ],\n    [\n        \"number\" =\u003e \"6391234567891\",\n        \"message\" =\u003e \"Message 2\"\n    ]\n]);\necho json_encode($send_bulk, JSON_PRETTY_PRINT);\n```\n\n## 🖼️ Send MMS Sample\n\n- Use All Sims = sendMessages(messages = array, option = USE_ALL_SIMS)\n- Use All Devices = sendMessages(messages = array, option = USE_ALL_DEVICES)\n- Use Specified Devices = sendMessages(messages = array, option = USE_SPECIFIED, devices = array)\n\n```php\n/**\n * Send MMS Sample\n * Use All Sims = sendMessages(messages = array, option = USE_ALL_SIMS)\n * Use All Devices = sendMessages(messages = array, option = USE_ALL_DEVICES)\n * Use Specified Devices = sendMessages(messages = array, option = USE_SPECIFIED, devices = array)\n */\n\n$send_bulk_mms = $sendMessage-\u003esendMessages([\n    [\n        \"number\" =\u003e \"639123456789\",\n        \"message\" =\u003e \"Test 1\",\n        \"type\" =\u003e \"mms\",\n        \"attachments\" =\u003e 'https://sample.com/1.png'\n    ],\n    [\n        \"number\" =\u003e \"639123456789\",\n        \"message\" =\u003e \"Test 2\",\n        \"type\" =\u003e \"mms\",\n        \"attachments\" =\u003e 'https://sample.com/1.png'\n    ]\n]);\necho json_encode($send_bulk_mms, JSON_PRETTY_PRINT);\n```\n\n## 📇 Send Message To Contacts List\n\nSend a message on **schedule** to contacts in contacts list with ID of 1.\n\n```php\n$sendMessage-\u003esendMessageToContactsList(1, \"Test\", null, null, strtotime(\"+2 minutes\"));\n```\n\nSend a message to contacts in contacts list with ID of 1.\n\n```php\n$send_contact_list = $sendMessage-\u003esendMessageToContactsList(\n    1,\n    'Via Contact List!',\n    Configuration::USE_SPECIFIED,\n    [4]\n);\necho json_encode($send_contact_list, JSON_PRETTY_PRINT);\n```\n\n## 📲 Send USSD Request\n\nSend a USSD request using the default SIM of Device ID 1.\n\n```php\n$send_ussd = $sendMessage-\u003esendUssdRequest('*150#', 1);\necho json_encode($send_ussd, JSON_PRETTY_PRINT);\n```\n\nSend a USSD request using SIM in **slot 1** of Device ID 1.\n\n```php\n$send_ussd = $sendMessage-\u003esendUssdRequest('*150#', 1, 0);\necho json_encode($send_ussd, JSON_PRETTY_PRINT);\n```\n\nSend a USSD request using SIM in **slot 2** of Device ID 1.\n\n```php\n$send_ussd = $sendMessage-\u003esendUssdRequest('*150#', 1, 1);\necho json_encode($send_ussd, JSON_PRETTY_PRINT);\n```\n\n## 🔄 Resend SMS\n\n```php\n/**\n * Resend SMS Sample\n * Resend Message By ID = resendMessageByID(id = int)\n * Resend Messages By Group ID = resendMessagesByGroupID(group_id = string, status = string)\n */\n\nuse Rootscratch\\SMS\\Resend;\n\n$resend = new Resend();\n\n$resend_by_id = $resend-\u003eresendMessagesByGroupID('MZ7QabWteHWfSkjkgX67acc67bcc2048.73874662', 'Failed');\necho json_encode($resend_by_id, JSON_PRETTY_PRINT);\n```\n\n## 🛠️ Support\n\nFor support, please email me at jaycee@rootscratch.com.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaycee0610%2Frootscratch-sms-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaycee0610%2Frootscratch-sms-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaycee0610%2Frootscratch-sms-api/lists"}