{"id":42859212,"url":"https://github.com/dfang/wechat-work-go","last_synced_at":"2026-01-30T12:30:51.549Z","repository":{"id":57482964,"uuid":"182066417","full_name":"dfang/wechat-work-go","owner":"dfang","description":"企业微信 go SDK ","archived":false,"fork":false,"pushed_at":"2020-05-20T01:55:26.000Z","size":188,"stargazers_count":44,"open_issues_count":23,"forks_count":15,"subscribers_count":1,"default_branch":"refactor","last_synced_at":"2025-08-13T19:06:52.711Z","etag":null,"topics":["go","sdk","wechat","wechat-work","wechat-work-go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-18T10:21:23.000Z","updated_at":"2025-02-25T09:17:42.000Z","dependencies_parsed_at":"2022-08-27T20:02:46.513Z","dependency_job_id":null,"html_url":"https://github.com/dfang/wechat-work-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dfang/wechat-work-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfang%2Fwechat-work-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfang%2Fwechat-work-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfang%2Fwechat-work-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfang%2Fwechat-work-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfang","download_url":"https://codeload.github.com/dfang/wechat-work-go/tar.gz/refs/heads/refactor","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfang%2Fwechat-work-go/sbom","scorecard":{"id":338895,"data":{"date":"2025-08-11","repo":{"name":"github.com/dfang/wechat-work-go","commit":"62f940beb0010c4ac97a32aed4c8b9b9179d6e57"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","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":-1,"reason":"no workflows found","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":"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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"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":"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":"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":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'refactor'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 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"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0536 / GHSA-39qc-96h7-956f / GHSA-hgr8-6h9x-f7q9","Warn: Project is vulnerable to: GO-2022-0236 / GHSA-h86h-8ppg-mxmh","Warn: Project is vulnerable to: GO-2021-0238 / GHSA-83g2-8m93-v3w7","Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T05:19:51.828Z","repository_id":57482964,"created_at":"2025-08-18T05:19:51.828Z","updated_at":"2025-08-18T05:19:51.828Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28912911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","sdk","wechat","wechat-work","wechat-work-go"],"created_at":"2026-01-30T12:30:50.911Z","updated_at":"2026-01-30T12:30:51.539Z","avatar_url":"https://github.com/dfang.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wechat-work-go\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/dfang/wechat-work-go)](https://goreportcard.com/report/github.com/dfang/wechat-work-go)\n[![GoDoc](http://godoc.org/github.com/dfang/wechat-work-go?status.svg)](http://godoc.org/github.com/dfang/wechat-work-go)\n[![Travis](https://travis-ci.com/dfang/wechat-work-go.svg?branch=refactor)](https://travis-ci.com/dfang/wechat-work-go)\n[![Maintainability](https://api.codeclimate.com/v1/badges/a054e30c788eb3a693ac/maintainability)](https://codeclimate.com/github/dfang/wechat-work-go/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/a054e30c788eb3a693ac/test_coverage)](https://codeclimate.com/github/dfang/wechat-work-go/test_coverage)\n[![Build status](https://badge.buildkite.com/988dd09408df5bf2bb39403f4f3c10f50e05b84846ba6f6791.svg)](https://buildkite.com/curry/wechat-work-go)\n\n```go\nimport (\n    wechatwork \"github.com/dfang/wechat-work-go\" // package wechatwork\n)\n```\n\n## Features\n\n\u003cdetails\u003e\n\u003csummary\u003e通讯录管理 API\u003c/summary\u003e\n\n* [✓] [成员管理](https://work.weixin.qq.com/api/doc#90000/90135/90194)\n    - [✓] 创建成员 (只能使用通讯录secret创建)\n    - [✓] 读取成员 \n    - [✓] 更新成员\n    - [✓] 删除成员\n    - [✓] 批量删除成员\n    - [✓] 获取部门成员\n    - [✓] 获取部门成员详情\n    - [✓] userid与openid互换\n    - [✓] 二次验证\n    - [✓] 邀请成员\n\n* [✓] [部门管理](https://work.weixin.qq.com/api/doc#90000/90135/90204)\n    - [✓] 创建部门\n    - [✓] 更新部门\n    - [✓] 删除部门\n    - [✓] 获取部门列表\n\n* [ ] [标签管理](https://work.weixin.qq.com/api/doc#90000/90135/90209)\n    - [ ] 创建标签\n    - [ ] 更新标签名字\n    - [ ] 删除标签\n    - [ ] 获取标签成员\n    - [ ] 增加标签成员\n    - [ ] 删除标签成员\n    - [ ] 获取标签列表\n\n* [ ] [异步批量接口](https://work.weixin.qq.com/api/doc#90000/90135/90978)\n    - [ ] 增量更新成员\n    - [ ] 全量覆盖成员\n    - [ ] 全量覆盖部门\n    - [ ] 获取异步任务结果\n\n* [ ] [通讯录回调通知](https://work.weixin.qq.com/api/doc#90000/90135/90966)\n\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e身份认证\u003c/summary\u003e\n\n* [✓] [网页授权登录时获取访问用户身份](https://work.weixin.qq.com/api/doc#90000/90135/91023)\n* [✓] [扫码授权登录时获取访问用户身份](https://work.weixin.qq.com/api/doc#90000/90135/91437)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e应用管理\u003c/summary\u003e\n\n* [✓] 获取应用\n* [✓] 设置应用\n* [✓] [自定义菜单](https://work.weixin.qq.com/api/doc#90000/90135/90230)\n    - [✓] 创建菜单\n    - [✓] 获取菜单\n    - [✓] 删除菜单\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e消息推送\u003c/summary\u003e\n\n* [✓] [推送消息到应用](https://work.weixin.qq.com/api/doc#90000/90135/90236)\n* [✓] 发送消息到群聊会话\n    - [✓] 创建群聊会话\n    - [✓] 修改群聊会话\n    - [✓] 获取群聊会话\n    - [✓] [推送消息到群聊会话](https://work.weixin.qq.com/api/doc#90000/90135/90248)\n* [ ] 互联企业消息推送\n    - [ ] 发送应用消息\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e素材管理\u003c/summary\u003e\n\n* [ ] 素材管理\n    - [ ] 上传临时素材\n    - [ ] 上传永久图片\n    - [ ] 获取临时素材\n    - [ ] 获取高清语音素材\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eTODO(以下接口个人暂时用不到， 暂时不开发)\u003c/summary\u003e\n\n* [ ] 外部联系人管理\n* [ ] OA 数据接口\n* [ ] 企业支付\n* [ ] 电子发票\n\n\u003c/details\u003e\n\n\n## 使用\n\n企业微信是分应用的， 一个企业（一个corpid）中有多个app （对应的一套corpsecret，agentid）  \n\n所以使用的时候先创建一个企业的client，然后用这个client创建不同的app对象  \n\n```go\nimport (\n    wechatwork \"github.com/dfang/wechat-work-go\" // package wechatwork\n)\n\ncorpID := os.Getenv(\"CORP_ID\")\ncorpSecret := os.Getenv(\"CORP_SECRET\")\nagentID, _ := strconv.ParseInt(os.Getenv(\"AGENT_ID\"), 10, 64)\n\ncorp := wechatwork.New(corpID)\napp = corp.NewApp(corpSecret, agentID)\n    \n```\n\n要使用哪个模块的功能，就创建哪个模块的实例\n\n\n```\nimport \"github.com/dfang/wechat-work-go/message\"\n\nmsg := message.WithApp(app)\n\nmsg.SendAppChatMessage(....)\n```\n\n\n\n\n\n## 开发 \n\n对照API文档, 运行测试, 快速了解API\n\n```\nexport CORP_ID=xxxxxx\nexport CORP_SECRET=yyyyyy\nexport AGENT_ID=zzzzzz\n\n运行单个测试，比如只运行access_token_test.go的测试\nginkgo -v -focus='access_token'\n\n或者\ngo test -v wechat_work_go_suite_test.go client_test.go\n\nwatch mode  \nginkgo watch -v -focus='access_token*'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfang%2Fwechat-work-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfang%2Fwechat-work-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfang%2Fwechat-work-go/lists"}