{"id":13677447,"url":"https://github.com/kevinburke/twilio-go","last_synced_at":"2025-04-29T11:30:54.963Z","repository":{"id":14957919,"uuid":"74402380","full_name":"kevinburke/twilio-go","owner":"kevinburke","description":"Twilio Go library","archived":false,"fork":true,"pushed_at":"2024-07-16T17:23:35.000Z","size":626,"stargazers_count":142,"open_issues_count":21,"forks_count":70,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-11T19:41:02.067Z","etag":null,"topics":["api","client","golang","http","twilio"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/kevinburke/twilio-go","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"saintpete/twilio-go","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kevinburke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-11-21T20:20:13.000Z","updated_at":"2024-11-04T23:51:26.000Z","dependencies_parsed_at":"2023-01-16T20:46:57.536Z","dependency_job_id":null,"html_url":"https://github.com/kevinburke/twilio-go","commit_stats":null,"previous_names":[],"tags_count":82,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinburke%2Ftwilio-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinburke%2Ftwilio-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinburke%2Ftwilio-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinburke%2Ftwilio-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinburke","download_url":"https://codeload.github.com/kevinburke/twilio-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251493728,"owners_count":21598156,"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":["api","client","golang","http","twilio"],"created_at":"2024-08-02T13:00:42.348Z","updated_at":"2025-04-29T11:30:52.161Z","avatar_url":"https://github.com/kevinburke.png","language":"Go","funding_links":[],"categories":["Capability tokens"],"sub_categories":[],"readme":"# twilio-go\n\nA client for accessing the Twilio API with several nice features:\n\n- Easy-to-use helpers for purchasing phone numbers and sending MMS messages\n\n- E.164 support, times that are parsed into a time.Time, and other smart types.\n\n- Finer grained control over timeouts with a Context, and the library uses\n  wall-clock HTTP timeouts, not socket timeouts.\n\n- Easy debugging network traffic by setting DEBUG_HTTP_TRAFFIC=true in your\n  environment.\n\n- Easily find calls and messages that occurred between a particular\nset of `time.Time`s, down to the nanosecond, with GetCallsInRange /\nGetMessagesInRange.\n\n- It's clear when the library will make a network request, there are no\nunexpected latency spikes when paging from one resource to the next.\n\n- Uses threads to fetch resources concurrently; for example, has methods to\nfetch all Media for a Message concurrently.\n\n- Usable, [one sentence descriptions of Alerts][alert-descriptions].\n\n[alert-descriptions]: https://godoc.org/github.com/kevinburke/twilio-go#Alert.Description\n\nHere are some example use cases:\n\n```go\nconst sid = \"AC123\"\nconst token = \"456bef\"\n\nclient := twilio.NewClient(sid, token, nil)\n\n// Send a message\nmsg, err := client.Messages.SendMessage(\"+14105551234\", \"+14105556789\", \"Sent via go :) ✓\", nil)\n\n// Start a phone call\nvar callURL, _ = url.Parse(\"https://kevin.burke.dev/zombo/zombocom.mp3\")\ncall, err := client.Calls.MakeCall(\"+14105551234\", \"+14105556789\", callURL)\n\n// Buy a number\nnumber, err := client.IncomingNumbers.BuyNumber(\"+14105551234\")\n\n// Get all calls from a number\ndata := url.Values{}\ndata.Set(\"From\", \"+14105551234\")\ncallPage, err := client.Calls.GetPage(context.TODO(), data)\n\n// Iterate over calls\niterator := client.Calls.GetPageIterator(url.Values{})\nfor {\n    page, err := iterator.Next(context.TODO())\n    if err == twilio.NoMoreResults {\n        break\n    }\n    fmt.Println(\"start\", page.Start)\n}\n```\n\nA [complete documentation reference can be found at\ngodoc.org](https://godoc.org/github.com/kevinburke/twilio-go).\n\n## In Production\n\ntwilio-go is being used by the following applications:\n\n- [Logrole][logrole], an open source Twilio log viewer that's faster than the API.\n\nUsing twilio-go in production? [Let me know!](mailto:kevin@burke.services)\n\n[logrole]: https://github.com/kevinburke/logrole\n\n## Supported API's\n\nThe API is unlikely to change, and currently covers these resources:\n\n- Alerts\n- Applications\n- Calls\n- Conferences\n- Faxes\n- Incoming Phone Numbers\n- Available Phone Numbers\n- Keys\n- Messages\n- Media\n- Monitor\n- Outgoing Caller ID's\n- Pricing\n- Queues\n- Recordings\n- Task Router\n  - Activities\n  - TaskQueues\n  - Workers\n  - Workflows\n- Transcriptions\n- Wireless\n- Voice Insights\n- Access Tokens for IPMessaging, Video and Programmable Voice SDK\n\n### Error Parsing\n\nIf the twilio-go client gets an error from the Twilio API, we attempt to convert\nit to a [`rest.Error`][rest.error] before returning. Here's an example 404.\n\n[rest.error]: https://godoc.org/github.com/kevinburke/rest#Error\n\n```\n\u0026rest.Error{\n    Title: \"The requested resource ... was not found\",\n    ID: \"20404\",\n    Detail: \"\",\n    Instance: \"\",\n    Type: \"https://www.twilio.com/docs/errors/20404\",\n    StatusCode: 404\n}\n```\n\nNot all errors will be a `rest.Error` however - HTTP timeouts, canceled\ncontext.Contexts, and JSON parse errors (HTML error pages, bad gateway\nresponses from proxies) may also be returned as plain Go errors.\n\n### Twiml Generation\n\nThere are no plans to support Twiml generation in this library. It may be\nmore readable and maintainable to manually write the XML involved in a Twiml\nresponse.\n\n### Errata\n\n- Media URL's used to be returned over HTTP. twilio-go rewrites these URL's to be\n  HTTPS before returning them to you.\n\n- A subset of Notifications returned code 4107, which doesn't exist. These\n  notifications should have error code 14107. We rewrite the error code\n  internally before returning it to you.\n\n- The only provided API for filtering calls or messages by date grabs all\nmessages for an entire day, and the day ranges are only available for UTC. Use\nGetCallsInRange or GetMessagesInRange to do timezone-aware, finer-grained date\nfiltering.\n\n- You can get Alerts for a given Call or MMS by passing `ResourceSid=CA123` as\na filter to Alerts.GetPage. This functionality is not documented in the API.\n\n## Consulting\n\nI'm available for hire, for Twilio work or general-purpose engineering. For more\non what I can do for your company, see here: https://burke.services/twilio.html.\nContact me: kevin@burke.services\n\n## Donating\n\nDonations free up time to review pull requests, respond to bug reports, and\nadd new features. In the absence of donations there are no guarantees about\ntimeliness for reviewing or responding to proposed changes; I don't get paid\nby anyone else to work on this. You can send donations via Github's \"Sponsor\"\nmechanism or Paypal's \"Send Money\" feature to kev@inburke.com. Donations are not\ntax deductible in the USA.\n\n[zero-results]: https://github.com/saintpete/twilio-go/issues/8\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinburke%2Ftwilio-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinburke%2Ftwilio-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinburke%2Ftwilio-go/lists"}