Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to list messages #9

Closed
hallyn opened this issue Feb 28, 2020 · 5 comments
Closed

Unable to list messages #9

hallyn opened this issue Feb 28, 2020 · 5 comments

Comments

@hallyn
Copy link

hallyn commented Feb 28, 2020

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?

@hallyn
Copy link
Author

hallyn commented Feb 28, 2020

Hm, right, I think I knew this a few months ago:

https://stackoverflow.com/questions/50156249/cisco-spark-failed-to-get-activity-when-retrieving-messages-as-a-bot

But it's a weird error, and I was really hoping this was fixed by now.

@jbogarin
Copy link
Owner

Are you using a bot token?

@hallyn
Copy link
Author

hallyn commented Apr 6, 2020

Yes.

@jbogarin
Copy link
Owner

jbogarin commented Jul 3, 2020

Bots cannot list messages in a space, they can only get their own messages. I'm closing this issue.

@jbogarin jbogarin closed this as completed Jul 3, 2020
@hallyn
Copy link
Author

hallyn commented Jul 3, 2020

Ok, thanks for verifying that. It is though a huge limitation that I was hoping would one day be fixed. These are the sorts of limitations that make people choose another platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants