<?php

$apiKey = "sk_live_1e29fd3a60cd9bde548c5888f927fe826f0e442e6c8167d6";

$payload = json_encode([
    "to"=>["+258843859009"],
    "body"=>"Teste SMS",
    "sender"=>"AMICROCREDI"
]);

$ch = curl_init("https://iiywyqfapgqkggvxyvfd.supabase.co/functions/v1/api/sms/send");

curl_setopt_array($ch,[
    CURLOPT_RETURNTRANSFER=>true,
    CURLOPT_POST=>true,
    CURLOPT_POSTFIELDS=>$payload,
    CURLOPT_HTTPHEADER=>[
        "X-API-Key: ".$apiKey,
        "Content-Type: application/json"
    ]
]);

$response=curl_exec($ch);

echo curl_getinfo($ch,CURLINFO_HTTP_CODE);

echo "<pre>";
print_r($response);