2.0info: 4.1.1 motoristas description: Serviço de motoristas RMS x-senior-domain: tmsentregas x-senior-domain-path: tmsentregas x-senior-service-path: motoristas contact: name: Senior X Platform url: https://dev.senior.com.br email: seniorx-dev@senior.com.brhost: platform.senior.com.br /t/senior.com.br/bridge/1.0/rest/tmsentregassecurityDefinitions: APIKeyHeader: type: apiKey in: header name: Authorizationsecurity: – APIKeyHeader: [] – application/json – application/jsonpaths: /motoristas/queries/buscaMotoristas: post: description: Pesquisa de Motoristas tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: nrCNPJFilial: type: string description: Código identificador da empresa codigo: type: integer format: int64 description: Código identificador. Caso informado valor menor ou igual a zero, busca todos. dsNome: type: string description: Nome do motorista nrCpf: type: string description: Número CPF do motorista listCod: type: array items: type: integer format: int64 description: Lista de códigos cdUsuario: type: string description: id do usuário na plataforma nrPlaca: type: string description: Verifica qual é o motorista da placa informada. responses: 200: description: Ok schema: type: object required: – listaResultado – ok – dsErro properties: listaResultado: type: array items: type: object allOf: – #/definitions/MCEMOTRec minimum: 1 description: ok: type: boolean description: dsErro: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Pesquisa de Motoristas tags: – Queries x-senior-visibility: PRIVATE parameters: – name: nrCNPJFilial description: Código identificador da empresa in: query type: string – name: codigo description: Código identificador. Caso informado valor menor ou igual a zero, busca todos. in: query type: integer format: int64 – name: dsNome description: Nome do motorista in: query type: string – name: nrCpf description: Número CPF do motorista in: query type: string – name: listCod description: Lista de códigos in: query type: array items: type: integer format: int64 – name: cdUsuario description: id do usuário na plataforma in: query type: string – name: nrPlaca description: Verifica qual é o motorista da placa informada. in: query type: string responses: 200: description: Ok schema: type: object required: – listaResultado – ok – dsErro properties: listaResultado: type: array items: type: object allOf: – #/definitions/MCEMOTRec minimum: 1 description: ok: type: boolean description: dsErro: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/queries/buscaMotoristasDisponiveis: post: description: Verificar se os motoristas já possuem alguma rota associada a eles no período entre a data de início da roteirização até a data final da rota. Caso contrário, é realizada a busca normal de motoristas tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – nrCNPJFilial properties: nrCNPJFilial: type: string description: Código identificador da empresa dtInicialRota: type: string format: date-time description: Data de início da rota dtFinalRota: type: string format: date-time description: Data final da rota nrCpf: type: string description: CPF do motorista responses: 200: description: Ok schema: type: object required: – listaResultado properties: listaResultado: type: array items: type: object allOf: – #/definitions/MCEMOTRec minimum: 1 description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Verificar se os motoristas já possuem alguma rota associada a eles no período entre a data de início da roteirização até a data final da rota. Caso contrário, é realizada a busca normal de motoristas tags: – Queries x-senior-visibility: PRIVATE parameters: – name: nrCNPJFilial description: Código identificador da empresa in: query required: true type: string – name: dtInicialRota description: Data de início da rota in: query type: string format: date-time – name: dtFinalRota description: Data final da rota in: query type: string format: date-time – name: nrCpf description: CPF do motorista in: query type: string responses: 200: description: Ok schema: type: object required: – listaResultado properties: listaResultado: type: array items: type: object allOf: – #/definitions/MCEMOTRec minimum: 1 description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/queries/obtemMotorista: post: description: tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – cdUsuario properties: cdUsuario: type: string description: responses: 200: description: Ok schema: type: object required: – ok – dsErro – motorista properties: ok: type: boolean description: dsErro: type: string description: motorista: type: object allOf: – #/definitions/MCEMOTRec description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: tags: – Queries x-senior-visibility: PRIVATE parameters: – name: cdUsuario description: in: query required: true type: string responses: 200: description: Ok schema: type: object required: – ok – dsErro – motorista properties: ok: type: boolean description: dsErro: type: string description: motorista: type: object allOf: – #/definitions/MCEMOTRec description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/queries/buscaUsuariosSugeridosMotorista: post: description: tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: dsNome: type: string description: Nome do motorista, utilizado para gerar as sugestões. nrCpf: type: string description: CPF do motorista. dsUsuario: type: string description: Valor informado manualmente pelo usuário. responses: 200: description: Ok schema: type: object required: – ok – dsErro – senhaUsuario properties: ok: type: boolean description: dsErro: type: string description: senhaUsuario: type: string description: listaResultado: type: array items: type: object allOf: – #/definitions/usuarioSugeridoMotoristaRec description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: tags: – Queries x-senior-visibility: PRIVATE parameters: – name: dsNome description: Nome do motorista, utilizado para gerar as sugestões. in: query type: string – name: nrCpf description: CPF do motorista. in: query type: string – name: dsUsuario description: Valor informado manualmente pelo usuário. in: query type: string responses: 200: description: Ok schema: type: object required: – ok – dsErro – senhaUsuario properties: ok: type: boolean description: dsErro: type: string description: senhaUsuario: type: string description: listaResultado: type: array items: type: object allOf: – #/definitions/usuarioSugeridoMotoristaRec description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/queries/relatorioMotoristas: post: description: Gera um relatório de rotas tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: filiais: type: array items: type: string description: Lista de CNPJ de filial codigoMotorista: type: integer format: int64 description: Código do Motorista responses: 200: description: Ok schema: type: object required: – urlRelatorio properties: urlRelatorio: type: string description: URL do relatório 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Gera um relatório de rotas tags: – Queries x-senior-visibility: PRIVATE parameters: – name: filiais description: Lista de CNPJ de filial in: query type: array items: type: string – name: codigoMotorista description: Código do Motorista in: query type: integer format: int64 responses: 200: description: Ok schema: type: object required: – urlRelatorio properties: urlRelatorio: type: string description: URL do relatório 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/queries/buscaRelatorioDesempenhoMotorista: post: description: Busa relatório de Desempenho do motorista tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – dataInicio – dataFim properties: filiais: type: array items: type: string description: Lista de CNPJ de filial motorista: type: integer format: int64 description: Código do Motorista placa: type: string description: Placa do veículo dataInicio: type: string format: date-time description: Data de início das Rotas dataFim: type: string format: date-time description: Data final das Rotas offset: type: integer format: int64 description: O número da página retornado. A primeira página corresponde ao índice 0 default: 0 size: type: integer format: int64 description: Quantidade de registros por página default: 10 responses: 200: description: Ok schema: type: object required: – contents properties: contents: type: array items: type: object allOf: – #/definitions/relDesempenhoMotoristaRec minimum: 1 description: Lista das informações referente ao desempenho do motorista totalElements: type: integer format: int64 description: Quantidade total de registros encontrados 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Busa relatório de Desempenho do motorista tags: – Queries x-senior-visibility: PRIVATE parameters: – name: filiais description: Lista de CNPJ de filial in: query type: array items: type: string – name: motorista description: Código do Motorista in: query type: integer format: int64 – name: placa description: Placa do veículo in: query type: string – name: dataInicio description: Data de início das Rotas in: query required: true type: string format: date-time – name: dataFim description: Data final das Rotas in: query required: true type: string format: date-time – name: offset description: O número da página retornado. A primeira página corresponde ao índice 0 in: query type: integer format: int64 – name: size description: Quantidade de registros por página in: query type: integer format: int64 responses: 200: description: Ok schema: type: object required: – contents properties: contents: type: array items: type: object allOf: – #/definitions/relDesempenhoMotoristaRec minimum: 1 description: Lista das informações referente ao desempenho do motorista totalElements: type: integer format: int64 description: Quantidade total de registros encontrados 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/queries/buscaDashboardDesempenhoMotorista: post: description: Busa relatório de Desempenho do motorista tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – dataInicio – dataFim properties: filiais: type: array items: type: string description: Lista de CNPJ de filial motorista: type: integer format: int64 description: Código do Motorista placa: type: string description: Placa do veículo dataInicio: type: string format: date-time description: Data de início das Rotas dataFim: type: string format: date-time description: Data final das Rotas responses: 200: description: Ok schema: type: object required: – dashboardInfo properties: dashboardInfo: type: object allOf: – #/definitions/dashboardDesempenhoRec description: Lista das informações referente ao desempenho do motorista 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Busa relatório de Desempenho do motorista tags: – Queries x-senior-visibility: PRIVATE parameters: – name: filiais description: Lista de CNPJ de filial in: query type: array items: type: string – name: motorista description: Código do Motorista in: query type: integer format: int64 – name: placa description: Placa do veículo in: query type: string – name: dataInicio description: Data de início das Rotas in: query required: true type: string format: date-time – name: dataFim description: Data final das Rotas in: query required: true type: string format: date-time responses: 200: description: Ok schema: type: object required: – dashboardInfo properties: dashboardInfo: type: object allOf: – #/definitions/dashboardDesempenhoRec description: Lista das informações referente ao desempenho do motorista 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/queries/healthcheck: post: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/serviceHealthStatus description: Status do serviço checks: type: array items: type: object allOf: – #/definitions/checkData minimum: 1 description: Verificações para assegurar o status 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE parameters: responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/serviceHealthStatus description: Status do serviço checks: type: array items: type: object allOf: – #/definitions/checkData minimum: 1 description: Verificações para assegurar o status 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/queries/getMetadata: post: description: Default getMetadata query. Every service must handle this command and return metadata in the format requested. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: metadataFormat: type: string description: responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Default getMetadata query. Every service must handle this command and return metadata in the format requested. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: metadataFormat description: in: query type: string responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/queries/getDependencies: post: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – dependencies properties: dependencies: type: array items: type: object allOf: – #/definitions/dependency minimum: 1 description: List with this service dependencies 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – dependencies properties: dependencies: type: array items: type: object allOf: – #/definitions/dependency minimum: 1 description: List with this service dependencies 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/actions/insereMotorista: post: description: Cadastro de Motorista tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – nrCNPJFilial – dsNome – nrCnh – nrCpf properties: nrCNPJFilial: type: string description: Código identificador da empresa dsNome: type: string description: Nome do motorista nrCnh: type: string description: Número CNH do motorista nrCpf: type: string description: Número CPF do motorista nrRg: type: string description: Número RG do motorista cdUsuario: type: string description: Usuário correspodente ao motorista cdIdentDisp: type: integer format: int64 description: nrTelefone: type: string description: dsNomeUsuario: type: string description: Nome do usuário na plataforma dsSenhaUsuario: type: string description: Senha do usuário na plataforma email: type: string description: Email motorista responses: 200: description: Ok schema: type: object required: – ok – cdMotorista – dsErro properties: ok: type: boolean description: Bolean indicando se a operação teve sucesso cdMotorista: type: integer format: int64 description: dsErro: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/actions/alteraMotorista: post: description: Edição de Motorista tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – nrCNPJFilial – cdMotorista – dsNome – nrCnh – nrCpf properties: nrCNPJFilial: type: string description: Código identificador da empresa cdMotorista: type: integer format: int64 description: Código identificador dsNome: type: string description: Nome do motorista nrCnh: type: string description: Número CNH do motorista nrCpf: type: string description: Número CPF do motorista nrRg: type: string description: Número RG do motorista cdUsuario: type: string description: Usuário correspodente ao motorista cdIdentDisp: type: integer format: int64 description: Código identificação dispositivo nrTelefone: type: string description: Número telefone dsNomeUsuario: type: string description: Nome do usuário na plataforma dsSenhaUsuario: type: string description: Senha do usuário na plataforma email: type: string description: Email motorista responses: 200: description: Ok schema: type: object required: – ok – dsErro properties: ok: type: boolean description: Bolean indicando se a operação teve sucesso dsErro: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /motoristas/actions/deletaMotorista: post: description: Exclusão de Motorista tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – codigo properties: codigo: type: integer format: int64 description: Código identificador responses: 200: description: Ok schema: type: object required: – ok – dsErro properties: ok: type: boolean description: Bolean indicando se a operação teve sucesso dsErro: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericErrordefinitions: statusUsuarioSugeridoMotorista: description: type: string enum: – NOVO – SUGERIDO – DISPONIVEL_PARA_VINCULAR – VINCULADO_COM_ESTE_MOTORISTA – VINCULADO_COM_OUTRO_MOTORISTA serviceHealthStatus: description: Define o Status do serviço type: string enum: – UP – DOWN userNotificationKind: description: User notification kind. type: string enum: – Operational – Management – News userNotificationPriority: description: User notification priority. type: string enum: – Error – Alert – None eventEmailFormat: description: Format of the email type: string enum: – HTML – PLAIN_TEXT dashboardDesempenhoRec: description: Representa as informações sobre as rotas que o motorista desempenhou type: object properties: totalAtividades: type: integer format: int64 description: Total de atividades naoApontadas: type: integer format: int64 description: Atividades não apontadas naoApontadasAtrasadas: type: integer format: int64 description: Atividades não apontadas atrasadas naoRealizadas: type: integer format: int64 description: Atividades não realizadas naoRealizadasAtrasadas: type: integer format: int64 description: Atividades não realizadas atrasadas realizadas: type: integer format: int64 description: Atividades realizadas realizadasAtrasadas: type: integer format: int64 description: Atividades realizadas atrasadas relDesempenhoMotoristaRec: description: Representa as informações sobre as rotas que o motorista desempenhou type: object properties: cnpj: type: string description: Filial do motorista filial: type: string description: Filial do motorista apelido ou razão social motorista: type: string description: Nome do motorista placa: type: string description: Placa do veículo rota: type: integer format: int64 description: Código da rota dataInicio: type: string format: date-time description: Data do início da viagem dataExecucao: type: string format: date-time description: Data da execução da viagem dataTermino: type: string format: date-time description: Data do término da viagem quantidadeAtividade: type: integer format: int64 description: Quantidade total de atividades quantidadeRealizada: type: integer format: int64 description: Quantidade total de atividades realizadas desempenho: type: integer format: int64 description: Desempenho do motorista status: type: object allOf: – #/definitions/recInSitRoteiro description: Status roteiro recInSitRoteiro: description: Informações sobre o status/situação do Roteiro type: object required: – inSituacao – dsInSituacao properties: inSituacao: type: integer format: int64 description: Código dsInSituacao: type: string description: Descrição MCEMOTRec: description: Representa as informações do motorista type: object properties: nrCNPJFilial: type: string description: Filial do motorista cdMotorista: type: integer format: int64 description: Código do mototista dsNome: type: string description: Nome do motorista nrCnh: type: string description: CNH do motorista nrCpf: type: string description: CPF do motorista nrRg: type: string description: RG do motorista cdUsuario: type: string description: ID do usuário da plataforma dispositivo: type: object allOf: – #/definitions/recDispositivo description: Dispositivo correspondente usuarioPlataforma: type: string description: Nome do usuário da plataforma email: type: string description: Email motorista cdVersaoApp: type: string description: Número da versão do aplicativo recDispositivo: description: type: object required: – cdIdentDisp properties: cdIdentDisp: type: integer format: int64 description: nrTelefone: type: string description: usuarioSugeridoMotoristaRec: description: type: object required: – nome – idUsuario – status properties: nome: type: string description: Nome sugerido idUsuario: type: string description: Id do usuário na plataforma status: type: string allOf: – #/definitions/statusUsuarioSugeridoMotorista description: Status da sugestão checkData: description: Dados do healthcheck type: object required: – name – status properties: name: type: string description: Nome do healthcheck status: type: string allOf: – #/definitions/serviceHealthStatus description: Status do healthcheck notifyUserEventPayload: description: Represents a regular user event notification payload discriminator: _discriminator type: object required: – notificationKind – notificationPriority – notificationSubject – notificationContent – sourceDomain – sourceService – destinationUser – _discriminator properties: notificationClass: type: string description: Class of notification notificationOrigin: type: string description: Origin of notification. Free text. Optional. notificationKind: type: string allOf: – #/definitions/userNotificationKind description: Notification kind. notificationPriority: type: string allOf: – #/definitions/userNotificationPriority description: Notification priority. notificationSubject: type: string description: Notification subject. notificationContent: type: string description: Notification content. sourceDomain: type: string description: Domain that generates the notification. sourceService: type: string description: Service that generates the notification. destinationUser: type: string description: Username of the destination user. link: type: string description: Notification link _discriminator: type: string description: emailNotifyUserEventPayload: description: Represents an email notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – from properties: from: type: string description: Email sender address sendTo: type: array items: type: string description: Additional recipients to send the email to format: type: string allOf: – #/definitions/eventEmailFormat description: Email format pushNotifyUserEventPayload: description: Represents a push notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – applicationId properties: applicationId: type: string description: Apple/Google application id blobReference: description: Default blob reference type. Every service defines its own. type: object required: – targetObjectId properties: domainName: type: string description: The domain the blob belongs to. serviceName: type: string description: The service the blob belongs to. targetObjectId: type: string description: The basic id of the blob. targetCopyId: type: string description: The id of the blob copy. basicErrorPayload: description: Default error payload type. Every service defines its own. type: object properties: message: type: string description: The user-facing error message, if any. errorCode: type: string description: The program-accessible (and service-specific) error code. dependency: description: Represents a service dependency type: object required: – domain – service – version properties: domain: type: string description: Domain of the dependency service service: type: string description: Name of the dependency service type: string description: Version of the dependency service genericError: properties: message: type: string description: Messaging describing the error. reason: type: string description: A symbolic code identifying the category of the reason of the error. enum: – BAD_REQUEST – UNAUTHORIZED – PAYMENT_REQUIRED – FORBIDDEN – OBJECT_NOT_FOUND – REQUEST_TIMEOUT – GONE – UNPROCESSABLE – INTERNAL_ERROR – NOT_IMPLEMENTED – SERVICE_UNAVAILABLE – INSUFFICIENT_STORAGE