Skip to content

nattokin/go-backlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-backlog

GoDoc Go Report Card Test codecov License: MIT

Go client library for Nulab Backlog API

Feature

  • 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.

Requirements

  • Go >= 1.18

Installation

go get github.com/nattokin/go-backlog

Examples

Get a wiki

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)
}

Get wikis list in the project

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)
    }
}

Supported API endpoints

Client.Space.Activity

Client.Space.Attachment

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.com space.
  • 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

Client.Project

Client.Project.Activity

Client.Project.User

Client.Wiki

Client.Wiki.Attachment

License

The license of this project is MIT license.

About

Go client library for Nulab Backlog API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published