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 responses to idiomatic Go structs.
- Structs are provided for all API endpoints and responses.
- Go >= 1.18
go get github.com/nattokin/go-backlog
package main
import (
"fmt"
"log"
"github.com/nattokin/go-backlog"
)
func main() {
// The base URL for the Backlog API.
baseURL := "BACKLOG_BASE_URL"
// The token for requests to the Backlog API.
token := "BACKLOG_TOKEN"
// Create Backlog API client.
c, err := backlog.NewClient(baseURL, token, nil)
if err != nil {
log.Fatalln(err)
}
// The wiki ID.
wikiID := 12345
r, err := c.Wiki.One(wikiID)
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 for the Backlog API.
baseURL := "BACKLOG_BASE_URL"
// The token for requests to the Backlog API.
token := "BACKLOG_TOKEN"
// Create Backlog API client.
c, err := backlog.NewClient(baseURL, token, nil)
if err != nil {
log.Fatalln(err)
}
// The project ID or Key.
projectIDOrKey := "PROJECTKEY"
r, err := c.Wiki.All(projectIDOrKey)
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 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.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.
- 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.