{"id":28578249,"url":"https://github.com/digitalocean/sample-functions-python-twilio-sms","last_synced_at":"2025-06-11T01:09:20.001Z","repository":{"id":50408788,"uuid":"512893709","full_name":"digitalocean/sample-functions-python-twilio-sms","owner":"digitalocean","description":"Sending sms via Twilio","archived":false,"fork":false,"pushed_at":"2024-04-26T05:28:36.000Z","size":19,"stargazers_count":19,"open_issues_count":2,"forks_count":13,"subscribers_count":99,"default_branch":"main","last_synced_at":"2025-01-15T00:21:59.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/digitalocean.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}},"created_at":"2022-07-11T20:04:38.000Z","updated_at":"2024-11-19T09:49:44.000Z","dependencies_parsed_at":"2022-09-15T01:03:21.775Z","dependency_job_id":null,"html_url":"https://github.com/digitalocean/sample-functions-python-twilio-sms","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fsample-functions-python-twilio-sms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fsample-functions-python-twilio-sms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fsample-functions-python-twilio-sms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fsample-functions-python-twilio-sms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalocean","download_url":"https://codeload.github.com/digitalocean/sample-functions-python-twilio-sms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fsample-functions-python-twilio-sms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259178544,"owners_count":22817388,"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":"2025-06-11T01:09:19.217Z","updated_at":"2025-06-11T01:09:19.994Z","avatar_url":"https://github.com/digitalocean.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample Function: Python \"Twilio SMS\"\n\n## Introduction\n\nThis repository contains a sample Twilio SMS function written in Python. You are able to send an sms using Twilio verified phone numbers. You can deploy it on DigitalOcean's App Platform as a Serverless Function component.\nDocumentation is available at https://docs.digitalocean.com/products/functions.\n\n### Requirements\n\n* You need a DigitalOcean account. If you don't already have one, you can sign up at [https://cloud.digitalocean.com/registrations/new](https://cloud.digitalocean.com/registrations/new).\n* You need a Twilio account. If you don't already have one, you can sign up at https://www.twilio.com/try-twilio.\n* To send and receive sms with Twilio, you need a Twilio virtual phone number. You can learn more at https://www.twilio.com/docs/phone-numbers.\n* The phone number you are sending a message to also has to be a twilio verified phone number.\n* You need to add your `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN` to the `.env` file to connect to the Twilio API.\n* To deploy from the command line, you will need the [DigitalOcean `doctl` CLI](https://github.com/digitalocean/doctl/releases).\n\n\n## Deploying the Function\n\n```bash\n# clone this repo\ngit clone git@github.com:digitalocean/sample-functions-python-twilio-sms.git\n```\n\n```\n# deploy the project, using a remote build so that compiled executable matched runtime environment\n\u003e doctl serverless deploy sample-functions-python-twilio-sms --remote-build\nDeploying 'sample-functions-python-twilio-sms'\n  to namespace 'fn-...'\n  on host 'https://faas-...'\nSubmitted action 'sms' for remote building and deployment in runtime python:default (id: ...)\n\nDeployed functions ('doctl sls fn get \u003cfuncName\u003e --url' for URL):\n  - sample/sms\n```\n\n## Using the Function\n\n```bash\ndoctl serverless functions invoke sample/sms -p from:1234567890 number:0123456789 message:Good Morning from Sammy.\n```\n```json\n{\n  \"body\": \"message sent\"\n}\n```\n\n### To send an email using curl:\n```\ncurl -X PUT -H 'Content-Type: application/json' {your-DO-app-url} -d '{\"from\":\"1234567890\", \"number\":\"0123456789\", \"message\":\"Good Morning from Sammy.\"}' \n```\n\n### Learn More\n\nYou can learn more about Functions and App Platform integration in [the official App Platform Documentation](https://www.digitalocean.com/docs/app-platform/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalocean%2Fsample-functions-python-twilio-sms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalocean%2Fsample-functions-python-twilio-sms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalocean%2Fsample-functions-python-twilio-sms/lists"}