jbogarin / go-cisco-webex-teams Goto Github PK
View Code? Open in Web Editor NEWCisco Webex Teams Go SDK
License: MIT License
Cisco Webex Teams Go SDK
License: MIT License
Hi,
I just wanted to check that this library is still being maintained? There appears to be 18 commits since the 0.4.0 tag and I wondered if you'd be able to create a new version with the latest commits?
Thanks.
Hi,
There appears to be a new endpoint for listing recordings as an admin/compliance officer: https://developer.webex.com/docs/api/v1/recordings/list-recordings-for-an-admin-or-compliance-officer
Will you be adding this at all?
Many thanks,
D.
Hi, me again ;)
I'm experiencing a weird issue which I suspect is obvious, but I can't quite get my head around it...
Essentially, if I create two clients with NewClient()
using two separate tokens with SetAuthToken()
the second one seems to overwrite the first.
For example, this code works as expected:
client1 := webexteams.NewClient()
client1.SetAuthToken("first token here")
me1, _, _ := client1.People.GetMe()
fmt.Println(me1.DisplayName)
client2 := webexteams.NewClient()
client2.SetAuthToken("second token here")
me2, _, _ := client2.People.GetMe()
fmt.Println(me2.DisplayName)
But this does not, it basically prints the second clients display name twice
client1 := webexteams.NewClient()
client1.SetAuthToken("first token here")
client2 := webexteams.NewClient()
client2.SetAuthToken("second token here")
me1, _, _ := client1.People.GetMe()
fmt.Println(me1.DisplayName)
me2, _, _ := client2.People.GetMe()
fmt.Println(me2.DisplayName)
Any thoughts before I start digging into it further greatly appreciated.
Thanks.
"message":"Failed to get one on one conversation","errors":[{"description":"Failed to get one on one conversation"}
markDownMessage := &webexteams.MessageCreateRequest{
Markdown: "MESSAGE",
ToPersonEmail: "MY EMAIL",
}
_, rep, err := Client.Messages.CreateMessage(markDownMessage)
if err != nil {
fmt.Println(err.Error())
}
Whats going on here ?
If i make manually the request it works...
Can you help me?
Hi @jbogarin hope you're well. I'm just logging this issue to see if you have any plans to add the events endpoints:
https://developer.webex.com/docs/api/v1/events
Many thanks,
D.
Hi
Is it possible to add the additional query parameters for ListRecordings please?
https://github.com/jbogarin/go-cisco-webex-teams/blob/v0.4.3/sdk/recordings_api.go#L100
https://developer.webex.com/docs/api/v1/recordings/list-recordings
You have From
, To
, Max
and Paginate
.
I believe meetingId
, hostEmail
, siteUrl
, integrationTag
, topic
, format
, serviceType
and status
are now also available options?
Many thanks.
D.
Hi,
A common issue with the Webex APIs is the receipt of 429 errors. Is my understanding correct, that you would be relying on the use of Resty v2 for that capability?
If so, I'm unable to see where you're exporting access to that capability?
Any information you can provide greatly appreciated.
Thanks.
I want to know what is MessagesService.CreateMessage function's timeout, if there are some network problems, I want to send an alert, so I don't know this function's default timeout.
Hi,
Just trying to use the new version and I'm getting the following error, any thoughts?
go: github.com/go-resty/[email protected]: parsing go.mod: unexpected module path "gopkg.in/resty.v1"
go: error loading module requirements
Essentially I just created a new repo, used go get
to get resty v2.0.0 and go-cisco-webex-teams v0.2.0, created a basic main.go using the library and I get the error.
main.go:
package main
import (
"github.com/go-resty/resty/v2"
webexteams "github.com/jbogarin/go-cisco-webex-teams/sdk"
)
var Client *webexteams.Client
func main() {
client := resty.New()
token := ""
client.SetAuthToken(token)
Client = webexteams.NewClient(client)
}
Thanks.
Similar to #6 i'm seeing the below error when trying to use Go Modules to build my project. I'm using Go Lang version 1.12.9.
CGO_ENABLED=0 GO111MODULE=on go build -o prom2webex
go: finding github.com/google/go-querystring/query latest
go: github.com/go-resty/[email protected]: parsing go.mod: unexpected module path "gopkg.in/resty.v1"
go: error loading module requirements
Here is main.go
...
package main
import (
"fmt"
"log"
webexteams "github.com/jbogarin/go-cisco-webex-teams/sdk"
)
// Client is Webex Teams API client
// var Client *webexteams.Client
func main() {
// Client is Webex Teams API client
Client := webexteams.NewClient()
// TODO: remove hard coded roomID
myRoomID := "myroomid"
// POST messages - Text Message
message := &webexteams.MessageCreateRequest{
Text: "This is a text message fo testing",
RoomID: myRoomID,
}
newTextMessage, _, err := Client.Messages.CreateMessage(message)
if err != nil {
log.Fatal(err)
}
fmt.Println("POST:", newTextMessage.ID, newTextMessage.Text, newTextMessage.Created)
// POST messages - Markdown Message
//markDownMessage := &webexteams.MessageCreateRequest{
// Markdown: "This is a markdown message. *Italic*, **bold** and ***italic/bold***.",
// RoomID: myRoomID,
//}
//newMarkDownMessage, _, err := Client.Messages.CreateMessage(markDownMessage)
//if err != nil {
// log.Fatal(err)
//}
//fmt.Println("POST:", newMarkDownMessage.ID, newMarkDownMessage.Markdown, newMarkDownMessage.Created)
}
Here is go.mod
...
module path/to/my/project
go 1.12
require github.com/jbogarin/go-cisco-webex-teams v0.3.0
require github.com/go-resty/resty/v2 v2.0.0
According to the resty v2 doc the correct import path for using resty v2 with Go Modules is import "github.com/go-resty/resty/v2"
.
https://github.com/go-resty/resty#installation
https://github.com/go-resty/resty#usage
Can/should the code in this project we updated to import "github.com/go-resty/resty/v2"
instead of "github.com/go-resty/resty"
?
Hello,
The dates used in query params don't use the webex API format: ISO8601.
So the server returns a 400 BAD REQUEST with the message: "The request could not be understood by the server due to malformed syntax.".
To reproduce:
package main
import (
"fmt"
"log"
"time"
webexteams "github.com/jbogarin/go-cisco-webex-teams/sdk"
)
// Client is Webex Teams API client
var Client *webexteams.Client
func main() {
Client = webexteams.NewClient()
myRoomID := "<yourRoomID>"
messageQueryParams := &webexteams.ListMessagesQueryParams{
RoomID: myRoomID,
Before: time.Date(2022, time.August, 15, 0, 22, 12, 0, time.UTC),
}
messages, resp, err := Client.Messages.ListMessages(messageQueryParams)
if err != nil {
log.Fatal(err)
}
if resp.IsError() {
log.Fatal(string(resp.Body()))
}
for id, message := range messages.Items {
fmt.Println("GET:", id, message.ID, message.Text, message.Created)
}
}
This PR fixes the issue: #27
markDownMessage := &MessageCreateRequest{
Text: markdown,
ToPersonEmail: "[email protected]",
}
2021/06/17 22:54:37 {"message":"Failed to get one on one conversation","errors":[{"description":"Failed to get one on one conversation"}],"trackingId":"ROUTER_60CB6207-128A-01BB-4656-0AFDEAE34656"}
Hi Jose,
I was just using this SDK and I noticed that when I get a 401, I don't seem to get any indication of it so I'm unable to provide any feedback. Is that something you might change?
Many thanks,
Darren.
Hi,
I'm able to send a message to a space, but cannot get listmessages (for the same space) to work:
messages &{[]} resp {"message":"Failed to get activity.","errors":[{"description":"Failed to get activity."}],"trackingId":"ROUTER_..."} err <nil>
Code is:
Client = webexteams.NewClient()
messageQueryParams := &webexteams.ListMessagesQueryParams{
RoomID: room.webexRoomID,
Max: 5,
}
messages, resp, err := Client.Messages.ListMessages(messageQueryParams)
fmt.Printf("messages %v resp %v err %v\n", messages, resp, err)
if err != nil {
log.Fatal(err)
}
for id, message := range messages.Items {
fmt.Println("GET:", id, message.ID, message.Text, message.Created)
}
Is this due to an api change, or am I doing it wrong?
Hi Jose,
I think we spoke about this some time ago and I wondered if you'd managed to look into it any further. I thought I'd log it as an issue to continue the conversation.
Essentially the question was regarding the max
parameter.
When using the SDK and specifying a Max of 5, it actually returns all items. You mentioned that you believed that was to do with the paging I think. The webex docs say the following:
When requesting a list of resources the max query parameter may be used to control the number of items returned per page. For example, requesting GET /people?displayName=Harold&max=2 tells the API to return only 2 items per page.
And I think you took this to mean that when you specify the max parameter, you are just saying how many you want per page, and you are then returning all pages?
The docs go on to say:
If the requested max query parameter value exceeds what a particular API endpoint allows, only the maximum number of items allowed per page for that endpoint will be returned. A rel="next" link header will be present if another page of results is available.
So I was wondering if you might just return the single page containing the max requested along with the rel="next"
header using the RFC5988 standard Cisco mentions:
The Webex APIs implement the RFC5988 (Web Linking) standard for pagination. When requesting a list of resources the response may contain a Link header containing the URLs to the first, next, and previous page.
From memory, you were going to take a look at the python library to see how they handled it. And I think we discussed whether you would just pass the max parameter through or if you would abstract that away to enable an SDK user to specify a larger max size than the teams API and then use the paging internally to return the number the user requested (like the sparky sdk).
Ultimately though, what I'd like to achieve is that when I specify a max of 5, that only 5 results are returned?
Let me know what you think the best way to proceed is.
Speak soon. Thanks again,
D.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.