Files
Hein ecd5525430
Some checks failed
CI / Lint (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Test (1.23) (push) Has been cancelled
CI / Test (1.22) (push) Has been cancelled
feat(api): 🎉 Add business profile and catalog management
* Implement endpoints for managing business profiles:
  - Get business profile
  - Update business profile

* Add catalog management features:
  - List catalogs
  - List products in a catalog
  - Send catalog messages
  - Send single product messages
  - Send product list messages

* Introduce media upload functionality for sending media files.

* Add flow management capabilities:
  - Deprecate flows

* Update API documentation to reflect new endpoints and features.
2026-02-04 11:17:40 +02:00

29 lines
925 B
Go

package businessapi
import (
"context"
"net/url"
)
// GetBusinessProfile retrieves the business profile for this phone number.
func (c *Client) GetBusinessProfile(ctx context.Context) (*BusinessProfile, error) {
params := url.Values{
"fields": {"about,address,description,email,websites,vertical,profile_picture_url"},
}
var resp BusinessProfile
if err := c.graphAPIGet(ctx, c.config.PhoneNumberID+"/whatsapp_business_profile", params, &resp); err != nil {
return nil, err
}
return &resp, nil
}
// UpdateBusinessProfile updates one or more business profile fields.
// Only include fields you want to change — omitted fields are left untouched.
func (c *Client) UpdateBusinessProfile(ctx context.Context, profile BusinessProfileUpdate) error {
profile.MessagingProduct = "whatsapp"
var resp map[string]any
return c.graphAPIPost(ctx, c.config.PhoneNumberID+"/whatsapp_business_profile", profile, &resp)
}