Usage
The full API of this library can be found in api.md.package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("TELNYX_API_KEY")
)
response, err := client.Calls.Dial(context.TODO(), telnyx.CallDialParams{
ConnectionID: "conn12345",
From: "+15557654321",
To: telnyx.CallDialParamsToUnion{
OfString: telnyx.String("+15551234567"),
},
WebhookURL: telnyx.String("https://your-webhook.url/events"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}