Ir para o conteúdo

Cenários Autentica Procurador

IMPORTANTE

A chamada da API Trial é apenas para demonstração. As APIs disponíveis e suas respectivas URLs (endpoints) para consumo são disponibilizadas (através da documentação dos seus respectivos swaggers) na seção Referência da API.

Na chamada da API Trial o parâmetro do tipo header jwt_token não é obrigatório, apenas no contexto real de produção esse parâmetro é obrigatório. Saiba mais sobre o jwt_token na seção Como Autenticar na API.

Envio de XML assinado com o Termo de Autorização

Essa simulação permite o envio de um documento XML assinado digitalmente pelo Autor Pedido de Dados (Procurador) para receber um TOKEN de autorização que permite o Contratante realizar as requisições em nome do Autor Pedido de Dados.

Informação

Nesta simulação é possível decodificar o conteúdo XML que está deve ser enviado como base64. O XML contém dados apenas para simulação.

header valor
jwt_token vazio (não precisa preencher)
autenticar_procurador_token vazio (não precisa preencher)

Body:

{
    "contratante": {
        "numero": "99999999999999",
        "tipo": 2
    },
    "autorPedidoDados": {
       "numero": "00000000000000",
       "tipo": 2
    },
    "contribuinte": {
       "numero": "11111111111111",
       "tipo": 2
    },
    "pedidoDados": {
        "idSistema": "AUTENTICAPROCURADOR",
        "idServico": "ENVIOXMLASSINADO81",
        "versaoSistema": "1.0",
        "dados": "{\"xml\": \"PHRlcm1vRGVBdXRvcml6YWNhbz48ZGFkb3M+PHNpc3RlbWEgaWQ9IkFQSSBJbnRlZ3JhIENvbnRhZG9yIiAvPjx0ZXJtbyB0ZXh0bz0iQXV0b3Jpem8gYSBlbXByZXNhIENPTlRSQVRBTlRFLCBpZGVudGlmaWNhZGEgbmVzdGUgdGVybW8gZGUgYXV0b3JpemHDp8OjbyBjb21vIERFU1RJTkFUw4FSSU8sIGEgZXhlY3V0YXIgYXMgcmVxdWlzacOnw7VlcyBkb3Mgc2VydmnDp29zIHdlYiBkaXNwb25pYmlsaXphZG9zIHBlbGEgQVBJIElOVEVHUkEgQ09OVEFET1IsIG9uZGUgdGVyZWkgbyBwYXBlbCBkZSBBVVRPUiBQRURJRE8gREUgREFET1Mgbm8gY29ycG8gZGE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MS9SRUMteG1sLWMxNG4tMjAwMTAzMTUiIC8+PFNpZ25hdHVyZU1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMDQveG1sZHNpZy1tb3JlI3JzYS1zaGEyNTYiIC8+PFJlZmVyZW5jZSBVUkk9IiI+PFRyYW5zZm9ybXM+PFRyYW5zZm9ybSBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNlbnZlbG9wZWQtc2lnbmF0dXJlIiAvPjxUcmFuc2Zvcm0gQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy14bWwtYzE0bi0yMDAxMDMxNSIgLz48L1RyYW5zZm9ybXM+PERpZ2VzdE1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMDQveG1sZW5jI3NoYTI1NiIgLz48RGlnZXN0VmFsdWU+QUJDLi5zWEE9PC9EaWdlc3RWYWx1ZT48L1JlZmVyZW5jZT48L1NpZ25lZEluZm8+PFNpZ25hdHVyZVZhbHVlPlZ2ZksuLkhIaD09PC9TaWduYXR1cmVWYWx1ZT48S2V5SW5mbz48WDUwOURhdGE+PFg1MDlDZXJ0aWZpY2F0ZT5BQkNBd0lCLi4uaGhoPT08L1g1MDlDZXJ0aWZpY2F0ZT48L1g1MDlEYXRhPjwvS2V5SW5mbz48L1NpZ25hdHVyZT48L3Rlcm1vRGVBdXRvcml6YWNhbz4=\"}"
    }
}

Curl:

curl -X 'POST' \
  'https://gateway.apiserpro.serpro.gov.br/integra-contador-trial/v1/Apoiar' \
  -H 'accept: text/plain' \
  -H "Authorization: Bearer 06aef429-a981-3ec5-a1f8-71d38d86481e" \
  -H 'Content-Type: application/json' \
  -d '{
    "contratante": {
        "numero": "99999999999999",
        "tipo": 2
    },
    "autorPedidoDados": {
       "numero": "00000000000000",
       "tipo": 2
    },
    "contribuinte": {
       "numero": "11111111111111",
       "tipo": 2
    },
    "pedidoDados": {
        "idSistema": "AUTENTICAPROCURADOR",
        "idServico": "ENVIOXMLASSINADO81",
        "versaoSistema": "1.0",
        "dados": "{\"xml\": \"PHRlcm1vRGVBdXRvcml6YWNhbz48ZGFkb3M+PHNpc3RlbWEgaWQ9IkFQSSBJbnRlZ3JhIENvbnRhZG9yIiAvPjx0ZXJtbyB0ZXh0bz0iQXV0b3Jpem8gYSBlbXByZXNhIENPTlRSQVRBTlRFLCBpZGVudGlmaWNhZGEgbmVzdGUgdGVybW8gZGUgYXV0b3JpemHDp8OjbyBjb21vIERFU1RJTkFUw4FSSU8sIGEgZXhlY3V0YXIgYXMgcmVxdWlzacOnw7VlcyBkb3Mgc2VydmnDp29zIHdlYiBkaXNwb25pYmlsaXphZG9zIHBlbGEgQVBJIElOVEVHUkEgQ09OVEFET1IsIG9uZGUgdGVyZWkgbyBwYXBlbCBkZSBBVVRPUiBQRURJRE8gREUgREFET1Mgbm8gY29ycG8gZGEgbWVuc2FnZW0gZW52aWFkYSBuYSByZXF1aXNpw6fDo28gZG8gc2VydmnDp28gd2ViLiBFc3NlIHRlcm1vIGRlIGF1dG9yaXphw6fDo28gZXN0w6EgYXNzaW5hZG8gZGlnaXRhbG1lbnRlIGNvbSBvIGNlcnRpZmljYWRvIGRpZ2l0YWwgZG8gUFJPQ1VSQURPUiBvdSBPVVRPUkdBRE8gRE8gQ09OVFJJQlVJTlRFIHJlc3BvbnPDoXZlbCwgaWRlbnRpZmljYWRvIGNvbW8gQVVUT1IgRE8gUEVESURPIERFIERBRE9TLiIgLz48YXZpc29MZWdhbCB0ZXh0bz0iTyBhY2Vzc28gYSBlc3RhcyBpbmZvcm1hw6fDtWVzIGZvaSBhdXRvcml6YWRvIHBlbG8gcHLDs3ByaW8gUFJPQ1VSQURPUiBvdSBPVVRPUkdBRE8gRE8gQ09OVFJJQlVJTlRFLCByZXNwb25zw6F2ZWwgcGVsYSBpbmZvcm1hw6fDo28sIHZpYSBhc3NpbmF0dXJhI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T48L1JlZmVyZW5jZT48L1NpZ25lZEluZm8+PFNpZ25hdHVyZVZhbHVlPlZ2ZksuLkhIaD09PC9TaWduYXR1cmVWYWx1ZT48S2V5SW5mbz48WDUwOURhdGE+PFg1MDlDZXJ0aWZpY2F0ZT5BQkNBd0lCLi4uaGhoPT08L1g1MDlDZXJ0aWZpY2F0ZT48L1g1MDlEYXRhPjwvS2V5SW5mbz48L1NpZ25hdHVyZT48L3Rlcm1vRGVBdXRvcml6YWNhbz4=\"}"
    }
}'

Expirar o token de autenticação do procurador

header valor
jwt_token vazio (não precisa preencher)
autenticar_procurador_token vazio (não precisa preencher)

Body:

{
        "contratante": {
            "numero": "22222222222222",
            "tipo": 2
        },
        "autorPedidoDados": {
           "numero": "00000000000000",
           "tipo": 2
        },
        "contribuinte": {
           "numero": "11111111111111",
           "tipo": 2
        },
        "pedidoDados": {
            "idSistema": "AUTENTICAPROCURADOR",
            "idServico": "EXPIRARAUTORIZACAO82",
            "versaoSistema": "1.0",
            "dados": "{\"token\": \"b06feea3-1ca8-49f4-bdb4-211ab006cb92\"}"
        }
    }

Curl:

curl -X 'POST' \
  'https://gateway.apiserpro.serpro.gov.br/integra-contador-trial/v1/Apoiar' \
  -H 'accept: text/plain' \
  -H "Authorization: Bearer 06aef429-a981-3ec5-a1f8-71d38d86481e" \
  -H 'Content-Type: application/json' \
  -d '{
        "contratante": {
            "numero": "22222222222222",
            "tipo": 2
        },
        "autorPedidoDados": {
           "numero": "00000000000000",
           "tipo": 2
        },
        "contribuinte": {
           "numero": "11111111111111",
           "tipo": 2
        },
        "pedidoDados": {
            "idSistema": "AUTENTICAPROCURADOR",
            "idServico": "EXPIRARAUTORIZACAO82",
            "versaoSistema": "1.0",
            "dados": "{\"token\": \"b06feea3-1ca8-49f4-bdb4-211ab006cb92\"}"
        }
    }'