A comprehensive, lightweight Go SDK for Cisco Webex API
- ✅ All REST APIs are fully implemented and working
⚠️ Websocket APIs are partially implemented- 🚧 Decryption of messages from websocket is pending implementation (help needed)
go get github.com/tejzpr/webex-go-sdk/v2package main
import (
"fmt"
"log"
"os"
"github.com/tejzpr/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)
}- 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
- Messages over Websocket - Real-time messaging (message decryption pending)
See the examples directory.
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)For detailed documentation, examples, and API reference, see:
- Go 1.20 or later
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Add your name to CONTRIBUTORS.md if not already present
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
See CONTRIBUTORS.md for the list of contributors.
This project is licensed under the Mozilla Public License 2.0 - see the LICENSE.