2.0info: 1.4.1 Painel de Gestão description: Painel de gestão para consolidar dados operacionais dos produtos Senior x-senior-domain: AGRO x-senior-domain-path: agro x-senior-service-path: management_dashboard contact: name: Senior X Platform url: https://dev.senior.com.br email: seniorx-dev@senior.com.brhost: api.senior.com.br /agro/management_dashboardsecurityDefinitions: bearerAuth: type: apiKey in: header name: Authorization – application/json – application/jsonparameters: clientId: name: client_id type: string in: header required: true description: Identificação da aplicação cadastrada no portal do desenvolvedor (api.xplatform.com.br)paths: /deleteDashboard: post: description: Exclui um dashboard visível pela abrangência do usuário x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – id properties: id: type: string description: Identificador do dashboard a ser excluído responses: 200: description: Ok schema: type: object required: – id properties: id: type: string description: Identificador do dashboard excluído default: description: Error response schema: #/definitions/genericError /registerDataSource: post: description: Registra ou atualiza a estrutura de um data source x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – sourceDomain – sourceService – dataSource – dataFields properties: sourceDomain: type: string description: Domínio de origem do produto Senior (ex: agro, erp) sourceService: type: string description: Serviço de origem do produto Senior (ex: anomaly_classification) dataSource: type: string description: Identificador único do data source (ex: invoice, ticket) description: type: string description: Descrição legível do data source para exibição na interface dataFields: type: array items: #/definitions/dataSourceFieldInput description: Lista de campos que compõem a estrutura do data source responses: 200: description: Ok schema: type: object required: – id – created properties: id: type: string description: Identificador único do data source criado ou atualizado created: type: boolean description: Indica se o data source foi criado (true) ou atualizado (false) default: description: Error response schema: #/definitions/genericError /retrieveDashboard: post: description: Consulta um dashboard visível pela abrangência do usuário x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – id properties: id: type: string description: Identificador do dashboard responses: 200: description: Ok schema: type: object required: – dashboard properties: dashboard: #/definitions/dashboardData default: description: Error response schema: #/definitions/genericError get: description: Consulta um dashboard visível pela abrangência do usuário x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – id properties: id: type: string description: Identificador do dashboard responses: 200: description: Ok schema: type: object required: – dashboard properties: dashboard: #/definitions/dashboardData default: description: Error response schema: #/definitions/genericError /updateDashboard: post: description: Altera um dashboard visível pela abrangência. Empresas e filiais fora da abrangência já vinculadas são preservadas x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – id – dashboard properties: id: type: string description: Identificador do dashboard a ser alterado dashboard: #/definitions/dashboardData responses: 200: description: Ok schema: type: object required: – dashboard properties: dashboard: #/definitions/dashboardData default: description: Error response schema: #/definitions/genericError /listDataSources: post: description: Lista data sources disponíveis com seus campos para configuração de widgets x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: sourceDomain: type: string description: Filtro opcional por domínio de origem sourceService: type: string description: Filtro opcional por serviço de origem responses: 200: description: Ok schema: type: object required: – dataSources properties: dataSources: #/definitions/dataSourceInfo default: description: Error response schema: #/definitions/genericError get: description: Lista data sources disponíveis com seus campos para configuração de widgets x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: sourceDomain: type: string description: Filtro opcional por domínio de origem sourceService: type: string description: Filtro opcional por serviço de origem responses: 200: description: Ok schema: type: object required: – dataSources properties: dataSources: #/definitions/dataSourceInfo default: description: Error response schema: #/definitions/genericError /listDashboard: post: description: Lista os dashboards visíveis pela abrangência do usuário, paginados e com filtros opcionais x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: page: type: integer description: Número da página (começa em 0) size: type: integer description: Quantidade de dashboards por página name: type: string description: Trecho do nome do dashboard (busca sem diferenciar maiúsculas) status: #/definitions/dashboardStatus responses: 200: description: Ok schema: type: object required: – dashboards – totalRecords properties: dashboards: #/definitions/dashboardData totalRecords: type: integer description: Total de dashboards visíveis pela abrangência default: description: Error response schema: #/definitions/genericError get: description: Lista os dashboards visíveis pela abrangência do usuário, paginados e com filtros opcionais x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: page: type: integer description: Número da página (começa em 0) size: type: integer description: Quantidade de dashboards por página name: type: string description: Trecho do nome do dashboard (busca sem diferenciar maiúsculas) status: #/definitions/dashboardStatus responses: 200: description: Ok schema: type: object required: – dashboards – totalRecords properties: dashboards: #/definitions/dashboardData totalRecords: type: integer description: Total de dashboards visíveis pela abrangência default: description: Error response schema: #/definitions/genericError /getDashboardFilters: post: description: Deriva os filtros dinâmicos (campos DIMENSION) utilizados pelos widgets de um dashboard x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – dashboardId properties: dashboardId: type: string description: Identificador do dashboard cujos widgets serão analisados responses: 200: description: Ok schema: type: object properties: filters: #/definitions/dashboardFilterInfo default: description: Error response schema: #/definitions/genericError get: description: Deriva os filtros dinâmicos (campos DIMENSION) utilizados pelos widgets de um dashboard x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – dashboardId properties: dashboardId: type: string description: Identificador do dashboard cujos widgets serão analisados responses: 200: description: Ok schema: type: object properties: filters: #/definitions/dashboardFilterInfo default: description: Error response schema: #/definitions/genericError /duplicateDashboard: post: description: Duplica um dashboard existente com todos os seus widgets x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – sourceId properties: sourceId: type: string description: Identificador do dashboard de origem a ser duplicado newName: type: string description: Nome do novo dashboard (opcional, padrão: nome original + cópia) responses: 200: description: Ok schema: type: object required: – id properties: id: type: string description: Identificador do novo dashboard criado default: description: Error response schema: #/definitions/genericError /createDashboard: post: description: Cria um dashboard com empresas, filiais e widgets. Todas as empresas e filiais informadas devem estar liberadas pela abrangência do usuário x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – dashboard properties: dashboard: #/definitions/dashboardData responses: 200: description: Ok schema: type: object required: – dashboard properties: dashboard: #/definitions/dashboardData default: description: Error response schema: #/definitions/genericError /queryData: post: description: Consulta dados agregados para alimentar widgets do dashboard x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – dataSource – widgetType properties: dataSource: type: string description: Identificador do data source a ser consultado widgetType: #/definitions/widgetType chartType: #/definitions/chartType dimensions: type: array items: type: string description: Lista de campos de dimensão para agrupamento (GROUP BY) measures: type: array items: #/definitions/measureInput description: Lista de campos de medida com tipo de agregação filters: type: array items: #/definitions/filterInput description: Lista de filtros opcionais para refinar a consulta orderByField: type: string description: Nome do campo para ordenação dos resultados orderByDirection: type: string description: Direção da ordenação (asc ou desc) limit: type: integer description: Limite máximo de registros retornados. Para TABLE é o tamanho da página dashboardId: type: string description: Identificador do dashboard. Quando informado, a consulta é filtrada pela empresa e filial do dashboard; sem ele, retorna os registros de todas as empresas companyIds: type: array items: type: string description: Identificadores das empresas do escopo da consulta (preview do editor). Ignorado quando dashboardId é informado branchIds: type: array items: type: string description: Identificadores das filiais do escopo da consulta (preview do editor). Vazio não filtra por filial page: type: integer description: Número da página a retornar (começa em 0). Aplicado somente a widgets do tipo TABLE, com tamanho de página igual ao limit responses: 200: description: Ok schema: type: object required: – schemaDimensions – schemaMeasures – data – totalRecords properties: schemaDimensions: #/definitions/schemaField schemaMeasures: #/definitions/schemaField data: #/definitions/queryDataRow totalRecords: type: integer description: Total de registros retornados default: description: Error response schema: #/definitions/genericError get: description: Consulta dados agregados para alimentar widgets do dashboard x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – dataSource – widgetType properties: dataSource: type: string description: Identificador do data source a ser consultado widgetType: #/definitions/widgetType chartType: #/definitions/chartType dimensions: type: array items: type: string description: Lista de campos de dimensão para agrupamento (GROUP BY) measures: type: array items: #/definitions/measureInput description: Lista de campos de medida com tipo de agregação filters: type: array items: #/definitions/filterInput description: Lista de filtros opcionais para refinar a consulta orderByField: type: string description: Nome do campo para ordenação dos resultados orderByDirection: type: string description: Direção da ordenação (asc ou desc) limit: type: integer description: Limite máximo de registros retornados. Para TABLE é o tamanho da página dashboardId: type: string description: Identificador do dashboard. Quando informado, a consulta é filtrada pela empresa e filial do dashboard; sem ele, retorna os registros de todas as empresas companyIds: type: array items: type: string description: Identificadores das empresas do escopo da consulta (preview do editor). Ignorado quando dashboardId é informado branchIds: type: array items: type: string description: Identificadores das filiais do escopo da consulta (preview do editor). Vazio não filtra por filial page: type: integer description: Número da página a retornar (começa em 0). Aplicado somente a widgets do tipo TABLE, com tamanho de página igual ao limit responses: 200: description: Ok schema: type: object required: – schemaDimensions – schemaMeasures – data – totalRecords properties: schemaDimensions: #/definitions/schemaField schemaMeasures: #/definitions/schemaField data: #/definitions/queryDataRow totalRecords: type: integer description: Total de registros retornados default: description: Error response schema: #/definitions/genericError /pushRecords: post: description: Recebe registros individuais de dados via push de produtos Senior x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – sourceDomain – sourceService – dataSource – records properties: sourceDomain: type: string description: Domínio de origem do produto Senior sourceService: type: string description: Serviço de origem do produto Senior dataSource: type: string description: Identificador do data source previamente registrado records: type: array items: #/definitions/recordInput description: Lista de registros de dados a serem persistidos responses: 200: description: Ok schema: type: object required: – insertedCount properties: insertedCount: type: integer description: Quantidade de registros inseridos com sucesso default: description: Error response schema: #/definitions/genericErrordefinitions: dashboardStatus: type: string enum: – DRAFT – PUBLISHED widgetType: type: string enum: – CHART – KPI – TABLE chartType: type: string enum: – LINE – BAR – PIE – DONUT – AREA – TOP – BOTTOM dataFieldType: type: string enum: – STRING – INTEGER – DECIMAL – DATE – DATE_TIME – BOOLEAN fieldRole: type: string enum: – DIMENSION – MEASURE fieldFormat: type: string enum: – CURRENCY – PERCENT – NUMBER – DATE – KG – DOCUMENT dataSourceFieldInput: type: object required: – name – type – label – role – required properties: name: type: string description: Nome técnico do campo (ex: date, value, status) type: #/definitions/dataFieldType label: type: string description: Label legível para exibição na interface do usuário role: #/definitions/fieldRole required: type: boolean description: Indica se o campo é obrigatório nos registros enviados via push format: #/definitions/fieldFormat context: type: string description: Contexto do campo para o assistente de IA: o que o campo representa e como usá-lo em dashboards recordInput: type: object required: – data properties: data: type: string description: Dados do registro serializado como JSON conforme schema do data source company: type: string description: Identificador da empresa (entidade e070emp) à qual o registro pertence. Registro sem empresa e sem filial aparece sempre; com filtro de empresa, o registro aparece mesmo sem filial branch: type: string description: Identificador da filial (entidade e070fil) à qual o registro pertence. Deve pertencer à empresa informada measureInput: type: object required: – field – aggregation properties: field: type: string description: Nome do campo de medida a ser agregado aggregation: type: string description: Tipo de agregação a aplicar (sum, avg, min, max, count) filterInput: type: object required: – field – operator – value properties: dataSourceId: type: string description: Data source do campo filtrado. Quando informado, o filtro só se aplica aos widgets desse data source; quando vazio, aplica-se a todos os widgets que têm um campo com esse nome field: type: string description: Nome do campo a ser filtrado operator: type: string description: Operador de comparação (eq, neq, gt, gte, lt, lte, between, in) value: type: string description: Valor do filtro (para between usar vírgula, para in usar vírgula) schemaField: type: object required: – name – type – label properties: name: type: string description: Nome técnico do campo type: #/definitions/dataFieldType label: type: string description: Label legível para exibição aggregation: type: string description: Tipo de agregação aplicada (apenas para medidas) format: #/definitions/fieldFormat queryDataRow: type: object required: – data properties: data: type: string description: Dados da linha serializado como JSON dataSourceInfo: type: object required: – id – sourceDomain – sourceService – dataSource – dataFields properties: id: type: string description: Identificador único do data source sourceDomain: type: string description: Domínio de origem sourceService: type: string description: Serviço de origem dataSource: type: string description: Identificador do data source description: type: string description: Descrição legível dataFields: type: array items: #/definitions/dataSourceFieldInfo description: Lista de campos do data source dataSourceFieldInfo: type: object required: – name – type – label – role – required properties: name: type: string description: Nome técnico do campo type: #/definitions/dataFieldType label: type: string description: Label legível para exibição role: #/definitions/fieldRole required: type: boolean description: Indica se o campo é obrigatório format: #/definitions/fieldFormat context: type: string description: Contexto do campo para o assistente de IA: o que o campo representa e como usá-lo em dashboards dashboardData: type: object required: – name – status properties: id: type: string description: Identificador do dashboard. Ausente na criação name: type: string description: Nome do dashboard status: #/definitions/dashboardStatus companies: type: array items: #/definitions/dashboardCompanyRef description: Empresas do escopo. Pelo menos uma deve estar liberada pela abrangência branches: type: array items: #/definitions/dashboardBranchRef description: Filiais do escopo. Vazio inclui todas as filiais das empresas widgets: type: array items: #/definitions/dashboardWidgetData description: Widgets que compõem o dashboard createdDate: type: string description: Data de criação do dashboard em ISO 8601 (UTC). Preenchida pelo servidor; ignorada na entrada dashboardCompanyRef: type: object required: – id properties: id: type: string description: Identificador da empresa (entidade e070emp) codEmp: type: integer description: Código da empresa nomEmp: type: string description: Nome da empresa sigEmp: type: string description: Sigla da empresa dashboardBranchRef: type: object required: – id properties: id: type: string description: Identificador da filial (entidade e070fil) codFil: type: integer description: Código da filial nomFil: type: string description: Nome da filial sigFil: type: string description: Sigla da filial dashboardWidgetData: type: object required: – type – positionX – positionY – width – height – config properties: id: type: string description: Identificador do widget. Ausente em widgets novos type: #/definitions/widgetType positionX: type: integer description: Posição horizontal no grid (coluna) positionY: type: integer description: Posição vertical no grid (linha) width: type: integer description: Largura do widget no grid (número de colunas) height: type: integer description: Altura do widget no grid (número de linhas) config: type: string description: Configuração interna do widget serializada como JSON dashboardFilterInfo: type: object required: – field – label – type properties: dataSourceId: type: string description: Data source ao qual o campo pertence. Um filtro é sempre de um único data source field: type: string description: Nome técnico do campo a ser filtrado label: type: string description: Label legível para exibição na interface type: #/definitions/dataFieldType format: #/definitions/fieldFormat availableValues: type: array items: type: string description: Valores distintos disponíveis na datasource para seleção 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