import "github.com/gTahidi/wapi.go/pkg/client"type Client struct {
Business business.BusinessClient // Business is the business client.
Messaging []messaging.MessagingClient // MessagingClient is the messaging client.
eventManager *manager.EventManager // eventManager is the event manager.
webhook *manager.WebhookManager // webhook is the webhook manager.
requester *request_client.RequestClient
apiAccessToken string
businessAccountId string
}func New(config *ClientConfig) *Clientfunc (client *Client) GetWebhookGetRequestHandler() func(c echo.Context) errorGetWebhookGetRequestHandler returns the handler function for handling GET requests to the webhook.
func (client *Client) GetWebhookPostRequestHandler() func(c echo.Context) errorGetWebhookPostRequestHandler returns the handler function for handling POST requests to the webhook.
func (client *Client) Initiate() boolInitiateClient initializes the client and starts listening to events from the webhook. It returns true if the client was successfully initiated.
func (client *Client) NewMessagingClient(phoneNumberId string) *messaging.MessagingClientfunc (client *Client) On(eventType events.EventType, handler func(events.BaseEvent))OnMessage registers a handler for a specific event type.
type ClientConfig struct {
BusinessAccountId string
ApiAccessToken string
WebhookSecret string `validate:"required"`
// these two are not required, because may be user want to use their own server
WebhookPath string
WebhookServerPort int
}