adlio / trello

Trello API wrapper for Go
MIT License
220 stars 71 forks source link

Webhooks wrong request #39

Closed jokaorgua closed 5 years ago

jokaorgua commented 5 years ago

There is a bug in Token.GetWebhooks. The function uses t.ID to insert into URL for API. But trello's API waits for an entire token, not the token ID. so it should be like t.client.Token used for URL

dpup commented 5 years ago

Workaround:

    token, err := client.GetToken(client.Token, trello.Defaults())
    if err != nil {
        return errors.Wrap(err, "failed to request token")
    }
    token.ID = client.Token // HACK
    webhooks, err := token.GetWebhooks(trello.Defaults())
    if err != nil {
        return errors.Wrap(err, "failed to request webhooks")
    }

But seems like GetWebhooks could just be added to the Client interface.

adlio commented 5 years ago

@jokaorgua's fix in 95fd6f3 is now merged. Thanks!