<?php
header('content-type:application/json');
include($_SERVER['DOCUMENT_ROOT'] . "/API-Others/connection/conn.php");

$unique_user_id = addslashes(isset($_GET['userId']) ? $_GET['userId'] : '');
$query = mysqli_query($conn, "SELECT * FROM documents WHERE unique_user_id = '$unique_user_id'");
$config_types = array();
while ($spec = mysqli_fetch_assoc($query)) {
    $config_types[] =  $spec;
}

$statusCode = 200;
$statusMessage = "Signed In Successfully";

$resultData = array('code' => $statusCode, 'message' => $statusMessage, 'documents' => $config_types);
echo json_encode($resultData);
