Closed Verzu23 closed 2 years ago
I've never seen that error. Can you send the API request you are doing in curl, postman or something like that?
In Postman I set URL: https://webexapis.com/v1/messages Set Header Authorization: Bearer TOKEN Set body:
And it works as expected
With the library seems execute the same header and body but probably there's something different...
I just tested this and it works:
package main
import (
"fmt"
"log"
webexteams "github.com/jbogarin/go-cisco-webex-teams/sdk"
)
var Client *webexteams.Client
func main() {
Client = webexteams.NewClient()
markDownMessage := &webexteams.MessageCreateRequest{
Markdown: "This is a markdown message. *Italic*, **bold** and ***italic/bold***.",
ToPersonEmail: "blurr@webex.bot",
}
newMarkDownMessage, _, err := Client.Messages.CreateMessage(markDownMessage)
if err != nil {
log.Fatal(err)
}
fmt.Println("POST:", newMarkDownMessage.ID, newMarkDownMessage.Markdown, newMarkDownMessage.Created)
}
The only difference between your code and mine is that I add
Client = webexteams.NewClient()
Client.SetAuthToken("<WEBEX TEAMS TOKEN>")
....
just before
That also worked for me.
Okk I'll check it out tomorrow and let you know if I figure out something Thanks
"message":"Failed to get one on one conversation","errors":[{"description":"Failed to get one on one conversation"}
Whats going on here ? If i make manually the request it works... Can you help me?