๐งบAttachments
Get attachment by id
package main
import (
"context"
"fmt"
confluence "github.com/ctreminiom/go-atlassian/confluence/v2"
"log"
"os"
)
func main() {
var (
host = os.Getenv("HOST")
mail = os.Getenv("MAIL")
token = os.Getenv("TOKEN")
)
instance, err := confluence.New(nil, host)
if err != nil {
log.Fatal(err)
}
instance.Auth.SetBasicAuth(mail, token)
instance.Auth.SetUserAgent("curl/7.54.0")
attachment, response, err := instance.Attachment.Get(context.Background(), "att219152391", 0, false)
if err != nil {
if response != nil {
log.Println(response.Endpoint)
log.Println(response.Code)
log.Println(response.Bytes.String())
}
log.Fatal(err)
}
fmt.Print(attachment)
}Get attachments by type
Delete attachment
Last updated
Was this helpful?
