=== Testing Marketing Campaigns API === Test 1: Direct Controller Call (No Auth/Middleware) -------------------------------------------------- Status: 200 Success: 1 Data count: 0 ✓ Direct call works Test 2: Check Database Tables -------------------------------------------------- ✓ Table 'marketing_campaigns': EXISTS ✓ Table 'campaign_recipients': EXISTS ✓ Table 'users': EXISTS ✓ Table 'roles': EXISTS ✓ Table 'permissions': EXISTS ✓ Table 'role_permissions': EXISTS Test 3: Check Marketing Permissions -------------------------------------------------- ✓ Permission 'marketing.view': EXISTS ✓ Permission 'marketing.send': EXISTS ✓ Permission 'marketing.edit': EXISTS ✓ Permission 'marketing.templates': EXISTS Test 4: Check User Permissions -------------------------------------------------- User: Ahmad (ID: 1) Role: superadmin Permissions count: 2 Marketing permissions: - marketing.view Test 5: Simulate Full Request with Auth -------------------------------------------------- Status: 200 ✓ Request succeeded Data count: 0 Test 6: Recent Laravel Errors -------------------------------------------------- Last 10 relevant log entries: [2025-12-21 22:52:28] production.INFO: WhatsApp webhook received {"data":{"object":"whatsapp_business_account","entry":[{"id":"732415596031002","changes":[{"value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"97142357300","phone_number_id":"857686120769834"},"statuses":[{"id":"Over 9 levels deep, aborting normalization","status":"Over 9 levels deep, aborting normalization","timestamp":"Over 9 levels deep, aborting normalization","recipient_id":"Over 9 levels deep, aborting normalization","errors":"Over 9 levels deep, aborting normalization"}]},"field":"messages"}]}]},"headers":{"host":["apikds.sadeemdubai.ae"],"accept":["*/*"],"accept-encoding":["deflate, gzip"],"user-agent":["facebookexternalua"],"content-type":["application/json"],"x-hub-signature":["sha1=49ec445e239b0ffb30d45611849ae9230aae336e"],"x-hub-signature-256":["sha256=e85eb125242bc78a61351406aacc19f2aa0ec5fca788305f998089b9ee1f60cb"],"content-length":["534"]},"ip":"173.252.95.5"} [2025-12-21 22:55:25] production.ERROR: Error in syncOrders: Pusher error: Payload too large.. [2025-12-21 23:05:28] production.INFO: WhatsApp webhook received {"data":{"object":"whatsapp_business_account","entry":[{"id":"732415596031002","changes":[{"value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"97142357300","phone_number_id":"857686120769834"},"statuses":[{"id":"Over 9 levels deep, aborting normalization","status":"Over 9 levels deep, aborting normalization","timestamp":"Over 9 levels deep, aborting normalization","recipient_id":"Over 9 levels deep, aborting normalization","errors":"Over 9 levels deep, aborting normalization"}]},"field":"messages"}]}]},"headers":{"host":["apikds.sadeemdubai.ae"],"accept":["*/*"],"accept-encoding":["deflate, gzip"],"user-agent":["facebookexternalua"],"content-type":["application/json"],"x-hub-signature":["sha1=44e079a58f585461bd3b37fdf3230e847875e97e"],"x-hub-signature-256":["sha256=aa1abb769f984fe4ce0934267cae2646de66b6be3b86eb81acb99d1022c2baae"],"content-length":["534"]},"ip":"173.252.95.3"} [2025-12-21 23:31:14] production.INFO: WhatsApp webhook received {"data":{"object":"whatsapp_business_account","entry":[{"id":"732415596031002","changes":[{"value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"97142357300","phone_number_id":"857686120769834"},"statuses":[{"id":"Over 9 levels deep, aborting normalization","status":"Over 9 levels deep, aborting normalization","timestamp":"Over 9 levels deep, aborting normalization","recipient_id":"Over 9 levels deep, aborting normalization","errors":"Over 9 levels deep, aborting normalization"}]},"field":"messages"}]}]},"headers":{"host":["apikds.sadeemdubai.ae"],"accept":["*/*"],"accept-encoding":["deflate, gzip"],"user-agent":["facebookexternalua"],"content-type":["application/json"],"x-hub-signature":["sha1=bf65b84b6679d4b9e4389763255b3de4a33dc0d8"],"x-hub-signature-256":["sha256=e2c59a7c95a9800af23c86f286559b503e6a2964ba714e41141d6653873da2d5"],"content-length":["534"]},"ip":"173.252.79.4"} [2025-12-21 23:34:46] production.INFO: WhatsApp webhook received {"data":{"object":"whatsapp_business_account","entry":[{"id":"732415596031002","changes":[{"value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"97142357300","phone_number_id":"857686120769834"},"statuses":[{"id":"Over 9 levels deep, aborting normalization","status":"Over 9 levels deep, aborting normalization","timestamp":"Over 9 levels deep, aborting normalization","recipient_id":"Over 9 levels deep, aborting normalization","errors":"Over 9 levels deep, aborting normalization"}]},"field":"messages"}]}]},"headers":{"host":["apikds.sadeemdubai.ae"],"accept":["*/*"],"accept-encoding":["deflate, gzip"],"user-agent":["facebookexternalua"],"content-type":["application/json"],"x-hub-signature":["sha1=8698e4aa2b8b86be8c992919230628900d4111a6"],"x-hub-signature-256":["sha256=b2955d272e6b47e8167b02a86fc4ee26c63f42c85882a2ff908e7032458b4ead"],"content-length":["534"]},"ip":"173.252.79.124"} [2025-12-21 23:37:05] production.ERROR: Error in syncOrders: Pusher error: Payload too large.. [2025-12-21 23:45:33] production.INFO: WhatsApp webhook received {"data":{"object":"whatsapp_business_account","entry":[{"id":"732415596031002","changes":[{"value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"97142357300","phone_number_id":"857686120769834"},"statuses":[{"id":"Over 9 levels deep, aborting normalization","status":"Over 9 levels deep, aborting normalization","timestamp":"Over 9 levels deep, aborting normalization","recipient_id":"Over 9 levels deep, aborting normalization","errors":"Over 9 levels deep, aborting normalization"}]},"field":"messages"}]}]},"headers":{"host":["apikds.sadeemdubai.ae"],"accept":["*/*"],"accept-encoding":["deflate, gzip"],"user-agent":["facebookexternalua"],"content-type":["application/json"],"x-hub-signature":["sha1=dbaa23448279ee3f3ec638b91360d95bebe2e6e2"],"x-hub-signature-256":["sha256=be57d80d2885cf3e05a84303daba7c3de497c710780dcfc78d962317d950c1c5"],"content-length":["541"]},"ip":"173.252.107.114"} [2025-12-21 23:53:27] production.INFO: WhatsApp webhook received {"data":{"object":"whatsapp_business_account","entry":[{"id":"732415596031002","changes":[{"value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"97142357300","phone_number_id":"857686120769834"},"statuses":[{"id":"Over 9 levels deep, aborting normalization","status":"Over 9 levels deep, aborting normalization","timestamp":"Over 9 levels deep, aborting normalization","recipient_id":"Over 9 levels deep, aborting normalization","errors":"Over 9 levels deep, aborting normalization"}]},"field":"messages"}]}]},"headers":{"host":["apikds.sadeemdubai.ae"],"accept":["*/*"],"accept-encoding":["deflate, gzip"],"user-agent":["facebookexternalua"],"content-type":["application/json"],"x-hub-signature":["sha1=6b20e2cecec3fd915d7a62556f05da58e5e7ff59"],"x-hub-signature-256":["sha256=2854a6455cfb7367cb3590c4e34ce0413ab516051d02090ad057314a17e7fb08"],"content-length":["534"]},"ip":"173.252.79.6"} [2025-12-21 23:54:29] production.INFO: WhatsApp webhook received {"data":{"object":"whatsapp_business_account","entry":[{"id":"732415596031002","changes":[{"value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"97142357300","phone_number_id":"857686120769834"},"statuses":[{"id":"Over 9 levels deep, aborting normalization","status":"Over 9 levels deep, aborting normalization","timestamp":"Over 9 levels deep, aborting normalization","recipient_id":"Over 9 levels deep, aborting normalization","errors":"Over 9 levels deep, aborting normalization"}]},"field":"messages"}]}]},"headers":{"host":["apikds.sadeemdubai.ae"],"accept":["*/*"],"accept-encoding":["deflate, gzip"],"user-agent":["facebookexternalua"],"content-type":["application/json"],"x-hub-signature":["sha1=e0959f8dbb0e1d5552cc0cd4e014f3e7c6506073"],"x-hub-signature-256":["sha256=b9fba26bbcd756ef90d9a814bfa9d90d25657722a372705eb315a182bfd0484f"],"content-length":["536"]},"ip":"173.252.107.115"} [2025-12-22 01:07:46] production.INFO: WhatsApp webhook received {"data":{"object":"whatsapp_business_account","entry":[{"id":"732415596031002","changes":[{"value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"97142357300","phone_number_id":"857686120769834"},"user_actions":[{"timestamp":"Over 9 levels deep, aborting normalization","action_type":"Over 9 levels deep, aborting normalization","marketing_messages_link_click_data":"Over 9 levels deep, aborting normalization"}]},"field":"messages"}]}]},"headers":{"host":["apikds.sadeemdubai.ae"],"accept":["*/*"],"accept-encoding":["deflate, gzip"],"user-agent":["facebookexternalua"],"content-type":["application/json"],"x-hub-signature":["sha1=5879eff2cff3574d120f1a1e41830fc00591a6af"],"x-hub-signature-256":["sha256=690c21f89dd1eb416740785355bfd6faa216afc3b4355e904bd83e01c77e1034"],"content-length":["708"]},"ip":"173.252.107.6"} === Diagnostic Complete === If all tests pass but API still returns 500: 1. Check web server logs: /var/log/nginx/error.log or /var/log/apache2/error.log 2. Check PHP-FPM logs if using nginx 3. Verify .env file has correct APP_KEY 4. Run: php artisan config:clear && php artisan cache:clear 5. Check if production uses different database than tested here