Releases: green-api/whatsapp-api-client-golang
Releases · green-api/whatsapp-api-client-golang
Added partner methods
Enhancements
- Added documentation links
Features
- Added partner methods
Example:
package main
import (
"fmt"
"github.com/green-api/whatsapp-api-client-golang/pkg/api"
)
func main() {
Partner := api.GreenAPI{
PartnerToken: "gac.1234567891234567891234567891213456789",
}
response, err := Partner.Methods().Partner().CreateInstance(map[string]interface{}{
"stateWebhook": "yes",
"incomingWebhook": "yes",
})
if err != nil {
fmt.Println(err)
}
fmt.Println(response)
}
https://github.com/green-api/whatsapp-api-client-golang/blob/master/examples/createInstance/main.go
Dependencies
- Bump golang.org/x/net from 0.19.0 to 0.22.0
Fixed ReceiveNotification
Fixes
- Fixed ReceiveNotification
Fixed array methods
Fixes
- Fixed GetChatHistory method
- Fixed LastIncomingMessages method
- Fixed LastOutgoingMessages method
- Fixed ShowMessagesQueue method
- Fixed GetContacts method
- Fixed #13
Added new methods
Fixes
-
Fixed docs
-
Fixed API method names
-
Updated MIMEType detection
-
Fixed #12
Now all library errors will be returned to you. A channel for tracking errors in the
GreenAPIWebhook
structure has also been added.Example of error handling when receiving or deleting incoming notifications:
go func() {
for {
select {
case err := <-GreenAPIWebhook.ErrorChannel:
fmt.Println(err.Error())
default:
<-time.After(time.Second)
}
}
}()
Enhancements
- Added workflows
- Added dependabot
Features
- Added SendPoll method (thanks to @Jibek100)
- Added GetWaSettings method (thanks to @andreyMalyshkin)
- Added GetAuthorizationCode method (thanks to @Jibek100)
Dependencies
Fixed UploadFile
- Fixed UploadFile
Removed SetSystemProxy
- Removed SetSystemProxy method
Added UploadFile method
- Added UploadFile method
Fixed `import cycle not allowed`
- Fixed
import cycle not allowed
- Example webhook has been updated
package main
import (
"fmt"
"github.com/green-api/whatsapp-api-client-golang/pkg/api"
- "github.com/green-api/whatsapp-api-client-golang/pkg/webhook"
)
func main() {
GreenAPI := api.GreenAPI{
IDInstance: "1101000001",
APITokenInstance: "d75b3a66374942c5b3c019c698abc2067e151558acbd412345",
}
- GreenAPIWebhook := webhook.GreenAPIWebhook{
- GreenAPI: GreenAPI,
- }
+ GreenAPIWebhook := GreenAPI.Webhook()
GreenAPIWebhook.Start(func(body map[string]interface{}) {
fmt.Println(body)
})
}
Added webhook function
- The examples have been updated
- The docs have been updated
- Added
GreenAPI.Webhook
function (You can use the Webhook structure directly from the GreenAPI structure)
README and examples updates
- The webhook example has been updated
- The installation description has been updated