https://github.com/essentialkaos/go-confluence
Go package for working with Atlassian Confluence Server REST API
https://github.com/essentialkaos/go-confluence
atlassian-confluence confluence golang
Last synced: 9 months ago
JSON representation
Go package for working with Atlassian Confluence Server REST API
- Host: GitHub
- URL: https://github.com/essentialkaos/go-confluence
- Owner: essentialkaos
- License: apache-2.0
- Created: 2018-03-31T21:48:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-09-05T06:26:10.000Z (10 months ago)
- Last Synced: 2025-09-05T08:28:25.687Z (10 months ago)
- Topics: atlassian-confluence, confluence, golang
- Language: Go
- Homepage: https://kaos.sh/g/go-confluence.v6
- Size: 252 KB
- Stars: 32
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
Usage example • CI Status • License
`go-confluence` is a Go package for working with [Confluence REST API](https://docs.atlassian.com/ConfluenceServer/rest/7.3.3/).
> [!IMPORTANT]
> **Please note that this package only supports retrieving data from the Confluence API (_i.e. you cannot create or modify data with this package_).**
### Usage example
Authentication with username and password.
```go
package main
import (
"fmt"
cf "github.com/essentialkaos/go-confluence/v6"
)
func main() {
api, err := cf.NewAPI("https://confluence.domain.com", cf.AuthBasic{"john", "MySuppaPAssWOrd"})
api.SetUserAgent("MyApp", "1.2.3")
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
content, err := api.GetContentByID(
"18173522", cf.ContentIDParameters{
Version: 4,
Expand: []string{"space", "body.view", "version"},
},
)
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Printf("ID: %s\n", content.ID)
}
```
Authentication with personal token. Please make sure your confluence 7.9 version and later. See [Using Personal Access Tokens guide](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html)
```go
package main
import (
"fmt"
cf "github.com/essentialkaos/go-confluence/v6"
)
func main() {
api, err := cf.NewAPI("https://confluence.domain.com", cf.AuthToken{"avaMTxxxqKaxpFHpmwHPXhjmUFfAJMaU3VXUji73EFhf"})
api.SetUserAgent("MyApp", "1.2.3")
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
content, err := api.GetContentByID(
"18173522", cf.ContentIDParameters{
Version: 4,
Expand: []string{"space", "body.view", "version"},
},
)
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Printf("ID: %s\n", content.ID)
}
```
### CI Status
| Branch | Status |
|------------|--------|
| `master` (_Stable_) | [](https://kaos.sh/w/go-confluence/ci?query=branch:master) |
| `develop` (_Unstable_) | [](https://kaos.sh/w/go-confluence/ci?query=branch:develop) |
### Contributing
Before contributing to this project please read our [Contributing Guidelines](https://github.com/essentialkaos/.github/blob/master/CONTRIBUTING.md).
### License
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)