Register or update credentials
curl --request POST \
--url https://crawler.prod.judit.io/credentials \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"credentials": [
{
"credential": {
"system_name": "PJE TJBA - 1º grau",
"customer_key": "00000001",
"username": "999.999.999-99",
"password": "Senha123"
}
}
]
}
'import requests
url = "https://crawler.prod.judit.io/credentials"
payload = { "credentials": [{ "credential": {
"system_name": "PJE TJBA - 1º grau",
"customer_key": "00000001",
"username": "999.999.999-99",
"password": "Senha123"
} }] }
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
credentials: [
{
credential: {
system_name: 'PJE TJBA - 1º grau',
customer_key: '00000001',
username: '999.999.999-99',
password: 'Senha123'
}
}
]
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'credentials' => [
[
'credential' => [
'system_name' => 'PJE TJBA - 1º grau',
'customer_key' => '00000001',
'username' => '999.999.999-99',
'password' => 'Senha123'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://crawler.prod.judit.io/credentials"
payload := strings.NewReader("{\n \"credentials\": [\n {\n \"credential\": {\n \"system_name\": \"PJE TJBA - 1º grau\",\n \"customer_key\": \"00000001\",\n \"username\": \"999.999.999-99\",\n \"password\": \"Senha123\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://crawler.prod.judit.io/credentials")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"credentials\": [\n {\n \"credential\": {\n \"system_name\": \"PJE TJBA - 1º grau\",\n \"customer_key\": \"00000001\",\n \"username\": \"999.999.999-99\",\n \"password\": \"Senha123\"\n }\n }\n ]\n}")
.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::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentials\": [\n {\n \"credential\": {\n \"system_name\": \"PJE TJBA - 1º grau\",\n \"customer_key\": \"00000001\",\n \"username\": \"999.999.999-99\",\n \"password\": \"Senha123\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"system_name": "PJEINTER TJBA - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJMT - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJBA - 2º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJEINTER TJMT - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PROJUDI TJBA - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJBA - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJMT - 2º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PROJUDI TJBA - 2º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
}
]
Cofre de Credenciais
Cadastro de Credenciais
Para cadastrar uma credencial ou atualizar uma já existente, utilize a rota abaixo.
POST
/
credentials
Register or update credentials
curl --request POST \
--url https://crawler.prod.judit.io/credentials \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"credentials": [
{
"credential": {
"system_name": "PJE TJBA - 1º grau",
"customer_key": "00000001",
"username": "999.999.999-99",
"password": "Senha123"
}
}
]
}
'import requests
url = "https://crawler.prod.judit.io/credentials"
payload = { "credentials": [{ "credential": {
"system_name": "PJE TJBA - 1º grau",
"customer_key": "00000001",
"username": "999.999.999-99",
"password": "Senha123"
} }] }
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
credentials: [
{
credential: {
system_name: 'PJE TJBA - 1º grau',
customer_key: '00000001',
username: '999.999.999-99',
password: 'Senha123'
}
}
]
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'credentials' => [
[
'credential' => [
'system_name' => 'PJE TJBA - 1º grau',
'customer_key' => '00000001',
'username' => '999.999.999-99',
'password' => 'Senha123'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://crawler.prod.judit.io/credentials"
payload := strings.NewReader("{\n \"credentials\": [\n {\n \"credential\": {\n \"system_name\": \"PJE TJBA - 1º grau\",\n \"customer_key\": \"00000001\",\n \"username\": \"999.999.999-99\",\n \"password\": \"Senha123\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://crawler.prod.judit.io/credentials")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"credentials\": [\n {\n \"credential\": {\n \"system_name\": \"PJE TJBA - 1º grau\",\n \"customer_key\": \"00000001\",\n \"username\": \"999.999.999-99\",\n \"password\": \"Senha123\"\n }\n }\n ]\n}")
.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::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentials\": [\n {\n \"credential\": {\n \"system_name\": \"PJE TJBA - 1º grau\",\n \"customer_key\": \"00000001\",\n \"username\": \"999.999.999-99\",\n \"password\": \"Senha123\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"system_name": "PJEINTER TJBA - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJMT - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJBA - 2º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJEINTER TJMT - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PROJUDI TJBA - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJBA - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJMT - 2º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PROJUDI TJBA - 2º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
}
]
array
Notas importantes sobre o cadastro de credenciais
Notas importantes sobre o cadastro de credenciais
Credencial Wildcard: *Se você cadastrar uma credencial sob o wildcard, todo tribunal que não tenha uma credencial específica usará a credencial wildcard.Se nenhuma customer_key for informada, será criada uma customer_key vazia.username e password vazios.
[
{
"system_name": "PJEINTER TJBA - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJMT - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJBA - 2º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJEINTER TJMT - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PROJUDI TJBA - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJBA - 1º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PJE TJMT - 2º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
},
{
"system_name": "PROJUDI TJBA - 2º grau",
"customer_key": "00000001",
"message": "CREDENTIAL_CREATED"
}
]
CREDENTIAL_UPDATED.Autorizações
API key for authentication
Corpo
application/json
Show child attributes
Show child attributes
Esta página foi útil?
⌘I