{"id":37173740,"url":"https://github.com/delta/plivo-go","last_synced_at":"2026-01-14T20:18:19.451Z","repository":{"id":57515622,"uuid":"236309223","full_name":"delta/plivo-go","owner":"delta","description":"A Go SDK to make voice calls \u0026 send SMS using Plivo and to generate Plivo XML","archived":false,"fork":true,"pushed_at":"2020-01-30T18:57:51.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T09:36:58.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"plivo/plivo-go","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/delta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-26T12:28:44.000Z","updated_at":"2020-01-30T18:57:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/delta/plivo-go","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/delta/plivo-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delta%2Fplivo-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delta%2Fplivo-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delta%2Fplivo-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delta%2Fplivo-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delta","download_url":"https://codeload.github.com/delta/plivo-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delta%2Fplivo-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-14T20:18:18.705Z","updated_at":"2026-01-14T20:18:19.443Z","avatar_url":"https://github.com/delta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# plivo-go\n\n[![Build Status](https://travis-ci.org/plivo/plivo-go.svg?branch=master)](https://travis-ci.org/plivo/plivo-go)\n[![GoDoc](https://godoc.org/github.com/plivo/plivo-go?status.svg)](https://godoc.org/github.com/plivo/plivo-go)\n\nThe Plivo Go SDK makes it simpler to integrate communications into your Go applications using the Plivo REST API. Using the SDK, you will be able to make voice calls, send SMS and generate Plivo XML to control your call flows.\n\n## Prerequisites\n\n- Go \u003e= 1.7.x\n\n## Installation\n\n### To Install Stable release\n\nYou can use the Stable release using the `go` command.\n\n    $ go get github.com/plivo/plivo-go\n\nYou can also install by cloning this repository into your `GOPATH`.\n\n### To Install Beta release\n\n1. In terminal, using the following command, create a new folder called **test-plivo-beta**.\n\n    ```\n    $ mkdir test-plivo-beta\n    ```\n\n\t**Note:** Make sure the new folder is outside your GOPATH.\n\n2. Change your directory to the new folder.\n3. Using the following command, initialize a new module:\n\n    ```\n    $ go mod init github.com/plivo/beta\n    ```\n\n    You will see the following return:\n\n    ```\n    $ go mod init github.com/plivo/beta\n    ```\n\n4. Next, create a new go file with the following code:\n\n    ```go\n    package main\n\n    import (\n    \"fmt\"\n    \"github.com/plivo/plivo-go\"\n    )\n\n    const authId  = \"auth_id\"\n    const authToken = \"auth_token\"\n\n    func main() {\n    \ttestPhloGetter()\n    }\n\n    func testPhloGetter() {\n    \tphloClient,err := plivo.NewPhloClient(authId, authToken, \u0026plivo.ClientOptions{})\n    \tif err != nil {\n    \t\tpanic(err)\n    \t}\n    \tresponse, err := phloClient.Phlos.Get(\"phlo_id\")\n    \tif err != nil {\n    \t\tpanic(err)\n    \t}\n    \tfmt.Printf(\"Response: %#v\\n\", response)\n    }\n    ```\n\n    **Note:** Make sure you enter your `auth_id` and `auth_token` before you initialize the code.\n\n5. Run the following command to build the packages:\n\n    ```\n    $ go build\n    ```\n    \u003cimg id=\"myImg\" src=\"https://s3.amazonaws.com/plivo_blog_uploads/static_assets/images/server_sdks/step5.png\" alt=\"payload_defined\" style=\"border: 1px solid #e8eaf1;\"\u003e\n\n    A file named go.mod will be generated.\n\n6. Open go.mod using the command `vim go.mod` and edit the **plivo-go** version to the beta version you want to download.\n\n    \u003cimg id=\"myImg\" src=\"https://s3.amazonaws.com/plivo_blog_uploads/static_assets/images/server_sdks/step6.png\" alt=\"payload_defined\" style=\"border: 1px solid #e8eaf1;\"\u003e\n\n    **Note:** You can see the full list of releases [here](https://github.com/plivo/plivo-go/releases).\n\n    For example, change\n\n    ```\n    github.com/plivo/plivo-go v4.0.5+incompatible \n    ```\n\n    to \n\n    ```\n    github.com/plivo/plivo-go v4.0.6-beta1\n    ```\n\n7. Once done, save the go.mod.\n8. Run **go build** to build the packages.\n\n    **go.mod** will be updated with the beta version.\n\nYou can now use the features available in the Beta branch.\n\n## Getting started\n\n### Authentication\nTo make the API requests, you need to create a `Client` and provide it with authentication credentials (which can be found at [https://manage.plivo.com/dashboard/](https://manage.plivo.com/dashboard/)).\n\nWe recommend that you store your credentials in the `PLIVO_AUTH_ID` and the `PLIVO_AUTH_TOKEN` environment variables, so as to avoid the possibility of accidentally committing them to source control. If you do this, you can initialise the client with no arguments and it will automatically fetch them from the environment variables:\n\n```go\npackage main\n\nimport \"github.com/plivo/plivo-go\"\n\nfunc main()  {\n  client, err := plivo.NewClient(\"\", \"\", \u0026plivo.ClientOptions{})\n  if err != nil {\n    panic(err)\n  }\n}\n```\nAlternatively, you can specifiy the authentication credentials while initializing the `Client`.\n\n```go\npackage main\n\nimport \"github.com/plivo/plivo-go\"\n\nfunc main()  {\n client, err := plivo.NewClient(\"your_auth_id\", \"your_auth_token\", \u0026plivo.ClientOptions{})\n if err != nil {\n   panic(err)\n }\n}\n```\n\n## The Basics\nThe SDK uses consistent interfaces to create, retrieve, update, delete and list resources. The pattern followed is as follows:\n\n```go\nclient.Resources.Create(Params{}) // Create\nclient.Resources.Get(Id) // Get\nclient.Resources.Update(Id, Params{}) // Update\nclient.Resources.Delete(Id) // Delete\nclient.Resources.List() // List all resources, max 20 at a time\n```\n\nUsing `client.Resources.List()` would list the first 20 resources by default (which is the first page, with `limit` as 20, and `offset` as 0). To get more, you will have to use `limit` and `offset` to get the second page of resources.\n\n## Examples\n\n### Send a message\n\n```go\npackage main\n\nimport \"github.com/plivo/plivo-go\"\n\nfunc main()  {\n  client, err := plivo.NewClient(\"\", \"\", \u0026plivo.ClientOptions{})\n  if err != nil {\n    panic(err)\n  }\n  client.Messages.Create(plivo.MessageCreateParams{\n    Src: \"the_source_number\",\n    Dst: \"the_destination_number\",\n    Text: \"Hello, world!\",\n  })\n}\n```\n\n### Make a call\n\n```go\npackage main\n\nimport \"github.com/plivo/plivo-go\"\n\nfunc main()  {\n  client, err := plivo.NewClient(\"\", \"\", \u0026plivo.ClientOptions{})\n  if err != nil {\n    panic(err)\n  }\n  client.Calls.Create(plivo.CallCreateParams{\n    From: \"the_source_number\",\n    To: \"the_destination_number\",\n    AnswerURL: \"http://answer.url\",\n  })\n}\n```\n\n### Generate Plivo XML\n\n```go\npackage main\n\nimport \"github.com/plivo/plivo-go/plivo/xml\"\n\nfunc main()  {\n  println(xml.ResponseElement{\n    Contents: []interface{}{\n      new(xml.SpeakElement).SetContents(\"Hello, world!\"),\n    },\n    }.String())\n}\n```\n\nThis generates the following XML:\n\n```xml\n\u003cResponse\u003e\n  \u003cSpeak\u003eHello, world!\u003c/Speak\u003e\n\u003c/Response\u003e\n```\n\n### Run a PHLO\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"plivo-go\"\n)\n\n// Initialize the following params with corresponding values to trigger resources\n\nconst authId  = \"auth_id\"\nconst authToken = \"auth_token\"\nconst phloId = \"phlo_id\"\n\n// with payload in request\n\nfunc main() {\n\ttestPhloRunWithParams()\n}\n\nfunc testPhloRunWithParams() {\n\tphloClient,err := plivo.NewPhloClient(authId, authToken, \u0026plivo.ClientOptions{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tphloGet, err := phloClient.Phlos.Get(phloId)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t//pass corresponding from and to values\n\ttype params map[string]interface{}\n\tresponse, err := phloGet.Run(params{\n\t\t\"from\": \"111111111\",\n\t\t\"to\": \"2222222222\",\n\t})\n\n\tif (err != nil) {\n\t\tprintln(err)\n\t}\n\tfmt.Printf(\"Response: %#v\\n\", response)\n}\n```\n\n### More examples\nRefer to the [Plivo API Reference](https://api-reference.plivo.com/latest/go/introduction/overview) for more examples. Also refer to the [guide to setting up dev environment](https://developers.plivo.com/getting-started/setting-up-dev-environment/) on [Plivo Developers Portal](https://developers.plivo.com) to setup a simple Go server \u0026 use it to test out your integration in under 5 minutes.\n\n## Reporting issues\nReport any feedback or problems with this version by [opening an issue on Github](https://github.com/plivo/plivo-go/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelta%2Fplivo-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelta%2Fplivo-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelta%2Fplivo-go/lists"}