Go client library for Nulab Backlog API
- You can request each API endpoint using the Backlog API client created from the API base URL and token.
- Converts API response to a corresponding structure.
- Structures are provided for all endpoints and responses.
- Go >= 1.14
go get github.com/nattokin/go-backlog
package main
import (
"fmt"
"log"
"github.com/nattokin/go-backlog"
)
func main() {
// The base URL of Backlog API.
baseURL := "BACKLOG_BASE_URL"
// The tokun for request to Backlog API.
token := "BACKLOG_TOKEN"
// Create Backlog API client.
c, err := backlog.NewClient(baseURL, token)
if err != nil {
log.Fatalln(err)
}
r, err := c.Wiki.One(12345)
if err != nil {
log.Fatalln(err)
}
fmt.Printf("%#v\n", r)
}
package main
import (
"fmt"
"log"
"github.com/nattokin/go-backlog"
)
func main() {
// The base URL of Backlog API.
baseURL := "BACKLOG_BASE_URL"
// The tokun for request to Backlog API.
token := "BACKLOG_TOKEN"
// Create Backlog API client.
c, err := backlog.NewClient(baseURL, token)
if err != nil {
log.Fatalln(err)
}
// ID or Key of the project.
projectKey := "PROJECTKEY"
r, err := c.Wiki.All(projectKey)
// projectID := "1234"
// r, err := c.Wiki.All(projectID)
if err != nil {
log.Fatalln(err)
}
for _, w := range r {
fmt.Printf("%#v\n", w)
}
}
Client.Space.Activity
- Get Recent Updates - Returns recent updates in your space.
Client.Space.Attachment
- Post Attachment File - Posts an attachment file for issue or wiki. Returns id of the attachment file.
Client.User
- Get User List - Returns list of users in your space.
- Get User - Returns information about user.
- Add User - Adds new user to the space. “Project Administrator” cannot add “Admin” user. You can’t use this API at
backlog.com
space. - Update User - Updates information about user. You can’t use this API at backlog.com space.
- Delete User - Deletes user from the space. You can’t use this API at backlog.com space.
- Get Own User - Returns own information about user.
Client.User.Activity
- Get User Recent Updates - Returns user’s recent updates.
Client.Project
- Get Project List - Returns list of projects.
- Add Project - Adds new project.
- Get Project - Returns information about project.
- Update Project - Updates information about project.
- Delete Project - Deletes project.
Client.Project.Activity
- Get Project Recent Updates - Returns recent update in the project.
Client.Project.User
- Add Project User - Adds user to list of project members.
- Get Project User List - Returns list of project members.
- Delete Project User - Removes user from list project members.
- Add Project Administrator - Adds “Project Administrator” role to user.
- Get List of Project Administrators - Returns list of users who has Project Administrator role.
- Delete Project Administrator - Removes Project Administrator role from user.
Client.Wiki
- Get Wiki Page List - Returns list of Wiki pages.
- Get Wiki Page Tag List - Returns list of tags that are used in the project.
- Count Wiki Page - Returns number of Wiki pages.
- Get Wiki Page - Returns information about Wiki page.
- Add Wiki Page - Adds new Wiki page.
- Delete Wiki Page - Deletes Wiki page.
Client.Wiki.Attachment
- Get List of Wiki attachments - Gets list of files attached to Wiki.
- Attach File to Wiki - Attaches file to Wiki
- Remove Wiki Attachment - Removes files attached to Wiki.
The license of this project is MIT license.