### Install Project Dependencies Source: https://docs.pdpj.jus.br/servicos-negociais/pangeabnp Install all project dependencies using pip from the requirements.txt file. ```bash pip install -r requirements.txt ``` -------------------------------- ### Install and Serve Frontend Locally Source: https://docs.pdpj.jus.br/servicos-negociais/pangeabnp Installs project dependencies and serves the Angular frontend application locally. Access the application via http://localhost:4200. ```bash npm install ng serve ``` -------------------------------- ### Successful GET Request - Processo Cabecalho Source: https://docs.pdpj.jus.br/desenvolvendo-para-a-pdpj/padroes-de-api Example of a successful response for a GET request retrieving the header of a specific process. The result is an object containing detailed process information. ```json { "status": "ok", "code": "200", "messages": [], "result": { "id": 789, "numero": "0001234-56.2018.2.00.0000", "classe": 10, "assuntos": [12, 34], "partes": "FULANO x CICRANO", "valor-da-causa": 34.678,90, "segredo-de-justica": false, "justica-gratuita": false, "pedido-de-liminar": "false" } } ``` -------------------------------- ### Basic GET Request with MNI Client Source: https://docs.pdpj.jus.br/assets/files/exemplo-requisicao-mni-client-7592b553de4bf1f920f58a035e2b0b8d.json Demonstrates a simple GET request using the MNI client. Ensure the client is properly initialized before use. ```javascript const mniClient = require('mni-client'); mniClient.get('/some/resource') .then(response => { console.log('Success:', response.data); }) .catch(error => { console.error('Error:', error); }); ``` -------------------------------- ### Call SISBAJUD API with Access Token Source: https://docs.pdpj.jus.br/servicos-negociais/sisbajud Example of making a GET request to the SISBAJUD API using an obtained access token in the Authorization header. ```bash curl --location --request GET 'https://sisbajudh.cnj.jus.br/v1/delegacao-protocolizacao/ativa/juiz?cpfAssessor=94205574487' \ --header 'Authorization: Bearer eyJhbGciOiJSUzI1...' ``` -------------------------------- ### MNI Client PUT Request Example Source: https://docs.pdpj.jus.br/assets/files/exemplo-requisicao-mni-client-7592b553de4bf1f920f58a035e2b0b8d.json Demonstrates how to perform a PUT request to update a resource using the MNI client. This example sends JSON data. ```javascript var t = require("mni-client"); var e = { url: "/api/v1/users/123", method: "PUT", headers: { "Content-Type": "application/json" }, data: { name: "Jane Doe", age: "31" } }; t.request(e, function(t, n, r) { console.log(t); console.log(n); console.log(r); }); ``` -------------------------------- ### Pet Initial Payload Example Source: https://docs.pdpj.jus.br/servicos-negociais/portal-servicos/pet-inicial This is an example of the complete JSON payload for the Pet Initial service. It includes protocol information, a list of documents with their metadata, and basic case details. ```json { "protocolo": "20255000000000024", "documentos": [ { "id": 2661, "ordem": 0, "idDocumentoPai": null, "urlConteudo": "https://repositorio.stg.pdpj.jus.br/portal?hash=e3875eaa8286b863d677f1d230b8cc264c9f4138", "tipoDocumento": { "codigo": "5273", "descricao": "Carta de Sentença" }, "dataHora": "01/10/2025 10:44:32", "nome": "protocoloPeticao_20255000000000005.pdf", "descricao": "Minha petição inicial", "mimeType": "application/pdf", "principal": true, "nivelSigilo": 1, "tamanho": 100097, "hash": "e3875eaa8286b863d677f1d230b8cc264c9f4138", "cadeiaCertificado": "", "assinatura": "" }, { "id": 2662, "ordem": 1, "idDocumentoPai": null, "urlConteudo": "https://repositorio.stg.pdpj.jus.br/portal?hash=b43e4a49b29cc637049e938e7d3ae49fd2f44801", "tipoDocumento": { "codigo": "5251", "descricao": "ANEXO Carta de Arrematação" }, "dataHora": "01/10/2025 10:44:32", "nome": "protocoloPeticao_20254000000004289 (1).pdf", "descricao": "Carta arrematação", "mimeType": "application/pdf", "principal": false, "nivelSigilo": 1, "tamanho": 96098, "hash": "b43e4a49b29cc637049e938e7d3ae49fd2f44801", "cadeiaCertificado": "", "assinatura": "" }, { "id": 2663, "ordem": 2, "idDocumentoPai": null, "urlConteudo": "https://repositorio.stg.pdpj.jus.br/portal?hash=60A1C987F7B3975B9B5E4BD24ED3A75590C6B12B", "tipoDocumento": { "codigo": "0", "descricao": "Recibo CNJ" }, "dataHora": "01/10/2025 10:44:44", "nome": "recibo_peticao_nº2025-5-00000000002414641333181379896335.pdf", "descricao": "Recibo CNJ", "mimeType": "application/pdf", "principal": false, "nivelSigilo": 1, "tamanho": 101662, "hash": "60A1C987F7B3975B9B5E4BD24ED3A75590C6B12B", "cadeiaCertificado": "", "assinatura": "" } ], "dataEnvio": "01/10/2025 10:44:42", "numeroProcesso": null, "idAvisoExpediente": null, "cpfPeticionante": "12345678900", "nomePeticionante": "FABRIZIO MORELO TEIXEIRA", "tipoPeticao": "5", "idOrigemTipoDocumento": 2, "idDjen": null, "dadosComplementares": null, "idOrigemTramitacao": null, "dataProtocolo": "2025-10-01T10:44:42.477597", "dadosBasicos": { "numeroProcesso": null, "classeProcessual": 241, "codigoLocalidade": 19, "competencia": 7, "processoVinculado": null, "processoVinculadoTramitacaoOrigemId": null, "modalidadeVinculacaoProcesso": null, "valorCausa": 1520.0, "nivelSigilo": 1, "dataAjuizamento": "2025-10-01T10:44:42.484087", "assistenciaJudiciaria": true, "pedidoLiminarAntecipacaoTutela": true, "assuntos": [ { "principal": false, "codigoNacional": 4438, "assuntoLocal": null, "assuntoLocalPai": null, "codigoAssunto": 4438, "codigoPaiNacional": null, "descricao": "/DIREITO DO TRABALHO/Direito Coletivo do Trabalho/Anulação" }, { "principal": true, "codigoNacional": 4654, "assuntoLocal": null, "assuntoLocalPai": null, "codigoAssunto": 4654, "codigoPaiNacional": null, "descricao": "/DIREITO CIVIL/Coisas/Propriedade/Propriedade Intelectual - Industrial" }, { "principal": false, "codigoNacional": 4656, "assuntoLocal": null, "assuntoLocalPai": null, "codigoAssunto": 4656, "codigoPaiNacional": null, "descricao": "/DIREITO CIVIL/Coisas/Propriedade/Propriedade Intelectual - Industrial/Direito Autoral" } ], "polo": [ { "partes": [ { "id": "82", "nome": "DIRECAO GERAL", "numeroDocumentoPrincipal": "00000000000191", "tipoPessoa": "JURIDICA", "documento": { "codigoDocumento": "00000000000191", "emissorDocumento": null, "tipoDocumento": "CMF", "nome": "DIRECAO GERAL" }, "cidadeNatural": null, "estadoNatural": null, "nacionalidade": null, "enderecos": [ { "cep": "71592048", "logradouro": "Quadra 402 Conjunto 2", "numero": "55", "complemento": "", "bairro": "Itapoã Parque (Itapoã)", "cidade": "Brasília", "estado": "DF", "pais": "Brasil", "principal": true } ] } ] } ] } } ``` -------------------------------- ### Basic GET Request Source: https://docs.pdpj.jus.br/assets/files/exemplo-requisicao-mni-client-7592b553de4bf1f920f58a035e2b0b8d.json Demonstrates a simple GET request to fetch data from a specified endpoint. Ensure the client is properly initialized before making requests. ```javascript const mniClient = new MNIClient(); mniClient.get("/users").then(response => { console.log(response.data); }).catch(error => { console.error("Error fetching users:", error); }); ``` -------------------------------- ### Build and Run Frontend in Container Source: https://docs.pdpj.jus.br/servicos-negociais/pangeabnp Builds a Docker image for the Pangea/BNP frontend and runs it as a container. The application will be accessible at http://localhost:4200. ```bash docker build -t pangea-frontend-bnp . docker run -p 4200:80 -d pangea-frontend-bnp ``` -------------------------------- ### Successful GET Request - List of Orgaos Julgadores Source: https://docs.pdpj.jus.br/desenvolvendo-para-a-pdpj/padroes-de-api Example of a successful response for a GET request returning a list of 'orgaos julgadores'. Includes status, code, empty messages, and a result array. ```json { "status": "ok", "code": "200", "messages": [], "result": [ { "id": "1", "nome": "GAB. DESEMB. FULANO DE TAL", "ativo": "true" }, { "id": "2", "nome": "GAB. DESEMB. CICRANO DE TAL", "ativo": "true" } ] } ``` -------------------------------- ### Successful GET Request with Pagination Source: https://docs.pdpj.jus.br/desenvolvendo-para-a-pdpj/padroes-de-api Example of a successful response for a GET request that includes pagination information. The 'page-info' object details the current page, last page, page size, and total count. ```json { "status": "ok", "code": "200", "messages": [], "result": [ { "id": "1", "nome": "GAB. DESEMB. FULANO DE TAL", "ativo": "true" }, { "id": "2", "nome": "GAB. DESEMB. CICRANO DE TAL", "ativo": "true" } ], "page-info": { "current": 1, "last": 10, "size": 2, "count": 20, } } ``` -------------------------------- ### Create and Activate Python Virtual Environment Source: https://docs.pdpj.jus.br/servicos-negociais/pangeabnp Create a virtual environment in the project's root directory and activate it before installing dependencies. ```bash python3 -m venv .venv source .venv/bin/activate ``` -------------------------------- ### Unsuccessful GET Request - Forbidden Access Source: https://docs.pdpj.jus.br/desenvolvendo-para-a-pdpj/padroes-de-api Example of an unsuccessful response for a GET request where the user lacks permission to view a process. Returns an error status, 403 code, and a permission denied message. ```json { "status": "error", "code": "403", "messages": [ "Sem permissão para visualizar o processo" ], "result": {} } ``` -------------------------------- ### Vanilla JS: Importando e utilizando o componente Source: https://docs.pdpj.jus.br/servicos-estruturantes/avisos-pdpj/guia-tecnico-web-compomet-avisos No HTML, importe o script do componente e utilize a tag `` diretamente. Atributos como `access-token` e `sigla-sistema` podem ser definidos no HTML. ```html PdpjSistemaNotificacao

