
๐พWebhooks
List webhooks for a workspace
package main
import (
"context"
"fmt"
"github.com/ctreminiom/go-atlassian/bitbucket"
"log"
"os"
)
func main() {
token := os.Getenv("BITBUCKET_TOKEN")
instance, err := bitbucket.New(nil, "")
if err != nil {
log.Fatal(err)
}
instance.Auth.SetBearerToken(token)
instance.Auth.SetUserAgent("curl/7.54.0")
hooks, response, err := instance.Workspace.Hook.Gets(context.TODO(), "ctreminiom")
if err != nil {
log.Println(response.Endpoint)
log.Println(response.Bytes.String())
log.Fatal(err)
}
for _, hook := range hooks.Values {
fmt.Println(hook.UUID, hook.Description, hook.Events, hook.URL)
}
}Create webhook for a workspace
Update webhook for a workspace
Get webhook for a workspace
Delete webhook for a workspace
Last updated
Was this helpful?