Zoho Meeting Api Error-PHP

Zoho Meeting Api Error-PHP

Hello Zoho, I am developing one php script for creating zoho meetings with zoho meetings api but I am getting 400 Response Code Again and again And I am getting nothing So I know the error please Reach me out for fixing this error.
This is My PHP Code :-
<?php

// Zoho Meeting API endpoint
$api_url = 'https://meeting.zoho.com/api/v2/{zsoid}/sessions.json'; // Replace {zsoid} with your actual Zoho Meeting ID

// Zoho Meeting authentication token
$auth_token = '1000.fb201bb53f08d8c39e1b50b96782362a.0f43d8767ce1d48f6a429d5dd4920bde'; // Replace with your Zoho OAuth token

// Meeting details
$topic = "PHP File";
$agenda = "For Zoho Meetings";
$presenter = 235109000000002005; // Zoho user ID of the presenter
$startTime = "Jun 19, 2024 11:00 PM";
$duration_minutes = 60; // Duration of the meeting in minutes
$timezone = "Asia/Kolkata"; // Timezone of the meeting (Portugal timezone)
$participants = array(
    array(
        "email" => "dishirajput7@email.com"
    )
);

// Prepare data for API request
$data = array(
    "session" => array(
        "topic" => $topic,
        "agenda" => $agenda,
        "presenter" => $presenter,
        "startTime" => $startTime,
        "duration" => $duration_minutes * 60 * 1000, // Convert minutes to milliseconds
        "timezone" => $timezone,
        "participants" => $participants
    )
);

// Convert data to JSON format
$post_data = json_encode($data);

// Prepare cURL request
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json;charset=UTF-8',
    'Authorization: Zoho-oauthtoken ' . $auth_token
));

// Execute the request
$response = curl_exec($ch);

// Check for errors
// Check for errors
if(curl_errno($ch)) {
    echo 'Error: ' . curl_error($ch);
} else {
    // Decode the response
    $result = json_decode($response, true);
   
    // Check if the meeting session was created successfully
    if(isset($result['session']['sessionKey'])) {
        echo 'Meeting session created successfully. Session Key: ' . $result['session']['sessionKey'];
    } elseif(isset($result['error']['message'])) {
        echo 'Failed to create meeting session. Error: ' . $result['error']['message'];
    } else {
        echo 'Failed to create meeting session. Unknown error occurred.';
    }
}


// Close cURL session
curl_close($ch);
?>