INTERPRETA - Exemplo de Integração PHP

class jusapi{

    function connect($funcao,$publicação){
        $token="coloque aqui o seu token";
        $post=[
            'token'=> $token,
            'metodo'=> $funcao,
            'argumentos'=> $publicacao
        ];
        $ch=curl_init('https://jusapi.com.br/restApi/jusapi.php');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
        $response=curl_exec($ch);
        if($response===false)
        {
            return 'Curl error: ' . curl_error($ch);
        }
        else
        {
            return json_decode($response);
        }
        curl_close($ch);
    }

    function scraperAudiencia($publicacao){
        return $this->connect('scraperAudiencia',$publicacao);
    }

    function getInterpretacao($publicacao){
        return $this->connect('processaIa',$publicacao);
    }

    function getOpcoesPorPerguntaId($perguntaid){
        return $this->connect('getOpcoesPorPerguntaId',$perguntaid);
    }