Skip to content

Evolution API webhook sample code. #811

Answered by MeeTyHA
xxats asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, Now I am integrating the whatsapp using Evolution API.
This is webhook code that I implemented.

import { NextRequest, NextResponse } from 'next/server';
import { supabaseAdmin as supabase } from '@/auth/context/supabase/lib';
import uuidv4 from '@/utils/uuidv4';
import { evolutionAPIService } from '@/services/evolution-api';

// Helper function to get server timestamp in ISO format
function getServerTimestamp(): string {
  return new Date().toISOString();
}

// Helper function to normalize timestamp to server time
// This ensures all timestamps are based on the server's timezone and clock
function normalizeTimestamp(timestamp?: string | number | Date): string {
  // If no timestamp pr…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xxats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants