Skip to content

WS613 - Export Document report

This integration aims to export the Comprovei Documents report

Authentication

  • Calls will have transport-level authentication (Basic Authentication);
  • Request user / password from the account administrator.

Features

  • URL

    <https://console-api.comprovei.com/exports/documentSAC>

  • Method:

    POST

  • URL parameter:

    No parameters

  • Example:

    {
        "headers": {
            "username": "usuario",
            "password": "senha"
        },
        "body": {
            "formato_exportacao" : "xml",
            "filtros": {
                "data_inicial": "2020-01-01",
                "data_final": "2020-01-01",
                "data_emissao_inicial": "2020-01-01",
                "data_emissao_final": "2020-01-01",
                "data_rota_inicial": "2020-01-01",
                "data_rota_final": "2020-01-01",
                "excluir_transbordos": false,
                "regioes": ["int", "int2"],
                "embarcadores": ["String","String2"],
                "transportadoras": ["String","String2"],
            },
            "campos":[
                "Documento",
                "Emissão",
                "CNPJ Embarcador",
                "Embarcador",
                "Região",
                "Modelo",
                "CNPJ Cliente",
                "Código Cliente",
                "Código Int Cliente",
                "Tipo",
                "Cliente",
                "Cidade Destino",
                "UF Destino",
                "Data Finalização",
                "Ultima Ocorrência",
                "Status",
                "Data Pagamento",
                "Data Agendamento",
                "Qtd Reentregas",
                "Qtd Paradas",
                "Chave",
                "Valor",
                "Volume",
                "Qtd volumes",
                "Conferidos",
                "Rota/Roteiro",
                "Motorista",
                "Cód. Motorista",
                "Placa",
                "Data da rota",
                "Transportadora",
                "CNPJ Transp.",
                "Data Últ. Ocorr.",
                "Gerente Cód.",
                "Gerente Nome",
                "Gerente Email",
                "Gerente Tel.",
                "Supervisor Cód.",
                "Supervisor Nome",
                "Supervisor Email",
                "Supervisor Tel.",
                "Gerente Sênior Cód.",
                "Gerente Sênior Nome",
                "Gerente Sênior Email",
                "Gerente Sênior Tel.",
                "Vendedor Cód.",
                "Vendedor Nome",
                "Vendedor Email",
                "Vendedor Tel.",
                "Pedido",
                "Base Origem",
                "Base Destino",
                "Prazo SLA",
                "Status SLA",
                "Tipo de Frete",
                "Modal",
                "Data Atualização",
                "AWB",
                "Remessa",
                "Possui Foto",
                "Performance SLA",
                "Justificativa",
                "Acatado",
                "Comentário da Justificativa",
                "Chegada Cliente",
                "Ajuste Manual",
                "Horario Ajuste Manual",
                "Usuário Ajuste Manual",
                "Código IBGE Cidade",
                "BU",
                "CFOP",
                "Campo Livre 1",
                "Campo Livre 2",
                "Campo Livre 3",
                "Campo Livre 4",
                "Campo Livre 5",
                "Email SLA Atrasado",
                "Serie",
                "Peso",
                "Endereco",
                "Bairro",
                "Estado",
                "CEP",
                "País",
                "Prazo de Entrega",
                "Cliente Email",
                "Regional",
                "Tipo Parada",
                "regiaoUF",
                "Grupo transportadora",
                "Previsão de Entrega",
                "Data de Integração",
                "Baixa Terceiros",
                "Anotações",
                "Tracking",
                "Horário Início Planejado Rota",
                "Horário Início Rota",
                "Horário Finalização Planejada Rota",
                "Horário Finalização Rota",
                "Tempo Permanência Cliente",
                "Tempo Viagem",
                "Tempo Viagem e Permanência",
                "Latitude Chegada Cliente",
                "Longitude Chegada Cliente"
            ],
            "campos_inclusos": [
                "Documento",
                "Emissão",
                "CNPJ Embarcador",
                "Embarcador",
                "Região"
            ]
        }
    }
    

    Important

    • "fields" is used to define the names of the fields that should be used in the export. No fields should be added or removed, just changed.
    • The "fields" field must not have its order changed, however the name of the fields can be changed for export.
    • If the "fields" and "included_fields" fields are not passed, the system default determined by the support team will be used.
    • Some fields will not be sent by default because they require a lot of processing, even when passed in the parameters, due to the high level of processing required. If the field is really necessary, contact support to have it released to your user in question.
    • In "included_fields" it is possible to select which fields and in what order they will be exported, the field names must be the same as the "fields" field. If you want to export all fields, do not add "included_fields".
    • In "formato_exportação" it is possible to select which export model, the following are accepted: xml, xls, json and csv;

    Response Example

    • Success:
      {
          "statusCode": 200,
          "headers": {
              "Content-Type": "application/json",
              "Access-Control-Allow-Origin": "*",
              "Access-Control-Allow-Credentials": true
          },
          "body": {
              "user_message": "https://comprovei.s3.amazonaws.com/producao/report_requests/export/21/routeExport-20200525192526.csv.zip?  X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJELIIV2RATTMVK7A%2F20200525%2Fus-east-1%2Fs3%2Faws4_request&    X-Amz-Date=20200525T192538Z&X-Amz-Expires=259200&   X-Amz-Signature=19d54276cff1a3f1e074bac3e5f7737d670030f5bfb8267fbfebeb335a2dfca4&X-Amz-SignedHeaders=host",
              "code": 0,
              "internal_message": "Exportação gerada com sucesso!",
              "response_data": ""
          }
      }
      
    • Error:

      {
          "statusCode": 400,
          "headers": {
              "Content-Type": "application/json",
              "Access-Control-Allow-Origin": "*",
              "Access-Control-Allow-Credentials": true
          },
          "body": {
              "message": "Não foram encontrados resultados para os filtros selecionados!"
          }
      }
      

    • Error:

      {
          "statusCode": 400,
          "headers": {
              "Content-Type": "application/json",
              "Access-Control-Allow-Origin": "*",
              "Access-Control-Allow-Credentials": true
          },
          "body": {
              "message": "Algum campo de data está no formato errado. Tente (aaaa-mm-dd)"
          }
      }
      
      • Error:
        {
            "statusCode": 400,
            "headers": {
                "Content-Type": "application/json",
                "Access-Control-Allow-Origin": "*",
                "Access-Control-Allow-Credentials": true
            },
            "body": {
                "message": "O intervalo de datas não pode ter mais de 31 dias"
            }
        }