@extends('layouts.app') @section('title', 'Instagram Bot – Social Networks') @section('content')
Connect the Instagram Messaging API for DMs. Set the webhook URL and verify token in your Meta app to receive and send messages.
Token: @if(session('verify_token_ok'))✓@else✗@endif {{ session('verify_token_result') }}
@endif @if (session('verify_webhook_result'))Webhook: @if(session('verify_webhook_ok'))✓@else○@endif {{ session('verify_webhook_result') }}
@endifIn Meta for Developers → Your App → Instagram → Webhooks (or Configuration), set:
{{ $webhookUrl }}Subscribe to messages (and optionally message_reactions, messaging_postbacks).
Modo Live vs pruebas: si la app no está en Live, Meta suele no enviar webhooks de DMs salvo para cuentas con rol en la app o probadoras. Tokens del bot se guardan arriba (base de datos), igual que WhatsApp en su pantalla — no hace falta duplicarlos en .env. Con la app en Live, usa Allowed sender IDs arriba para limitar quién recibe respuestas automáticas; vacío = todos.
✓ Instagram Bot is connected (token set).
@elseFill Access Token and Verify Token and save to connect.
@endifAI-powered replies using Shopify catalog. View DM conversations from Instagram.
Token is checked against Meta when you open this page. Click the button below to re-check token and whether the webhook has received events.
@if($setting->isConnected()) @if($tokenValid)✓ {{ $tokenMessage }}
@else✗ {{ $tokenMessage }}
@endif @elseSave an Access Token above to verify connection.
@endif @if(isset($lastWebhookReceived) && $lastWebhookReceived)✓ Webhook last received: {{ \Carbon\Carbon::parse($lastWebhookReceived)->diffForHumans() }}.
@endifTo confirm the webhook is working, use the Test button in Meta App Dashboard → Webhooks to send a sample, or send a DM to your Instagram account.