{"id":13676092,"url":"https://github.com/line/line-bot-sdk-go","last_synced_at":"2026-07-01T09:00:43.174Z","repository":{"id":37664810,"uuid":"57121553","full_name":"line/line-bot-sdk-go","owner":"line","description":"LINE Messaging API SDK for Go","archived":false,"fork":false,"pushed_at":"2026-06-20T03:10:32.000Z","size":31968,"stargazers_count":950,"open_issues_count":5,"forks_count":242,"subscribers_count":51,"default_branch":"master","last_synced_at":"2026-06-20T05:10:29.750Z","etag":null,"topics":["bot","go","golang","line","linebot","sdk"],"latest_commit_sha":null,"homepage":"https://developers.line.biz/en/docs/messaging-api/overview/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/line.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-04-26T11:07:05.000Z","updated_at":"2026-06-18T02:54:08.000Z","dependencies_parsed_at":"2024-04-03T06:27:56.794Z","dependency_job_id":"61593422-ed6d-4ea5-a80d-f9e3502d3c17","html_url":"https://github.com/line/line-bot-sdk-go","commit_stats":{"total_commits":599,"total_committers":77,"mean_commits":7.779220779220779,"dds":0.7896494156928213,"last_synced_commit":"95d70a1133425fa452b483e7e78e4c38a4775f2f"},"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"purl":"pkg:github/line/line-bot-sdk-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/line","download_url":"https://codeload.github.com/line/line-bot-sdk-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-go/sbom","scorecard":{"id":590595,"data":{"date":"2025-08-11","repo":{"name":"github.com/line/line-bot-sdk-go","commit":"e509067bb168753a66715ee9a62d43dcac277539"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.7,"checks":[{"name":"Maintained","score":10,"reason":"21 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":7,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/check-eol-newrelease.yml:13","Info: found token with 'none' permissions: .github/workflows/create-draft-release.yml:1","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/create-draft-release.yml:46","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/generate-code.yml:15","Info: jobLevel 'contents' permission set to 'read': .github/workflows/go.yml:14","Info: jobLevel 'contents' permission set to 'read': .github/workflows/go.yml:63","Warn: no topLevel permission defined: .github/workflows/check-eol-newrelease.yml:1","Warn: no topLevel permission defined: .github/workflows/close-issue.yml:1","Warn: no topLevel permission defined: .github/workflows/create-draft-release.yml:1","Warn: no topLevel permission defined: .github/workflows/generate-code.yml:1","Warn: no topLevel permission defined: .github/workflows/go.yml:1","Warn: no topLevel permission defined: .github/workflows/label-issue.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: tools/openapi-generator-cli.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: goCommand not pinned by hash: .github/workflows/generate-code.yml:32","Warn: goCommand not pinned by hash: .github/workflows/go.yml:37","Warn: downloadThenRun not pinned by hash: .github/workflows/go.yml:59","Info:  15 out of  15 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 goCommand dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T21:47:22.566Z","repository_id":37664810,"created_at":"2025-08-20T21:47:22.566Z","updated_at":"2025-08-20T21:47:22.566Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34999792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","go","golang","line","linebot","sdk"],"created_at":"2024-08-02T13:00:18.178Z","updated_at":"2026-07-01T09:00:43.164Z","avatar_url":"https://github.com/line.png","language":"Go","funding_links":[],"categories":["Go","Repositories"],"sub_categories":[],"readme":"# LINE Messaging API SDK for Go\n\n[![Build Status](https://github.com/line/line-bot-sdk-go/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/line/line-bot-sdk-go/actions)\n[![Go Reference](https://pkg.go.dev/badge/github.com/line/line-bot-sdk-go/v8/linebot.svg)](https://pkg.go.dev/github.com/line/line-bot-sdk-go/v8/linebot)\n[![Go Report Card](https://goreportcard.com/badge/github.com/line/line-bot-sdk-go)](https://goreportcard.com/report/github.com/line/line-bot-sdk-go)\n\n\n## Introduction\nThe LINE Messaging API SDK for Go makes it easy to develop bots using LINE Messaging API, and you can create a sample bot within minutes.\n\n## Documentation\n\nSee the official API documentation for more information.\n\n- English: https://developers.line.biz/en/docs/messaging-api/overview/\n- Japanese: https://developers.line.biz/ja/docs/messaging-api/overview/\n\n## Requirements\n\nThis library requires Go 1.25 or later.\n\n## Installation ##\n\n```sh\n$ go get -u github.com/line/line-bot-sdk-go/v8/linebot\n```\n\n## Import all packages in your code ##\n```go\nimport (\n\t\"github.com/line/line-bot-sdk-go/v8/linebot\"\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/channel_access_token\"\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/insight\"\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/liff\"\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/manage_audience\"\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api\"\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/module\"\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/module_attach\"\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/shop\"\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/webhook\"\n)\n\n```\n\n## Configuration ##\n\n```go\nimport (\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api\"\n)\n\nfunc main() {\n\tbot, err := messaging_api.NewMessagingApiAPI(\n\t\tos.Getenv(\"LINE_CHANNEL_TOKEN\"),\n\t)\n\t...\n}\n\n```\n\n### Configuration with http.Client ###\n\nEvery client application allows configuration with WithHTTPClient and WithEndpoint.\n(For Blob client, configurations WithBlobHTTPClient and WithBlobEndpoint are also available.)\n\n```go\nclient := \u0026http.Client{}\nbot, err := messaging_api.NewMessagingApiAPI(\n\tos.Getenv(\"LINE_CHANNEL_TOKEN\"),\n\tmessaging_api.WithHTTPClient(client),\n)\n...\n```\n\n## Getting Started ##\n\nThe LINE Messaging API primarily utilizes the JSON data format. To parse the incoming HTTP requests, the `webhook.ParseRequest()` method is provided. This method reads the `*http.Request` content and returns a slice of pointers to Event Objects.\n\n```go\nimport (\n\t\"github.com/line/line-bot-sdk-go/v8/linebot/webhook\"\n)\n\ncb, err := webhook.ParseRequest(os.Getenv(\"LINE_CHANNEL_SECRET\"), req)\nif err != nil {\n\t// Handle any errors that occur.\n}\n```\n\nThe LINE Messaging API is capable of handling various event types. The Messaging API SDK automatically unmarshals these events into respective classes like `webhook.MessageEvent`, `webhook.FollowEvent`, and so on. You can easily check the type of the event and respond accordingly using a switch statement as shown below:\n\n\n```go\nfor _, event := range cb.Events {\n\tswitch e := event.(type) {\n\t\tcase webhook.MessageEvent:\n\t\t\t// Do Something...\n\t\tcase webhook.StickerMessageContent:\n\t\t\t// Do Something...\n\t}\n}\n```\n\nWe provide code [examples](./examples).\n- [EchoBot](./examples/echo_bot/server.go)\n  - a simple echo bot\n- [KitchenSink](./examples/kitchensink/server.go)\n  - a bot that handles many types of events\n- [EchoBotHandler](./examples/echo_bot_handler/server.go)\n  - A simple bot that automatically verifies signatures and only handles Webhook events\n- [DeliveryHelper](./examples/delivery_helper/main.go)\n- [InsightHelper](./examples/insight_helper/main.go)\n- [RichmenuHelper](./examples/richmenu_helper/main.go)\n\n### Receiver ###\n\nTo send a message to a user, group, or room, you need either an ID\n\n```go\nuserID := event.Source.UserId\ngroupID := event.Source.GroupId\nRoomID := event.Source.RoomId\n```\n\nor a reply token.\n\n```go\nreplyToken := event.ReplyToken\n```\n\n### Create message ###\n\nThe LINE Messaging API provides various types of message.\n\n```go\nbot.ReplyMessage(\n\t\u0026messaging_api.ReplyMessageRequest{\n\t\tReplyToken: e.ReplyToken,\n\t\tMessages: []messaging_api.MessageInterface{\n\t\t\tmessaging_api.TextMessage{\n\t\t\t\tText: replyMessage,\n\t\t\t},\n\t\t},\n\t},\n)\n```\n\n### Send message ###\n\nWith an ID, you can send message using ```PushMessage()```\n\n```go\nbot.PushMessage(\n\t\u0026messaging_api.PushMessageRequest{\n\t\tTo: \"U.......\",\n\t\tMessages: []messaging_api.MessageInterface{\n\t\t\tmessaging_api.TextMessage{\n\t\t\t\tText: pushMessage,\n\t\t\t},\n\t\t},\n\t},\n\t\"\", // x-line-retry-key\n)\n```\n\nWith a reply token, you can reply to messages using ```ReplyMessage()```\n\n```go\nbot.ReplyMessage(\n\t\u0026messaging_api.ReplyMessageRequest{\n\t\tReplyToken: e.ReplyToken,\n\t\tMessages: []messaging_api.MessageInterface{\n\t\t\tmessaging_api.TextMessage{\n\t\t\t\tText: replyMessage,\n\t\t\t},\n\t\t},\n\t},\n)\n```\n\n### How to get response header and error message ###\nYou may need to store the ```x-line-request-id``` header obtained as a response from several APIs. In this case, please use ```~WithHttpInfo```. You can get headers and status codes. The ```x-line-accepted-request-id``` or ```content-type``` header can also be obtained in the same way.\n\n```go\nresp, _, _ := app.bot.ReplyMessageWithHttpInfo(\n\t\u0026messaging_api.ReplyMessageRequest{\n\t\tReplyToken: replyToken,\n\t\tMessages: []messaging_api.MessageInterface{\n\t\t\tmessaging_api.TextMessage{\n\t\t\t\tText: \"Hello, world\",\n\t\t\t},\n\t\t},\n\t}, \n)\nlog.Printf(\"status code: (%v), x-line-request-id: (%v)\", resp.StatusCode, resp.Header.Get(\"x-line-request-id\"))\n\n```\n\nSimilarly, you can get specific error messages by using ```~WithHttpInfo```.\n\n```go\nresp, _, err := app.bot.ReplyMessageWithHttpInfo(\n    \u0026messaging_api.ReplyMessageRequest{\n        ReplyToken: replyToken + \"invalid\",\n        Messages: []messaging_api.MessageInterface{\n            messaging_api.TextMessage{\n                Text: \"Hello, world\",\n            },\n        },\n    },\n)\nif err != nil \u0026\u0026 resp.StatusCode \u003e= 400 \u0026\u0026 resp.StatusCode \u003c 500 {\n    decoder := json.NewDecoder(resp.Body)\n    errorResponse := \u0026messaging_api.ErrorResponse{}\n    if err := decoder.Decode(\u0026errorResponse); err != nil {\n        log.Fatal(\"failed to decode JSON: %w\", err)\n    }\n    log.Printf(\"status code: (%v), x-line-request-id: (%v), error response: (%v)\", resp.StatusCode, resp.Header.Get(\"x-line-request-id\"), errorResponse)\n}\n```\n\n## Help and media\n\nFAQ: https://developers.line.biz/en/faq/\n\nNews: https://developers.line.biz/en/news/\n\n\n## Versioning\n\nThis project respects semantic versioning.\n- See https://semver.org/\n\nHowever, if a feature that was publicly released is discontinued for business reasons and becomes completely unusable, we will release changes as a patch release.\n\n\n## Contributing\n\nPlease check [CONTRIBUTING](CONTRIBUTING.md) before making a contribution.\n\n\n## License\n\n```\nCopyright (C) 2016 LINE Corp.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline%2Fline-bot-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fline%2Fline-bot-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline%2Fline-bot-sdk-go/lists"}