<?php
$api_endpoint = "https://wa.hrdandrecruitments.com/api/wpbox/getTemplates";
$token = "oGCZSDuBSnCDKAg7cFQwMigNFxH0ts4pN0W7IY0H605d91ec"; // Replace with your token

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => $api_endpoint . "?token=" . $token,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET'
]);

$response = curl_exec($curl);
curl_close($curl);

if ($response) {
    echo $response;
} else {
    echo json_encode(["status" => "error", "message" => "Failed to fetch templates"]);
}
?>
