Skip to content

Type error: Customer::__construct(): Argument #2 ($name) must be of type string, null given. Profile object is optional in webhook. #236

@arneee

Description

@arneee

Hi,

looks like the profile is actually optional.

Netflie\WhatsAppCloudApi\WebHook\Notification\Support\Customer::__construct(): Argument #2 ($name) must be of type string, null given, called in /workspace/vendor/netflie/whatsapp-cloud-api/src/WebHook/Notification/MessageNotificationFactory.php on line 131

/workspace/vendor/netflie/whatsapp-cloud-api/src/WebHook/Notification/MessageNotificationFactory.php:133
Warning: Undefined array key "profile"

Under contacts, there is no profile object.

Incoming Webhook:

array (
  'object' => 'whatsapp_business_account',
  'entry' => 
  array (
    0 => 
    array (
      'id' => 'XXXX',
      'changes' => 
      array (
        0 => 
        array (
          'value' => 
          array (
            'messaging_product' => 'whatsapp',
            'metadata' => 
            array (
              'display_phone_number' => 'XXXX',
              'phone_number_id' => 'XXXX',
            ),
            'contacts' => 
            array (
              0 => 
              array (
                'wa_id' => 'XXXX',
              ),
            ),
            'messages' => 
            array (
              0 => 
              array (
                'from' => 'XXXX',
                'id' => 'wamid.XXXX=',
                'timestamp' => 'XXXX',
                'type' => 'video',
                'video' => 
                array (
                  'mime_type' => 'video/mp4',
                  'sha256' => 'XXXX',
                  'id' => 'XXXX',
                  'url' => 'XXXX',
                ),
              ),
            ),
          ),
          'field' => 'messages',
        ),
      ),
    ),
  ),
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    releasedThe feature was released in some version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions