List credential status by system
curl --request GET \
--url https://crawler.prod.judit.io/credentials \
--header 'api-key: <api-key>'import requests
url = "https://crawler.prod.judit.io/credentials"
headers = {"api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'api-key': '<api-key>'}};
fetch('https://crawler.prod.judit.io/credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://crawler.prod.judit.io/credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://crawler.prod.judit.io/credentials"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://crawler.prod.judit.io/credentials")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://crawler.prod.judit.io/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"systems": [
{
"name": "*",
"customer_key": "",
"credential_status": "not exists"
},
{
"name": "EPROC - JFES - 1º grau",
"customer_key": "*",
"credential_status": "not exists"
},
{
"name": "PJE TJBA - 1º grau",
"customer_key": "*",
"credential_status": "active"
},
{
"name": "PJE TRF1 - 2º grau",
"customer_key": "*",
"credential_status": "not exists"
}
]
}
{
"systems": [
{
"name": "*",
"customer_key": "advogado_01",
"credential_status": "active"
},
{
"name": "PJE TJBA - 1º grau",
"customer_key": "advogado_01",
"credential_status": "active"
}
]
}
Cofre de Credenciais
Consulta de Sistemas e Credenciais
Liste os sistemas disponíveis no Cofre, com o system_name exato para usar no cadastro, e confira o status das credenciais de uma customer_key. Este endpoint não cadastra credenciais.
GET
/
credentials
List credential status by system
curl --request GET \
--url https://crawler.prod.judit.io/credentials \
--header 'api-key: <api-key>'import requests
url = "https://crawler.prod.judit.io/credentials"
headers = {"api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'api-key': '<api-key>'}};
fetch('https://crawler.prod.judit.io/credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://crawler.prod.judit.io/credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://crawler.prod.judit.io/credentials"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://crawler.prod.judit.io/credentials")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://crawler.prod.judit.io/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"systems": [
{
"name": "*",
"customer_key": "",
"credential_status": "not exists"
},
{
"name": "EPROC - JFES - 1º grau",
"customer_key": "*",
"credential_status": "not exists"
},
{
"name": "PJE TJBA - 1º grau",
"customer_key": "*",
"credential_status": "active"
},
{
"name": "PJE TRF1 - 2º grau",
"customer_key": "*",
"credential_status": "not exists"
}
]
}
{
"systems": [
{
"name": "*",
"customer_key": "advogado_01",
"credential_status": "active"
},
{
"name": "PJE TJBA - 1º grau",
"customer_key": "advogado_01",
"credential_status": "active"
}
]
}
{
"systems": [
{
"name": "*",
"customer_key": "",
"credential_status": "not exists"
},
{
"name": "EPROC - JFES - 1º grau",
"customer_key": "*",
"credential_status": "not exists"
},
{
"name": "PJE TJBA - 1º grau",
"customer_key": "*",
"credential_status": "active"
},
{
"name": "PJE TRF1 - 2º grau",
"customer_key": "*",
"credential_status": "not exists"
}
]
}
{
"systems": [
{
"name": "*",
"customer_key": "advogado_01",
"credential_status": "active"
},
{
"name": "PJE TJBA - 1º grau",
"customer_key": "advogado_01",
"credential_status": "active"
}
]
}
Tipos de Status das Credenciais
Tipos de Status das Credenciais
credential_status pode ser:
not exists: Não cadastradaactive: Cadastrada e ativainactive: A credencial falhou no login do tribunal (senha inválida ou expirada, usuário bloqueado ou certificado vencido). Revalide o login no portal do tribunal e cadastre a credencial novamente para voltar a active.Caso seja utilizado um cadastro no sistema * (cadastro genérico), essa credencial será utilizada para todos os tribunais que não tenham outro cadastro na mesma customer_key, então cuidado com esse tipo de cadastro.customer_key (ou com ?customer_key=*), a resposta lista todos os sistemas disponíveis no Cofre, com o status de cada um na chave padrão * (use essa lista para copiar o system_name exato). O exemplo acima está resumido. Como ler o exemplo sem customer_key:
- Linha
"name": "*"com"customer_key": "": é a credencial coringa da chave padrão. Ocustomer_keyvem vazio porque não há coringa cadastrada nessa chave (not exists). Quando há, ele vem preenchido. - Demais linhas com
"customer_key": "*": a API repete a chave padrão usada no filtro, mesmo quando o status énot exists. Esse*não é uma credencial coringa cadastrada.
?customer_key=..., a linha "name": "*" é a coringa dessa chave e as demais linhas são apenas os sistemas com credencial própria nela. Se nenhuma customer_key for informada no cadastro, é usado o valor padrão *; a chave padrão nunca é vazia.Esta página foi útil?