Skip to content
telnyx-webrtc-go logo

Telnyx Webrtc - Go

telnyx-webrtc-go

Manage WebRTC credentials and mobile push notification settings. Use when building browser-based or mobile softphone applications. This skill provides Go SDK examples.

SKILL.md

Full skill instructions

<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->

Telnyx Webrtc - Go

Installation

go get github.com/​team-telnyx/​telnyx-go

Setup

import (
  "context"
  "fmt"
  "os"

  "github.com/​team-telnyx/​telnyx-go"
  "github.com/​team-telnyx/​telnyx-go/​option"
)

client := telnyx.NewClient(
  option.WithAPIKey(os.Getenv("TELNYX_API_KEY")),
)

All examples below assume client is already initialized as shown above.

List mobile push credentials

GET /​mobile_push_credentials

	page, err := client.MobilePushCredentials.List(context.TODO(), telnyx.MobilePushCredentialListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)

Creates a new mobile push credential

POST /​mobile_push_credentials

	pushCredentialResponse, err := client.MobilePushCredentials.New(context.TODO(), telnyx.MobilePushCredentialNewParams{
		OfIos: &telnyx.MobilePushCredentialNewParamsCreateMobilePushCredentialRequestIos{
			Alias:       "LucyIosCredential",
			Certificate: "-----BEGIN CERTIFICATE----- MIIGVDCCBTKCAQEAsNlRJVZn9ZvXcECQm65czs... -----END CERTIFICATE-----",
			PrivateKey:  "-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAsNlRJVZn9ZvXcECQm65czs... -----END RSA PRIVATE KEY-----",
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", pushCredentialResponse.Data)

Retrieves a mobile push credential

Retrieves mobile push credential based on the given push_credential_id

GET /​mobile_push_credentials/​{push_credential_id}

	pushCredentialResponse, err := client.MobilePushCredentials.Get(context.TODO(), "0ccc7b76-4df3-4bca-a05a-3da1ecc389f0")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", pushCredentialResponse.Data)

Deletes a mobile push credential

Deletes a mobile push credential based on the given push_credential_id

DELETE /​mobile_push_credentials/​{push_credential_id}

	err := client.MobilePushCredentials.Delete(context.TODO(), "0ccc7b76-4df3-4bca-a05a-3da1ecc389f0")
	if err != nil {
		panic(err.Error())
	}

List all credentials

List all On-demand Credentials.

GET /​telephony_credentials

	page, err := client.TelephonyCredentials.List(context.TODO(), telnyx.TelephonyCredentialListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)

Create a credential

Create a credential.

POST /​telephony_credentials — Required: connection_id

	telephonyCredential, err := client.TelephonyCredentials.New(context.TODO(), telnyx.TelephonyCredentialNewParams{
		ConnectionID: "1234567890",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", telephonyCredential.Data)

Get a credential

Get the details of an existing On-demand Credential.

GET /​telephony_credentials/​{id}

	telephonyCredential, err := client.TelephonyCredentials.Get(context.TODO(), "id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", telephonyCredential.Data)

Update a credential

Update an existing credential.

PATCH /​telephony_credentials/​{id}

	telephonyCredential, err := client.TelephonyCredentials.Update(
		context.TODO(),
		"id",
		telnyx.TelephonyCredentialUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", telephonyCredential.Data)

Delete a credential

Delete an existing credential.

DELETE /​telephony_credentials/​{id}

	telephonyCredential, err := client.TelephonyCredentials.Delete(context.TODO(), "id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", telephonyCredential.Data)

Create an Access Token.

Create an Access Token (JWT) for the credential.

POST /​telephony_credentials/​{id}/​token

	response, err := client.TelephonyCredentials.NewToken(context.TODO(), "id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response)

More skills from team-telnyx

10dlc-registration logo
team-telnyx/telnyx-toolkit

10dlc-registration

Register for 10DLC as a sole proprietor to enable SMS messaging in the USA. Use when setting up A2P SMS, registering brands/campaigns, or assigning phone numbers for compliant US messaging. Requires Telnyx CLI.

3 0
View
telnyx-embeddings logo
team-telnyx/telnyx-toolkit

telnyx-embeddings

Text-to-vector embeddings and semantic search using Telnyx AI. Generate embedding vectors via an OpenAI-compatible API — no OpenAI or Google API keys required.

3 0
View
telnyx-rag logo
team-telnyx/telnyx-toolkit

telnyx-rag

Semantic search and Q&A over workspace files using Telnyx Storage + AI embeddings. Index your memory, knowledge, and skills for natural language retrieval and AI-powered answers.

3 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View