See if this helps buddy
<?php
    # Definindo pacotes de retorno em padrão JSON...
    header('Content-Type: application/json;charset=utf-8');
    # Carregando o framework Slim...
    require 'Slim/Slim.php';
    \Slim\Slim::registerAutoloader();
    # Iniciando o objeto de manipulação da API SlimFramework
    $app = new \Slim\Slim();
    $app->response()->header('Content-Type', 'application/json;charset=utf-8');
    # Função de teste de funcionamento da API...
    $app->get('/', function () {
        echo "Bem-vindo a API do Sistema de Clientes";
    });
    # Função para obter dados da tabela 'cliente'...
    $app->get('/clientes',function(){
        # Variável que irá ser o retorno (pacote JSON)...
        $retorno = array();
        # Abrir conexão com banco de dados...
        $conexao = new MySQLi("SERVIDOR","USUARIO_SERVIDOR","SENHA_DO_USUARIO","BANCO_DE_DADOS");
        # Validar se houve conexão...
        if(!$conexao){ echo "Não foi possível se conectar ao banco de dados"; exit;}
        # Selecionar todos os cadastros da tabela 'cliente'...
        $registros = $conexao->query("select * from cliente");
        # Transformando resultset em array, caso ache registros...
        if($registros->num_rows>0){
            while($cliente = $registros->fetch_array(MYSQL_BOTH)) {
                $registro = array(
                            "CODIGO"   => $cliente["CODIGO"],
                            "NOME"     => utf8_encode($cliente["NOME"]),
                            "TELEFONE" => $cliente["TELEFONE"],
                            "EMAIL"    => $cliente["EMAIL"],
                        );
                $retorno[] = $registro;
            }
        }
        # Encerrar conexão...
        $conexao->close();
        # Retornando o pacote (JSON)...
        $retorno = json_encode($retorno);
        echo $retorno;
    });
    # Executar a API (deixá-la acessível)...
    $app->run();
    ?>
In time, for the full functioning of these methods, we need to create and include one more file in the api folder. So create a new file in Notepad++, save it as . htaccess and enter the following source code:
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
							
							
						 
You can’t find a library for that or you have one but you can’t get it to work?
– Sergio
I have the API working, I’m not and I can connect the API to admin-on-Rest, it can’t get the infection
– João Gorgulho