1. Go to this page and download the library: Download moshipp/mosend-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
moshipp / mosend-sdk example snippets
use Mosend\MosendClient;
$mosend = new MosendClient([
'apiKey' => getenv('MOSEND_API_KEY'), // mk_live_<prefix>.<secret>
'orgId' => getenv('MOSEND_ORG_ID'), // UUID de tu organización
]);
// Enviar una plantilla
$msg = $mosend->messages->send([
'phoneNumberId' => '<phone-uuid>',
'to' => '573001234567', // E.164 sin '+'
'type' => 'template',
'templateId' => '<uuid-de-la-plantilla>',
'variables' => ['Juan', 'FAC-2026-0042'],
]);
echo $msg['id'], ' ', $msg['metaMessageId'], PHP_EOL;
// Paginar conversaciones (maneja el cursor por vos)
foreach ($mosend->conversations->iterate(['status' => 'open']) as $conv) {
echo $conv['id'], PHP_EOL;
}