webex

package module
v2.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MPL-2.0 Imports: 19 Imported by: 0

README

Webex Go SDK

A comprehensive, lightweight Go SDK for Cisco Webex API

Go Reference License: MPL 2.0 Open Source Go Tests Lint Codecov Release Go Report Card

Implementation Status

  • ✅ All REST APIs are fully implemented and working
  • ✅ WebSocket APIs with end-to-end encrypted message decryption
  • ✅ Real-time Webex Calling with WebRTC media (Mobius/BroadWorks)

Installation

go get github.com/WebexCommunity/webex-go-sdk/v2

Quick Start

package main

import (
    "fmt"
    "log"
    "os"

    "github.com/WebexCommunity/webex-go-sdk/v2"
)

func main() {
    // Get access token from environment
    accessToken := os.Getenv("WEBEX_ACCESS_TOKEN")
    if accessToken == "" {
        log.Fatal("WEBEX_ACCESS_TOKEN environment variable is required")
    }

    // Create client
    client, err := webex.NewClient(accessToken, nil)
    if err != nil {
        log.Fatalf("Error creating client: %v", err)
    }

    // Get my own details
    me, err := client.People().GetMe()
    if err != nil {
        log.Fatalf("Error getting my details: %v", err)
    }

    fmt.Printf("Hello, %s!\n", me.DisplayName)
}

Supported APIs

REST APIs (Fully Implemented)
  • People - Manage users in your organization
  • Messages - Send and receive messages in rooms
  • Rooms - Create and manage Webex rooms
  • Teams - Create and manage Webex teams
  • Team Memberships - Add and remove people from teams
  • Memberships - Add and remove people from rooms
  • Webhooks - Register for notifications
  • Attachment Actions - Handle interactive card submissions
  • Events - Subscribe to Webex events
  • Room Tabs - Manage tabs in Webex rooms
  • Meetings - Create, list, update, and delete Webex meetings
  • Meeting Transcripts - List, download, and manage meeting transcripts and snippets
  • Calling - Call history, call settings (DND, call waiting, call forwarding, voicemail), contacts
WebSocket APIs
  • Mercury - Real-time WebSocket connection with automatic reconnection
  • Conversation Events - Listen for messages, shares, and acknowledgements
  • End-to-End Encryption - Full JWE decryption using KMS (ECDH key exchange + AES-256-GCM)
Real-Time Call Control (Webex Calling)
  • CallingClient - Line registration with Mobius, call lifecycle management, Mercury event routing
  • AudioBridge - Browser-facing WebRTC PeerConnection with bidirectional RTP relay (PCMU/PCMA)
  • Call Control - Dial, answer, hold, resume, transfer (blind/consult), DTMF, mute/unmute
  • SignalingTransport - Transport-agnostic WebRTC signaling interface (WebSocket, gRPC, etc.)
  • Address Normalization - Phone number sanitization and SIP/tel URI handling

Examples

See the examples directory.

Sending a Message
message := &messages.Message{
    RoomID: "ROOM_ID",
    Text:   "Hello, World!",
}

createdMessage, err := client.Messages().Create(message)
if err != nil {
    log.Fatalf("Error sending message: %v", err)
}
fmt.Printf("Message sent: ID=%s\n", createdMessage.ID)

Documentation

For detailed documentation, examples, and API reference, see:

Requirements

  • Go 1.21 or later

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Add your name to CONTRIBUTORS.md if not already present
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

See CONTRIBUTORS.md for the list of contributors.

License

This project is licensed under the Mozilla Public License 2.0 - see the LICENSE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InternalPlugins

type InternalPlugins struct {
	Mercury *mercury.Client
	Device  *device.Client
}

InternalPlugins holds internal plugins that aren't part of the public API

type WebexClient

type WebexClient struct {
	// contains filtered or unexported fields
}

WebexClient is the top-level client for the Webex API

func NewClient

func NewClient(accessToken string, config *webexsdk.Config) (*WebexClient, error)

NewClient creates a new Webex client with the given access token and optional configuration

func (*WebexClient) AttachmentActions

func (c *WebexClient) AttachmentActions() *attachmentactions.Client

AttachmentActions returns the AttachmentActions plugin

func (*WebexClient) Calling

func (c *WebexClient) Calling() *calling.Client

Calling returns the Calling plugin for Webex Calling APIs (Call History, Call Settings, Voicemail, Contacts).

func (*WebexClient) Conversation

func (c *WebexClient) Conversation() (*conversation.Client, error)

Conversation returns a fully-wired Conversation client for real-time WebSocket message listening with automatic decryption.

This is a convenience method that abstracts away the manual setup of Device registration, Mercury WebSocket wiring, and encryption (KMS) authentication. The client is lazily initialized on first call and cached for subsequent calls.

Simple usage:

conv, err := client.Conversation()
conv.On("post", handler)
conv.Connect()
defer conv.Disconnect()

For advanced control over Device, Mercury, or Encryption configuration, use the lower-level APIs directly (device.New, mercury.New, conversation.New).

func (*WebexClient) Core

func (c *WebexClient) Core() *webexsdk.Client

Core returns the core Webex client

func (*WebexClient) Device

func (c *WebexClient) Device() *device.Client

Device returns the Device plugin (internal)

func (*WebexClient) Events

func (c *WebexClient) Events() *events.Client

Events returns the Events plugin

func (*WebexClient) Internal

func (c *WebexClient) Internal() *InternalPlugins

Internal returns a struct containing internal plugins

func (*WebexClient) Meetings

func (c *WebexClient) Meetings() *meetings.Client

Meetings returns the Meetings plugin

func (*WebexClient) Memberships

func (c *WebexClient) Memberships() *memberships.Client

Memberships returns the Memberships plugin

func (*WebexClient) Mercury

func (c *WebexClient) Mercury() *mercury.Client

Mercury returns the Mercury plugin (internal)

func (*WebexClient) Messages

func (c *WebexClient) Messages() *messages.Client

Messages returns the Messages plugin

func (*WebexClient) People

func (c *WebexClient) People() *people.Client

People returns the People plugin

func (*WebexClient) RoomTabs

func (c *WebexClient) RoomTabs() *roomtabs.Client

RoomTabs returns the RoomTabs plugin

func (*WebexClient) Rooms

func (c *WebexClient) Rooms() *rooms.Client

Rooms returns the Rooms plugin

func (*WebexClient) TeamMemberships

func (c *WebexClient) TeamMemberships() *teammemberships.Client

TeamMemberships returns the TeamMemberships plugin

func (*WebexClient) Teams

func (c *WebexClient) Teams() *teams.Client

Teams returns the Teams plugin

func (*WebexClient) Transcripts

func (c *WebexClient) Transcripts() *transcripts.Client

Transcripts returns the Transcripts plugin

func (*WebexClient) Webhooks

func (c *WebexClient) Webhooks() *webhooks.Client

Webhooks returns the Webhooks plugin

Directories

Path Synopsis
Package calling provides a client for the Webex Calling APIs.
Package calling provides a client for the Webex Calling APIs.
examples
calling command
Package main provides a web-based example application for the Webex Calling API.
Package main provides a web-based example application for the Webex Calling API.
events command
meetings command
memberships command
messages command
messages-listen command
people command
rooms command
roomtabs command
teammemberships command
teams command
transcripts command
webhooks command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL