webex

package module
v1.0.4 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: 13 Imported by: 0

README

WebexGopher - Image generated by ChatGPT

Webex Go SDK

A comprehensive, lightweight Go SDK for Cisco Webex API

Go Reference Open Source Go Tests Lint Codecov Release Go Report Card

Implementation Status

  • ✅ All REST APIs are fully implemented and working
  • ⚠️ Websocket APIs are partially implemented
    • 🚧 Decryption of messages from websocket is pending implementation (help needed)

Installation

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

Quick Start

package main

import (
    "fmt"
    "log"
    "os"

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

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
Websocket APIs (Partially Implemented)
  • Messages over Websocket - Real-time messaging (message decryption pending)

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.20 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) 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) 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) Webhooks

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

Webhooks returns the Webhooks plugin

Directories

Path Synopsis
examples
events command
memberships command
messages command
messages-listen command
people command
rooms command
roomtabs command
teammemberships command
teams command
webhooks command

Jump to

Keyboard shortcuts

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