{"id":15285660,"url":"https://github.com/green-api/whatsapp-api-client-php","last_synced_at":"2026-05-27T14:07:51.603Z","repository":{"id":63942262,"uuid":"566710652","full_name":"green-api/whatsapp-api-client-php","owner":"green-api","description":"This library helps you easily create a php application with WhatsApp API","archived":false,"fork":false,"pushed_at":"2025-11-11T04:22:00.000Z","size":92,"stargazers_count":17,"open_issues_count":2,"forks_count":6,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-11T06:16:35.491Z","etag":null,"topics":["whatsapp","whatsapp-api","whatsapp-api-php","whatsapp-bot","whatsapp-php"],"latest_commit_sha":null,"homepage":"https://green-api.com/en","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-16T08:57:57.000Z","updated_at":"2025-11-11T04:21:36.000Z","dependencies_parsed_at":"2023-11-12T13:25:18.785Z","dependency_job_id":"a7785329-0eb6-4b00-8725-869a2c226a3b","html_url":"https://github.com/green-api/whatsapp-api-client-php","commit_stats":{"total_commits":8,"total_committers":3,"mean_commits":"2.6666666666666665","dds":0.25,"last_synced_commit":"988467c7ef372409e0f2fdb755ddf8213112e2f6"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/green-api/whatsapp-api-client-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fwhatsapp-api-client-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fwhatsapp-api-client-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fwhatsapp-api-client-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fwhatsapp-api-client-php/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-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fwhatsapp-api-client-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30193651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["whatsapp","whatsapp-api","whatsapp-api-php","whatsapp-bot","whatsapp-php"],"created_at":"2024-09-30T15:07:04.072Z","updated_at":"2026-05-27T14:07:51.594Z","avatar_url":"https://github.com/green-api.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# whatsapp-api-client-php\n[![Total Downloads](https://poser.pugx.org/green-api/whatsapp-api-client-php/downloads?format=flat-square)](https://packagist.org/packages/green-api/whatsapp-api-client-php)\n[![Downloads per month](https://img.shields.io/packagist/dm/green-api/whatsapp-api-client-php.svg?style=flat-square)](https://packagist.org/packages/green-api/whatsapp-api-client-php)\n[![License](https://img.shields.io/badge/license-Apache%202.0-red.svg?style=flat-square)](https://packagist.org/packages/green-api/whatsapp-api-client-php)\n\n- [Документация на русском языке](README_RUS.md)\n\nPHP library for integration with WhatsApp messenger via API of [green-api.com](https://green-api.com/en/) service. To use the library you have to get a registration token and an account id in the [personal area](https://console.green-api.com). There is a free developer account tariff plan.\n\n## API\n\nYou can find REST API documentation by [url](https://green-api.com/en/docs/api/). The library is a wrapper for REST API, so the documentation at the above url applies to the library as well.\n\n## Installation\n\nVia [Composer](https://getcomposer.org):\n\n```bash\ncomposer require green-api/whatsapp-api-client-php\n```\n\n## Import\n\n```\nrequire './vendor/autoload.php';\n```\n## Authorization\n\nTo send a message or to execute some other Green-API method, you have to have the WhatsApp account in the phone application to be authorized. To authorize your account please go to the [personal area](https://console.green-api.com) and scan a QR-code using the WhatsApp application.\n\n## Running index.php\n\n```\nphp -S localhost:8080\n```\n\n## Examples\n\n### How to initialize an object\n\n```\n$greenApi = new GreenApiClient( ID_INSTANCE, API_TOKEN_INSTANCE );\n```\n\n### Sending a text message to a WhatsApp number\n\n```\n$result = $greenApi-\u003esending-\u003esendMessage('11001234567@g.us', 'Message text');\n```\n\nExample url: [sendTextMessage.php](https://github.com/green-api/whatsapp-api-client-php/blob/master/examples/sendTextMessage.php)\n\nPlease note that keys can be obtained from environment variables:\n```\n\u003c?php\nrequire './vendor/autoload.php';\n\ndefine( \"ID_INSTANCE\", getenv(\"ID_INSTANCE\" ));\ndefine( \"API_TOKEN_INSTANCE\", getenv(\"API_TOKEN_INSTANCE\") );\n```\n\n### Sending an image via URL\n\n```\n$result = $greenApi-\u003esending-\u003esendFileByUrl(\n        '11001234567@c.us', 'https://www.google.ru/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png',\n        'googlelogo_color_272x92dp.png', 'Google logo');\n```\n\nExample url: [sendPictureByLink.php](https://github.com/green-api/whatsapp-api-client-php/blob/master/examples/sendPictureByLink.php)\n\n### Sending an image by uploading from the disk\n\n```\n$result = $greenApi-\u003esending-\u003esendFileByUpload('11001234567@c.us',\n        'C:\\Games\\PicFromDisk.png', 'PicFromDisk.jpg', 'Picture from disk');\n```\n\nExample url: [sendPictureByUpload.php](https://github.com/green-api/whatsapp-api-client-php/blob/master/examples/sendPictureByUpload.php)\n\n### Group creation and sending a message to the group\n\n```\n$chatIds = [\n\t'11001234567@c.us'\n];\n$resultCreate = $greenApi-\u003egroups-\u003ecreateGroup('GroupName', $chatIds );\n\nif ($resultCreate-\u003ecode == 200)\n\t$resultSend = $greenApi-\u003esending-\u003esendMessage($resultCreate-\u003edata-\u003echatId, \n\t    'Message text');\n```\n\nIMPORTANT: If one tries to create a group with a non-existent number, WhatsApp\nmay block the sender's number. The number in the example is non-existent.\n\nExample url: [createGroupAndSendMessage.php](https://github.com/green-api/whatsapp-api-client-php/blob/master/examples/createGroupAndSendMessage.php)\n\n### Receive incoming messages by HTTP API\n\nThe general concept of receiving data in the Green API is described [here](https://green-api.com/en/docs/api/receiving/)\nTo start receiving messages by the HTTP API you need to execute the library method:\n\n```\ngreenAPI.webhooks.startReceivingNotifications(onEvent)\n```\n\nonEvent - your method which should contain parameters:\nParameter | Description\n----- | -----\ntypewebhook | received message type (string)\nbody | message body (json)\n\nMessage body types and formats [here](https://green-api.com/en/docs/api/receiving/notifications-format/)\n\nThis method will be called when an incoming message is received. Next, process messages according to the business logic of your system.\n\n## Examples list\n\n| Description                                                    | Module                                                                                                                                   |\n|----------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| Example of sending text                                        | [sendTextMessage.php](https://github.com/green-api/whatsapp-api-client-php/blob/master/examples/sendTextMessage.php)                     |\n| Example of sending a picture by URL                            | [sendPictureByLink.php](https://github.com/green-api/whatsapp-api-client-php/blob/master/examples/sendPictureByLink.php)                 |\n| Example of sending a picture by uploading from the disk        | [sendPictureByUpload.php](https://github.com/green-api/whatsapp-api-client-php/blob/master/examples/sendPictureByUpload.php)             |\n| Example of a group creation and sending a message to the group | [createGroupAndSendMessage.php](https://github.com/green-api/whatsapp-api-client-php/blob/master/examples/createGroupAndSendMessage.php) |\n| Example of incoming webhooks receiving                         | [receiveNotification.php](https://github.com/green-api/whatsapp-api-client-php/blob/master/examples/receiveNotification.php)             |\n| Example if working with contacts                               | [contactsMethods.php](https://github.com/green-api/whatsapp-api-client-php/blob/master/examples/contactsMethods.php)                 |\n\n## The full list of the 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.setSettings`                  | The method is designed to set the account settings                                                                       | [SetSettings](https://green-api.com/en/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.getAuthorizationCode`         | The method is designed to authorize an instance by phone number                                                          | [GetAuthorizationCode](https://green-api.com/en/docs/api/account/GetAuthorizationCode/)                     |\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| `contacts.addContact()`                | The method is aimed for adding a number to contacts                                                                      | [AddContact](https://green-api.com/en/docs/api/contacts/AddContact)                                    |\n| `contacts.editContact()`               | The method is used to edit a number in contacts                                                                          | [EditContact](https://green-api.com/en/docs/api/contacts/EditContact)                                     |\n| `contacts.deleteContact()`             | The method is used to remove a number from contacts                                                                      | [DeleteContact](https://green-api.com/en/docs/api/contacts/DeleteContact)                  |\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.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| `marking.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.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| `serviceMethods.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| `serviceMethods.getAvatar`             | The method returns the avatar of the correspondent or group chat                                                         | [GetAvatar](https://green-api.com/en/docs/api/service/GetAvatar/)                                           |\n| `serviceMethods.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| `serviceMethods.getContactInfo`        | The method is designed to obtain information about the contact                                                           | [GetContactInfo](https://green-api.com/en/docs/api/service/GetContactInfo/)                                 |\n| `serviceMethods.editMessage`           | The method edits a message in a chat                                                                                     | [EditMessage](https://green-api.com/en/docs/api/service/editMessage/)                                       |\n| `serviceMethods.deleteMessage`         | The method deletes the message from chat                                                                                 | [DeleteMessage](https://green-api.com/en/docs/api/service/deleteMessage/)                                   |\n| `serviceMethods.archiveChat`           | The method archives the chat                                                                                             | [ArchiveChat](https://green-api.com/en/docs/api/service/archiveChat/)                                       |\n| `serviceMethods.unarchiveChat`         | The method unarchives the chat                                                                                           | [UnarchiveChat](https://green-api.com/en/docs/api/service/unarchiveChat/)                                   |\n| `serviceMethods.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| `webhooks.startReceivingNotifications` | The method is designed to start receiving new notifications                                                              |                                                                                                             |\n| `webhooks.stopReceivingNotifications`  | The method is designed to stop receiving new notifications                                                               |                                                                                                             |\n| `statuses.sendTextStatus`              | The method is aimed for sending a text status                                                                            | [SendTextStatus](https://green-api.com/en/docs/api/statuses/SendTextStatus/)                                |\n| `statuses.sendVoiceStatus`             | The method is aimed for sending a voice status                                                                           | [SendVoiceStatus](https://green-api.com/en/docs/api/statuses/SendVoiceStatus/)                              |\n| `statuses.sendMediaStatus`             | The method is aimed for sending a pictures or video status                                                               | [SendMediaStatus](https://green-api.com/en/docs/api/statuses/SendMediaStatus/)                              |\n| `statuses.getIncomingStatuses`         | The method returns the incoming status messages of the instance                                                          | [GetIncomingStatuses](https://green-api.com/en/docs/api/statuses/GetIncomingStatuses/)                      |\n| `statuses.getOutgoingStatuses`         | The method returns the outgoing statuses of the account                                                                  | [GetOutgoingStatuses](https://green-api.com/en/docs/api/statuses/GetOutgoingStatuses/)                      |\n| `statuses.getStatusStatistic`          | The method returns an array of recipients marked sent/delivered/read for a given status                                  | [GetStatusStatistic](https://green-api.com/en/docs/api/statuses/GetStatusStatistic/)                        |\n| `partner.getInstances`                 | The method is designed to get the instances of the account                                                               | [GetInstances](https://green-api.com/en/docs/partners/getInstances/)                                        |\n| `partner.createInstance`               | The method is designed to create the instance in the account                                                             | [CreateInstance](https://green-api.com/en/docs/partners/createInstance/)                                    |\n| `partner.deleteInstanceAccount`        | The method is designed to remove the instance in the account                                                             | [DeleteInstanceAccount](https://green-api.com/en/docs/partners/deleteInstanceAccount/)                      |\n\n## Service methods documentation\n\n[https://green-api.com/en/docs/api/](https://green-api.com/en/docs/api/)\n\n## License\n\nLicensed under MIT terms. Please see file [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-api%2Fwhatsapp-api-client-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreen-api%2Fwhatsapp-api-client-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-api%2Fwhatsapp-api-client-php/lists"}