Go client library for Nulab Backlog API
- Type-safe option builders — Filter and configure requests using strongly-typed option methods (e.g.
WithKeyword,WithCount,WithOrder), avoiding raw string/map parameters. - Idiomatic Go structs — API responses are mapped to Go structs with proper types (
time.Time, typed constants, etc.) instead of raw JSON. - Context support — Every API method accepts
context.Contextfor cancellation and timeout control. - Structured error types — Errors are returned as typed values (e.g.
*APIResponseErrorfor API errors,*ValidationErrorfor invalid arguments), enabling precise handling witherrors.As.
- Go >= 1.23
go get github.com/nattokin/go-backlog
c, err := backlog.NewClient(
os.Getenv("BACKLOG_BASE_URL"),
os.Getenv("BACKLOG_TOKEN"),
)
// Get all Wiki pages in a project.
wikis, err := c.Wiki.All(context.Background(), "MYPROJECT")
// Filter by keyword using an option.
wikis, err = c.Wiki.All(context.Background(), "MYPROJECT",
c.Wiki.Option.WithKeyword("design"),
)More examples can be found in the examples/ directory and on pkg.go.dev.
Client.Space
- Get Space - Returns information about your space.
- Get Space Disk Usage - Returns disk usage of your space.
- Get Space Notification - Returns the space notification.
- Update Space Notification - Updates the space notification.
Client.Space.Activity
- Get Recent Updates - Returns recent updates in the space.
Client.Space.Attachment
- Post Attachment File - Posts an attachment file for issue or wiki, and returns its ID.
Client.User
- Get User List - Returns a list of users in your space.
- Get User - Returns information about a specific user.
- Add User - Adds new user to the space. "Project Administrator" cannot add "Admin" user. You can't use this API at
backlog.comspace. - Update User - Updates information about a user (Note: Not available at backlog.com).
- Delete User - Deletes a user from the space (Note: Not available at backlog.com).
- Get Own User - Returns information about the currently authenticated user.
Client.User.Activity
- Get User Recent Updates - Returns a user's recent updates.
Client.Project
- Get Project List - Returns a list of projects.
- Add Project - Adds a new project.
- Get Project - Returns information about a project.
- Update Project - Updates information about project.
- Delete Project - Deletes a project.
Client.Project.Activity
- Get Project Recent Updates - Returns recent updates in the project.
Client.Project.User
- Add Project User - Adds a user to the list of project members.
- Get Project User List - Returns a list of project members.
- Delete Project User - Removes a user from the list of project members.
- Add Project Administrator - Adds the Project Administrator role to a user.
- Get List of Project Administrators - Returns a list of users with the Project Administrator role.
- Delete Project Administrator - Removes the Project Administrator role from a user.
Client.Issue
- Get Issue List - Returns a list of issues.
- Count Issue - Returns the number of issues.
- Get Issue - Returns information about a specific issue.
- Add Issue - Adds a new issue.
- Update Issue - Updates information about an issue.
- Delete Issue - Deletes an issue.
Client.Issue.Attachment
- Get List of Issue Attachments - Returns a list of files attached to an issue.
- Delete Issue Attachment - Removes a file attached to an issue.
Client.PullRequest
- Get Pull Request List - Returns a list of pull requests.
- Get Number of Pull Requests - Returns the number of pull requests.
- Get Pull Request - Returns information about a specific pull request.
- Add Pull Request - Creates a new pull request.
- Update Pull Request - Updates information about a pull request.
Client.PullRequest.Attachment
- Get List of Pull Request Attachments - Returns a list of files attached to a pull request.
- Delete Pull Request Attachments - Removes a file attached to a pull request.
Client.Wiki
- Get Wiki Page List - Returns a list of Wiki pages.
- Get Wiki Page Tag List - Returns a list of tags used in the project.
- Count Wiki Page - Returns the number of Wiki pages.
- Get Wiki Page - Returns information about a Wiki page.
- Add Wiki Page - Adds a new Wiki page.
- Update Wiki Page - Updates a Wiki page.
- Delete Wiki Page - Deletes a Wiki page.
Client.Wiki.Attachment
- Get List of Wiki Attachments - Gets a list of files attached to a Wiki.
- Attach File to Wiki - Attaches file to Wiki.
- Remove Wiki Attachment - Removes files attached to a Wiki.
The license of this project is MIT license.