Hello zerox12,
Thank you for help. You are right; I need to duplicate user information to another database. I've just almost given up and back using (only) laravel to create a web service until I saw your post. I've translated your code using PHP, and it works perfectly.
here is my code, hopefully, it could help someone out there who have the same problem.
<?php
$options = [];
$options['headers'] = [];
$options['headers']['X-DreamFactory-Api-Key'] = $platform['session']['api_key'];
$options['headers']['X-DreamFactory-Session-Token'] = $platform['session']['session_token'];
$options['headers']['Content-Type'] = 'application/json';
$api = $platform["api"];
$get = $api->get;
$url = 'user/session';
$result = $get($url);
$id = $result['content']['id'];
echo "id:".$id;
exit();
?>