HTML de teste

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text.

``` -------------------------------- ### Instalar Web Component Avisos PDPJ Source: https://docs.pdpj.jus.br/servicos-estruturantes/avisos-pdpj/guia-tecnico-web-compomet-avisos Baixe o componente mais recente via NPM para desenvolvimento. ```bash npm i --save-dev @cnj/pdpj-sistema-aviso@latest ``` -------------------------------- ### Simple Filter Example Source: https://docs.pdpj.jus.br/desenvolvendo-para-a-pdpj/padroes-de-api Use for basic key-value filtering in GET requests. The key is the attribute to search. ```HTTP /processos?simpleFilter={"numero":"00012345620182000000"} ``` -------------------------------- ### API Call with Service Token Source: https://docs.pdpj.jus.br/servicos-negociais/sisbajud Example of making a GET request to the SISBAJUD API using an obtained service access token. ```APIDOC ## API Call with Service Token ### Description This example demonstrates how to make a GET request to the SISBAJUD API after obtaining an access token. The token should be included in the `Authorization` header as a Bearer token. ### Method GET ### Endpoint `https://sisbajudh.cnj.jus.br/v1/delegacao-protocolizacao/ativa/juiz?cpfAssessor=94205574487` ### Parameters #### Query Parameters - **cpfAssessor** (string) - Required - The CPF of the assessor. #### Headers - **Authorization** (string) - Required - Bearer token obtained from the SSO service. Example: `Bearer eyJhbGciOiJSUzI1...` ### Request Example ```curl curl --location --request GET 'https://sisbajudh.cnj.jus.br/v1/delegacao-protocolizacao/ativa/juiz?cpfAssessor=94205574487' \ --header 'Authorization: Bearer eyJhbGciOiJSUzI1...' ``` ``` -------------------------------- ### Adicionar Dependência Spring Boot Starter AMQP Source: https://docs.pdpj.jus.br/servicos-estruturantes/mensageria Inclua esta dependência no seu arquivo POM.XML para habilitar a integração com RabbitMQ usando Spring Boot. ```xml org.springframework.boot spring-boot-starter-amqp ``` -------------------------------- ### Retrieve Petition Details Source: https://docs.pdpj.jus.br/servicos-negociais/portal-servicos/pet-intercorrente Example GET request to retrieve petition and document metadata from the Service Portal. This is typically called after receiving a notification. ```http GET https://portalexterno-tribunais.stg.pdpj.jus.br/api/v1/peticoes/por-protocolo/20241000000001234 ``` -------------------------------- ### Run Local Project (Job) Source: https://docs.pdpj.jus.br/servicos-negociais/pangeabnp Run the Pangea BNP job locally after setting up the virtual environment and installing dependencies. ```bash python3 main.py ``` -------------------------------- ### MNI Client Request with Specific Parameters Source: https://docs.pdpj.jus.br/assets/files/exemplo-requisicao-mni-client-7592b553de4bf1f920f58a035e2b0b8d.json This example demonstrates making a request with more specific parameters, such as a gateway and a direct path. It's useful when you need to control the request routing. ```javascript import { MniClient } from "@mni/client"; const client = new MniClient({ // Configuration options }); async function makeSpecificRequest() { try { const response = await client.request({ gateway: "some-gateway", path: "/some/path", // Other parameters }); console.log(response); } catch (error) { console.error(error); } } makeSpecificRequest(); ``` -------------------------------- ### SAREF Bucket Policy Example Source: https://docs.pdpj.jus.br/servicos-negociais/saref Example of a bucket policy for SAREF, defining permissions for S3 object operations. ```json { "Version": "2012-10-17", "Statement": [ { "Sid": "Politica de permissões do bucket do SAREF.", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:ListBucket", "s3:DeleteObject" ], "Resource": [ "arn:aws:s3:::saref-stg/*" ] }, { "Sid": "Para atender a requisição do GetBucketLocation no endereço do bucket SAREF.", "Effect": "Allow", "Action": [ "s3:GetBucketLocation" ], "Resource": [ "arn:aws:s3:::saref-stg" ] } ] } ``` -------------------------------- ### Build and Run Backend BNP in Docker Source: https://docs.pdpj.jus.br/servicos-negociais/pangeabnp Build a Docker image for the backend BNP and run it as a container. The API will be available at http://localhost:5000/. ```bash docker build -t pangea-backend-bnp . docker run -p 5000:5000 -d pangea-backend-bnp ``` -------------------------------- ### Basic GET Request Source: https://docs.pdpj.jus.br/assets/files/exemplo-requisicao-mni-client-7592b553de4bf1f920f58a035e2b0b8d.json Demonstrates a simple GET request to retrieve data. Ensure the MNI client is properly initialized before use. ```javascript mniClient.get("/api/data").then(response => { console.log(response.data); }); ``` -------------------------------- ### Run Local Project (Backend BNP) Source: https://docs.pdpj.jus.br/servicos-negociais/pangeabnp Run the backend BNP API locally. The API will be available at http://localhost:5000/. ```bash python3 wsgi.py ```