Skip to content

Failed to use GetWebhookInfo() #276

@hiro-ogawa

Description

@hiro-ogawa

System Informations

  • Go version: 1.16.3
  • OS: MacOSX 10.15.7

Expected Behavior

Endpoint and active information can be get by using GetWebhookInfo().

Current Behavior

Failed to unmarshal json string.

Steps to Reproduce

  • example code
package main

import (
	"fmt"
	"log"
	"os"

	"github.com/line/line-bot-sdk-go/linebot"
)

func main() {
	bot, err := linebot.New(
		os.Getenv("LINE_CHANNEL_SECRET"),
		os.Getenv("LINE_CHANNEL_TOKEN"),
	)
	if err != nil {
		log.Fatal(err)
	}

	webhook_info, err := bot.GetWebhookInfo().Do()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(webhook_info.Endpoint)
	fmt.Println(webhook_info.Active)
}

Logs

2021/04/17 12:05:49 json: cannot unmarshal bool into Go struct field WebhookInfoResponse.active of type string
exit status 1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions