Skip to content

Releases: green-api/whatsapp-api-client-golang

Added partner methods

20 Mar 06:32
fe905df
Compare
Choose a tag to compare

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

21 Dec 04:11
87bf9a0
Compare
Choose a tag to compare

Fixes

  • Fixed ReceiveNotification

Fixed array methods

19 Dec 14:54
c96e7bc
Compare
Choose a tag to compare

Fixes

  • Fixed GetChatHistory method
  • Fixed LastIncomingMessages method
  • Fixed LastOutgoingMessages method
  • Fixed ShowMessagesQueue method
  • Fixed GetContacts method
  • Fixed #13

Added new methods

16 Dec 18:26
e29e714
Compare
Choose a tag to compare

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

Dependencies

Fixed UploadFile

17 Jul 05:05
8d13379
Compare
Choose a tag to compare
  • Fixed UploadFile

Removed SetSystemProxy

11 Jul 05:50
3d0aca6
Compare
Choose a tag to compare
  • Removed SetSystemProxy method

Added UploadFile method

09 Jul 15:36
ad1b634
Compare
Choose a tag to compare
  • Added UploadFile method

Fixed `import cycle not allowed`

17 May 15:37
f66da8d
Compare
Choose a tag to compare
  • 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

11 Mar 11:10
Compare
Choose a tag to compare
  • 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

28 Feb 05:48
Compare
Choose a tag to compare
  • The webhook example has been updated
  • The installation description has been updated