{"id":15180440,"url":"https://github.com/green-api/whatsapp-api-client-golang","last_synced_at":"2026-03-02T08:34:17.042Z","repository":{"id":65695781,"uuid":"583259659","full_name":"green-api/whatsapp-api-client-golang","owner":"green-api","description":"Create a golang application with WhatsApp API","archived":false,"fork":false,"pushed_at":"2025-11-15T18:54:54.000Z","size":118,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-15T20:35:16.684Z","etag":null,"topics":["whatsapp","whatsapp-api","whatsapp-api-go","whatsapp-bot","whatsapp-go"],"latest_commit_sha":null,"homepage":"https://green-api.com/en","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/green-api.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-29T08:38:57.000Z","updated_at":"2025-11-15T18:52:30.000Z","dependencies_parsed_at":"2024-01-13T16:50:25.249Z","dependency_job_id":"fdd92c21-8d6e-4f11-83ec-6907cc0d1c19","html_url":"https://github.com/green-api/whatsapp-api-client-golang","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.0714285714285714,"last_synced_commit":"a1580a8c0c0f7fc7c4f6bf126fa64acfc361894b"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/green-api/whatsapp-api-client-golang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fwhatsapp-api-client-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fwhatsapp-api-client-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fwhatsapp-api-client-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fwhatsapp-api-client-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/green-api","download_url":"https://codeload.github.com/green-api/whatsapp-api-client-golang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fwhatsapp-api-client-golang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29995912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"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":["whatsapp","whatsapp-api","whatsapp-api-go","whatsapp-bot","whatsapp-go"],"created_at":"2024-09-27T16:06:25.164Z","updated_at":"2026-03-02T08:34:17.003Z","avatar_url":"https://github.com/green-api.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# whatsapp-api-client-golang\n\n- [Документация на русском языке](docs/README_RU.md).\n\nwhatsapp-api-client-golang is a library for integration with WhatsApp messenger using the API\nservice [green-api.com](https://green-api.com/en/). You should get a registration token and an account ID in\nyour [personal cabinet](https://console.green-api.com/) to use the library. There is a free developer account tariff.\n\n## API\n\nThe documentation for the REST API can be found at the [link](https://green-api.com/en/docs/). The library is a wrapper\nfor the REST API, so the documentation at the link above also applies.\n\n#### Authorization\n\nTo send a message or perform other Green API methods, the WhatsApp account in the phone app must be authorized. To\nauthorize the account, go to your [cabinet](https://console.green-api.com/) and scan the QR code using the WhatsApp app.\n\n## Installation\n\nDo not forget to create a module:\n\n```shell\ngo mod init example\n```\n\nInstallation:\n\n```shell\ngo get github.com/green-api/whatsapp-api-client-golang\n```\n\n## Import\n\n```\nimport (\n\t\"github.com/green-api/whatsapp-api-client-golang/pkg/api\"\n)\n```\n\n## Examples\n\n### How to initialize an object\n\n```\nGreenAPI := api.GreenAPI{\n    IDInstance:       \"1101000001\",\n    APITokenInstance: \"d75b3a66374942c5b3c019c698abc2067e151558acbd412345\",\n}\n```\n\nNote that keys can be obtained from environment variables:\n\n```\nIDInstance := os.Getenv(\"ID_INSTANCE\")\nAPITokenInstance := os.Getenv(\"API_TOKEN_INSTANCE\")\n```\n\n### How to create a group\n\nLink to example: [createGroup/main.go](examples/createGroup/main.go).\n\n```\nresponse, _ := GreenAPI.Methods().Groups().CreateGroup(\"groupName\", []string{\n    \"11001234567@c.us\",\n    \"11002345678@c.us\",\n})\n```\n\n### How to send a file by uploading from the disk\n\nTo send a file, you need to give the path to the file.\n\nLink to example: [sendFileByUpload/main.go](examples/sendFileByUpload/main.go).\n\n```\nresponse, _ := GreenAPI.Methods().Sending().SendFileByUpload(\"example.png\", map[string]interface{}{\n    \"chatId\": \"11001234567@c.us\",\n})\n```\n\n### How to send a file by URL\n\nLink to example: [sendFileByURL/main.go](examples/sendFileByURL/main.go).\n\n```\nresponse, _ := GreenAPI.Methods().Sending().SendFileByUrl(map[string]interface{}{\n    \"chatId\":   \"11001234567@c.us\",\n    \"urlFile\":  \"https://go.dev/blog/go-brand/Go-Logo/SVG/Go-Logo_Blue.svg\",\n    \"fileName\": \"Go-Logo_Blue.svg\",\n})\n```\n\n### How to send a message\n\nIf an API method has optional parameters, you have to pass JSON to the library method (`map[string]interface{}`).\n\nLink to example: [sendMessage/main.go](examples/sendMessage/main.go).\n\n```\nresponse, _ := GreenAPI.Methods().Sending().SendMessage(map[string]interface{}{\n    \"chatId\":  \"11001234567@c.us\",\n    \"message\": \"Any message\",\n})\n```\n\n### How to receive incoming notifications\n\nTo receive incoming webhooks, you must send a handler function to `Webhook().Start`. The handler function should have\none parameter (`body map[string]interface{}`). When you receive a new notification, your handler function will be\nexecuted. To stop receiving incoming webhooks, you need to call `Webhook().Stop`.\n\nLink to example: [webhook/main.go](examples/webhook/main.go).\n\n```\nGreenAPIWebhook := GreenAPI.Webhook()\n\nGreenAPIWebhook.Start(func(body map[string]interface{}) {\n    fmt.Println(body)\n})\n```\n\n### How to send a message with a poll\n\nIf an API method has optional parameters, you have to pass JSON to the library method (`map[string]interface{}`).\n\nLink to example: [sendPoll/main.go](examples/sendPoll/main.go).\n\n```\nresponse, err := GreenAPI.Methods().Sending().SendPoll(map[string]interface{}{\n\t\"chatId\":  \"11001234567@c.us\",\n\t\"message\": \"Please choose a color:\",\n\t\"options\": []map[string]interface{}{\n\t\t{\n\t\t\t\"optionName\": \"Red\",\n\t\t},\n\t\t{\n\t\t\t\"optionName\": \"Green\",\n\t\t},\n\t\t{\n\t\t\t\"optionName\": \"Blue\",\n\t\t},\n\t},\n})\n```\n\n## List of examples\n\n| Description                                   | Link to example                                               |\n|-----------------------------------------------|---------------------------------------------------------------|\n| How to create a group                         | [createGroup/main.go](examples/createGroup/main.go)           |\n| How to send a file by uploading from the disk | [sendFileByUpload/main.go](examples/sendFileByUpload/main.go) |\n| How to send a file by URL                     | [sendFileByURL/main.go](examples/sendFileByURL/main.go)       |\n| How to send a message                         | [sendMessage/main.go](examples/sendMessage/main.go)           |\n| How to receive incoming notifications         | [webhook/main.go](examples/webhook/main.go)                   |\n| How to send a message with a poll             | [sendPoll/main.go](examples/sendPoll/main.go)                 |\n\n## List of all library methods\n\n| API method                        | Description                                                                                                               | Documentation link                                                                                          |\n|-----------------------------------|---------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|\n| `Account().GetSettings`           | The method is designed to get the current settings of the account                                                         | [GetSettings](https://green-api.com/en/docs/api/account/GetSettings/)                                       |\n| `Account().GetWaSettings`         | The method is designed to get information about the WhatsApp account                                                      | [GetSettings](https://green-api.com/en/docs/api/account/GetWaSettings/)                                     |\n| `Account().SetSettings`           | The method is designed to set the account settings                                                                        | [SetSettings](https://green-api.com/docs/api/account/SetSettings/)                                          |\n| `Account().GetStateInstance`      | The method is designed to get the state of the account                                                                    | [GetStateInstance](https://green-api.com/en/docs/api/account/GetStateInstance/)                             |\n| `Account().GetStatusInstance`     | The method is designed to get the socket connection state of the account instance with WhatsApp                           | [GetStatusInstance](https://green-api.com/en/docs/api/account/GetStatusInstance/)                           |\n| `Account().Reboot`                | The method is designed to restart the account                                                                             | [Reboot](https://green-api.com/en/docs/api/account/Reboot/)                                                 |\n| `Account().Logout`                | The method is designed to unlogin the account                                                                             | [Logout](https://green-api.com/en/docs/api/account/Logout/)                                                 |\n| `Account().QR`                    | The method is designed to get a QR code                                                                                   | [QR](https://green-api.com/en/docs/api/account/QR/)                                                         |\n| `Account().SetProfilePicture`     | The method is designed to set the avatar of the account                                                                   | [SetProfilePicture](https://green-api.com/en/docs/api/account/SetProfilePicture/)                           |\n| `Account().GetAuthorizationCode`  | The method is designed to authorize an instance by phone number                                                           | [GetAuthorizationCode](https://green-api.com/en/docs/api/account/GetAuthorizationCode/)                     |\n| `Device().GetDeviceInfo`          | The method is designed to get information about the device (phone) on which the WhatsApp Business application is running  | [GetDeviceInfo](https://green-api.com/en/docs/api/phone/GetDeviceInfo/)                                     |\n| `Groups().CreateGroup`            | The method is designed to create a group chat                                                                             | [CreateGroup](https://green-api.com/en/docs/api/groups/CreateGroup/)                                        |\n| `Groups().UpdateGroupName`        | The method changes the name of the group chat                                                                             | [UpdateGroupName](https://green-api.com/en/docs/api/groups/UpdateGroupName/)                                |\n| `Groups().GetGroupData`           | The method gets group chat data                                                                                           | [GetGroupData](https://green-api.com/en/docs/api/groups/GetGroupData/)                                      |\n| `Groups().AddGroupParticipant`    | The method adds a participant to the group chat                                                                           | [AddGroupParticipant](https://green-api.com/en/docs/api/groups/AddGroupParticipant/)                        |\n| `Groups().RemoveGroupParticipant` | The method removes the participant from the group chat                                                                    | [RemoveGroupParticipant](https://green-api.com/en/docs/api/groups/RemoveGroupParticipant/)                  |\n| `Groups().SetGroupAdmin`          | The method designates a member of a group chat as an administrator                                                        | [SetGroupAdmin](https://green-api.com/en/docs/api/groups/SetGroupAdmin/)                                    |\n| `Groups().RemoveAdmin`            | The method deprives the participant of group chat administration rights                                                   | [RemoveAdmin](https://green-api.com/en/docs/api/groups/RemoveAdmin/)                                        |\n| `Groups().SetGroupPicture`        | The method sets the avatar of the group                                                                                   | [SetGroupPicture](https://green-api.com/en/docs/api/groups/SetGroupPicture/)                                |\n| `Groups().LeaveGroup`             | The method logs the user of the current account out of the group chat                                                     | [LeaveGroup](https://green-api.com/en/docs/api/groups/LeaveGroup/)                                          |\n| `Journals().GetChatHistory`       | The method returns the chat message history                                                                               | [GetChatHistory](https://green-api.com/en/docs/api/journals/GetChatHistory/)                                |\n| `Journals().GetMessage`           | The method returns a chat message                                                                                         | [GetMessage](https://green-api.com/en/docs/api/journals/GetMessage/)                                        |\n| `Journals().LastIncomingMessages` | The method returns the most recent incoming messages of the account                                                       | [LastIncomingMessages](https://green-api.com/en/docs/api/journals/LastIncomingMessages/)                    |\n| `Journals().LastOutgoingMessages` | The method returns the last sent messages of the account                                                                  | [LastOutgoingMessages](https://green-api.com/en/docs/api/journals/LastOutgoingMessages/)                    |\n| `Queues().ShowMessagesQueue`      | The method is designed to get the list of messages that are in the queue to be sent                                       | [ShowMessagesQueue](https://green-api.com/en/docs/api/queues/ShowMessagesQueue/)                            |\n| `Queues().ClearMessagesQueue`     | The method is designed to clear the queue of messages to be sent                                                          | [ClearMessagesQueue](https://green-api.com/en/docs/api/queues/ClearMessagesQueue/)                          |\n| `ReadMark().ReadChat`             | The method is designed to mark chat messages as read                                                                      | [ReadChat](https://green-api.com/en/docs/api/marks/ReadChat/)                                               |\n| `Receiving().ReceiveNotification` | The method is designed to receive a single incoming notification from the notification queue                              | [ReceiveNotification](https://green-api.com/en/docs/api/receiving/technology-http-api/ReceiveNotification/) |\n| `Receiving().DeleteNotification`  | The method is designed to remove an incoming notification from the notification queue                                     | [DeleteNotification](https://green-api.com/en/docs/api/receiving/technology-http-api/DeleteNotification/)   |\n| `Receiving().DownloadFile`        | The method is for downloading received and sent files                                                                     | [DownloadFile](https://green-api.com/en/docs/api/receiving/files/DownloadFile/)                             |\n| `Sending().SendMessage`           | The method is designed to send a text message to a personal or group chat                                                 | [SendMessage](https://green-api.com/en/docs/api/sending/SendMessage/)                                       |\n| `Sending().SendButtons`           | The method is designed to send a message with buttons to a personal or group chat                                         | [SendButtons](https://green-api.com/en/docs/api/sending/SendButtons/)                                       |\n| `Sending().SendTemplateButtons`   | The method is designed to send a message with interactive buttons from the list of templates in a personal or group chat  | [SendTemplateButtons](https://green-api.com/en/docs/api/sending/SendTemplateButtons/)                       |\n| `Sending().SendListMessage`       | The method is designed to send a message with a selection button from a list of values to a personal or group chat        | [SendListMessage](https://green-api.com/en/docs/api/sending/SendListMessage/)                               |\n| `Sending().SendFileByUpload`      | The method is designed to send a file loaded through a form (form-data)                                                   | [SendFileByUpload](https://green-api.com/en/docs/api/sending/SendFileByUpload/)                             |\n| `Sending().SendFileByUrl`         | The method is designed to send a file downloaded via a link                                                               | [SendFileByUrl](https://green-api.com/en/docs/api/sending/SendFileByUrl/)                                   |\n| `Sending().UploadFile`            | The method allows you to upload a file from the local file system, which can later be sent using the SendFileByUrl method | [UploadFile](https://green-api.com/en/docs/api/sending/UploadFile/)                                         |\n| `Sending().SendLocation`          | The method is designed to send a geolocation message                                                                      | [SendLocation](https://green-api.com/en/docs/api/sending/SendLocation/)                                     |\n| `Sending().SendContact`           | The method is for sending a message with a contact                                                                        | [SendContact](https://green-api.com/en/docs/api/sending/SendContact/)                                       |\n| `Sending().SendLink`              | The method is designed to send a message with a link that will add an image preview, title and description                | [SendLink](https://green-api.com/en/docs/api/sending/SendLink/)                                             |\n| `Sending().ForwardMessages`       | The method is designed for forwarding messages to a personal or group chat                                                | [ForwardMessages](https://green-api.com/en/docs/api/sending/ForwardMessages/)                               |\n| `Sending().SendPoll`              | The method is designed for sending messages with a poll to a private or group chat                                        | [SendPoll](https://green-api.com/en/docs/api/sending/SendPoll/)                                             |\n| `Service().CheckWhatsapp`         | The method checks if there is a WhatsApp account on the phone number                                                      | [CheckWhatsapp](https://green-api.com/en/docs/api/service/CheckWhatsapp/)                                   |\n| `Service().GetAvatar`             | The method returns the avatar of the correspondent or group chat                                                          | [GetAvatar](https://green-api.com/en/docs/api/service/GetAvatar/)                                           |\n| `Service().GetContacts`           | The method is designed to get a list of contacts of the current account                                                   | [GetContacts](https://green-api.com/en/docs/api/service/GetContacts/)                                       |\n| `Service().GetContactInfo`        | The method is designed to obtain information about the contact                                                            | [GetContactInfo](https://green-api.com/en/docs/api/service/GetContactInfo/)                                 |\n| `Service().DeleteMessage`         | The method deletes the message from chat                                                                                  | [DeleteMessage](https://green-api.com/en/docs/api/service/deleteMessage/)                                   |\n| `Service().ArchiveChat`           | The method archives the chat                                                                                              | [ArchiveChat](https://green-api.com/en/docs/api/service/archiveChat/)                                       |\n| `Service().UnarchiveChat`         | The method unarchives the chat                                                                                            | [UnarchiveChat](https://green-api.com/en/docs/api/service/unarchiveChat/)                                   |\n| `Service().SetDisappearingChat`   | The method is designed to change the settings of disappearing messages in chats                                           | [SetDisappearingChat](https://green-api.com/en/docs/api/service/SetDisappearingChat/)                       |\n| `Webhook().Start`                 | The method is designed to start receiving new notifications                                                               |                                                                                                             |\n| `Webhook().Stop`                  | The method is designed to stop receiving new notifications                                                                |                                                                                                             |\n\n## Service methods documentation\n\n[Service methods documentation](https://green-api.com/en/docs/api/).\n\n## License\n\nLicensed under [\nCreative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)\n](https://creativecommons.org/licenses/by-nd/4.0/) terms.\nPlease see file [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-api%2Fwhatsapp-api-client-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreen-api%2Fwhatsapp-api-client-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-api%2Fwhatsapp-api-client-golang/lists"}