1. Go to this page and download the library: Download softan/users-php-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/ */
softan / users-php-sdk example snippets
SoftanUsers\Services;
// Listar todos los usuarios (entorno stg por defecto)
$users = Services::listUsers();
// Crear un usuario
$created = Services::createUser([
'identification_type' => 1,
'user_identification' => '123456789',
'user_name' => 'Juan',
'user_last_name' => 'Pérez',
'user_email' => '[email protected]',
'country_id' => 48,
]);
use SoftanUsers\Services;
// Listar todos los usuarios
$list = Services::listUsers();
// Ver un usuario por ID
$user = Services::showUser(42);
// Crear usuario
$created = Services::createUser([
'identification_type' => 1, // ID del tipo de identificación
'user_identification' => '987654', // Número de documento
'user_name' => 'María',
'user_last_name' => 'García',
'user_email' => '[email protected]',
'country_id' => 48, // ID del país (Colombia)
'user_phone' => '+573001234567', // Opcional
]);
// Actualizar usuario (requiere user_id + todos los campos + user_status)
$updated = Services::updateUser([
'user_id' => 42,
'identification_type' => 1,
'user_identification' => '987654',
'user_name' => 'María',
'user_last_name' => 'García',
'user_email' => '[email protected]',
'country_id' => 48,
'user_status' => 1, // 1=activo, 2=inactivo, 3=sin verificar
]);
// Eliminar usuario
$deleted = Services::deleteUser(42);