2.0info: 2.12.0 Marketing Intelligence description: Serviço responsável pelo Marketing Intelligence x-senior-domain: CRM x-senior-domain-path: crm x-senior-service-path: marketing_intelligence 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/crmsecurityDefinitions: APIKeyHeader: type: apiKey in: header name: Authorizationsecurity: – APIKeyHeader: [] – application/json – application/jsonpaths: /marketing_intelligence/queries/listCompanies: post: description: Query responsável pela consulta no Marketing Intelligence tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – page – filters properties: page: type: integer format: int64 description: Número da página que se quer verificar filters: type: array items: type: object allOf: – #/definitions/filterRecord minimum: 1 description: Múltiplas opções de filtros da tela, utilizados para filtrar informações do dataset responses: 200: description: Ok schema: type: object required: – companies – listInformation properties: companies: type: array items: type: object allOf: – #/definitions/companyRecord minimum: 1 description: Dados empresas listInformation: type: object allOf: – #/definitions/listInformationRecord description: Índices de paginação 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/getCompany: post: description: Query responsável por retornar todos os dados de um CNPJ. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – cnpj properties: cnpj: type: string description: CNPJ a ser procurado. responses: 200: description: Ok schema: type: object allOf: – #/definitions/companyRecord 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Query responsável por retornar todos os dados de um CNPJ. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: cnpj description: CNPJ a ser procurado. in: query required: true type: string responses: 200: description: Ok schema: type: object allOf: – #/definitions/companyRecord 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/cnaeMainCache: post: description: Retorna o cache dos CNAEs principais tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: filter: type: object allOf: – #/definitions/filterCacheDatasetRecord description: Filtros utilizados no cache responses: 200: description: Ok schema: type: object required: – mainCnaes properties: mainCnaes: type: array items: type: object allOf: – #/definitions/cacheRecord minimum: 1 description: Cache dos CNAEs principais com os filtros aplicados 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/legalNatureCache: post: description: Retorna o cache das Naturezas Jurídica tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: filter: type: object allOf: – #/definitions/filterCacheDatasetRecord description: Filtros utilizados no cache responses: 200: description: Ok schema: type: object required: – legalNatures properties: legalNatures: type: array items: type: object allOf: – #/definitions/cacheRecord minimum: 1 description: Cache das Naturezas Jurídicas com os filtros aplicados 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/segmentCnaeCache: post: description: Retorna o cache dos Segmentos dos CNAEs tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: filter: type: object allOf: – #/definitions/filterCacheDatasetRecord description: Filtros utilizados no cache responses: 200: description: Ok schema: type: object required: – segmentCnaes properties: segmentCnaes: type: array items: type: object allOf: – #/definitions/cacheRecord minimum: 1 description: Cache dos Segmentos de CNAEs com os filtros aplicados 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/subsegmentCnaeCache: post: description: Retorna o cache dos Sub-segmentos dos CNAEs tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: filter: type: object allOf: – #/definitions/filterCacheDatasetRecord description: Filtros utilizados no cache responses: 200: description: Ok schema: type: object required: – subsegmentCnaes properties: subsegmentCnaes: type: array items: type: object allOf: – #/definitions/cacheRecord minimum: 1 description: Cache dos Sub-segmentos de CNAEs com os filtros aplicados 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/classLegalNatureCache: post: description: Retorna o cache das Classes das Naturezas Jurídicas tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: filter: type: object allOf: – #/definitions/filterCacheDatasetRecord description: Filtros utilizados no cache responses: 200: description: Ok schema: type: object required: – classLegalNatures properties: classLegalNatures: type: array items: type: object allOf: – #/definitions/cacheRecord minimum: 1 description: Cache das Classes das Naturezas Jurídicas com os filtros aplicados 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/detailsMarketingData: post: description: Consulta os datasets crm-intelligence-import e crm-intelligence-secondary-cnae tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – id properties: id: type: string description: CNPJ selecionado responses: 200: description: Ok schema: type: object required: – rows properties: rows: type: array items: type: object allOf: – #/definitions/rowRecord minimum: 1 description: Resultado 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Consulta os datasets crm-intelligence-import e crm-intelligence-secondary-cnae tags: – Queries x-senior-visibility: PRIVATE parameters: – name: id description: CNPJ selecionado in: query required: true type: string responses: 200: description: Ok schema: type: object required: – rows properties: rows: type: array items: type: object allOf: – #/definitions/rowRecord minimum: 1 description: Resultado 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/getMinimumCompany: post: description: Retorna os dados resumidos de uma conta tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – cnpj properties: cnpj: type: string description: CNPJ responses: 200: description: Ok schema: type: object required: – company properties: company: type: object allOf: – #/definitions/companyRecord description: Empresa 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Retorna os dados resumidos de uma conta tags: – Queries x-senior-visibility: PRIVATE parameters: – name: cnpj description: CNPJ in: query required: true type: string responses: 200: description: Ok schema: type: object required: – company properties: company: type: object allOf: – #/definitions/companyRecord description: Empresa 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/healthcheck: post: description: Query para o CRM verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – status properties: status: type: string allOf: – #/definitions/upDownEnum description: Status geral do serviço 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Query para o CRM verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – status properties: status: type: string allOf: – #/definitions/upDownEnum description: Status geral do serviço 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/getSmartApproach: post: description: Gerar abordagem inteligente tags: – Queries x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – cnpj – productName properties: cnpj: type: string description: CNPJ productName: type: string description: Nome do Produto responses: 200: description: Ok schema: type: object required: – generatedText properties: generatedText: type: string description: Texto gerado 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Gerar abordagem inteligente tags: – Queries x-senior-visibility: PUBLIC parameters: – name: cnpj description: CNPJ in: query required: true type: string – name: productName description: Nome do Produto in: query required: true type: string responses: 200: description: Ok schema: type: object required: – generatedText properties: generatedText: type: string description: Texto gerado 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/queries/getAboutSmart: post: description: Gerar sobre inteligente tags: – Queries x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – cnpj properties: cnpj: type: string description: CNPJ responses: 200: description: Ok schema: type: object required: – generatedText properties: generatedText: type: string description: Texto gerado 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Gerar sobre inteligente tags: – Queries x-senior-visibility: PUBLIC parameters: – name: cnpj description: CNPJ in: query required: true type: string responses: 200: description: Ok schema: type: object required: – generatedText properties: generatedText: type: string description: Texto gerado 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/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 /marketing_intelligence/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 /marketing_intelligence/actions/exportMarketingIntelligence: post: description: Action responsável pela exportação no Marketing Intelligence tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – id properties: id: type: array items: type: string minimum: 1 description: Os CNPJs selecionados em tela para serem exportados responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/actions/logMarketingIntelligenceBasic: post: description: Salvar logs básicos no banco de dados tags: – Actions x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/actions/logMarketingIntelligenceAdvanced: post: description: Salvar logs avançados no banco de dados tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – auth – consultaTela – consultaMapa – export properties: auth: type: boolean description: Referente se o usuario esta autenticado ou nao consultaTela: type: boolean description: Referente se a consulta foi via tela consultaMapa: type: boolean description: Referente se a consulta foi via mapa export: type: boolean description: Referente se o usuario exportou dados para o CRM responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/actions/logAccess: post: description: Salva log de acesso à tela do Marketing Intelligence tags: – Actions x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/actions/logListConsult: post: description: Salva log de consulta na tela tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – totalRecords – filter properties: totalRecords: type: integer format: int64 description: Total de registros filter: type: string description: Filtros responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/actions/logMapConsult: post: description: Salva log de consulta no mapa tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – totalRecords – filter properties: totalRecords: type: integer format: int64 description: Total de registros filter: type: string description: Filtros responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/actions/logExportAccount: post: description: Salva log de exportação tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – totalRecords properties: totalRecords: type: integer format: int64 description: Total de registros responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/actions/logDetailCompany: post: description: Salva log de detalhamento de registro tags: – Actions x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/actions/logExportDetailCompany: post: description: Salva log de exportação de registro em CSV tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – totalRecords properties: totalRecords: type: integer format: int64 description: Total de registros responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /marketing_intelligence/actions/clearCacheOfDataset: post: description: Limpa o cache de um Dataset tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: datasets: type: array items: type: string allOf: – #/definitions/datasetNameEnum description: Dataset que serão limpos os caches responses: 200: description: Ok schema: type: object required: – success properties: success: type: boolean description: Referente ao sucesso da operação 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericErrordefinitions: upDownEnum: description: Up ou down type: string enum: – UP – DOWN datasetNameEnum: description: Valores de campos possíveis type: string enum: – MAIN_CNAE – LEGAL_NATURE – SEGMENT_CNAE – SUBSEGMENT_CNAE – CLASS_LEGAL_NATURE relationalOperatorsEnum: description: Operadores relacionais type: string enum: – EQUAL – NOT_EQUAL – GREATER_THAN – GREATER_THAN_OR_EQUAL – LESS_THAN – LESS_THAN_OR_EQUAL – EMPTY – NOT_EMPTY – CONTAINS – DOES_NOT_CONTAINS – STARTS_WITH – ENDS_WITH – IN – NOT_IN – BETWEEN logicalOperatorEnum: description: Operadores lógicos type: string enum: – AND – OR 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 filterRecord: description: Record de filtros type: object required: – key – logicalOperator – relationalOperator – value properties: key: type: string description: Chave identificadora do filtro utilizado logicalOperator: type: string allOf: – #/definitions/logicalOperatorEnum description: Operador lógico utilizado entre os operadores condicionais relationalOperator: type: string allOf: – #/definitions/relationalOperatorsEnum description: Operador utilizado na consulta da chave value: type: array items: type: string minimum: 1 description: Os possíveis múltiplos valores a serem consultados rowRecord: description: Record de rows type: object required: – columns properties: columns: type: array items: type: string minimum: 1 description: Colunas listInformationRecord: description: Índices de paginação type: object required: – totalElements – totalPages – currentPage properties: totalElements: type: integer format: int64 description: Número de elementos totalPages: type: integer format: int64 description: Número de páginas currentPage: type: integer format: int64 description: Página atual checkDataRecord: description: Dados do healthcheck type: object required: – name – status properties: name: type: string description: Nome do healthcheck status: type: string allOf: – #/definitions/upDownEnum description: Status do healthcheck companyRecord: description: Objeto referente ao objeto com os dados da consulta no Dataset type: object required: – cnpj – name – fantasyName – companySize – annualIncome – birthDate – address – contact – cnae – mei – partners – export properties: cnpj: type: string description: CNPJ name: type: string description: Razão social fantasyName: type: string description: Nome fantasia companySize: type: string description: Tamanho da Empresa annualIncome: type: string description: Capital Social birthDate: type: string format: date description: Inicio da operação address: type: object allOf: – #/definitions/addressRecord description: Endereço contact: type: object allOf: – #/definitions/contactRecord description: Contato cnae: type: object allOf: – #/definitions/cnaeRecord description: Atividade mei: type: object allOf: – #/definitions/meiRecord description: Dados do MEI partners: type: array items: type: object allOf: – #/definitions/partnerRecord minimum: 1 description: Sócios export: type: integer format: int64 description: 0-Não exportado 1- Existente no MK 2-Exportado minimum: 0 maximum: 2 addressRecord: description: Objeto com todos os dados do endereço type: object required: – address – addressType – number – complement – cepCode – latitude – longitude – city properties: address: type: string description: Endereço addressType: type: string description: Tipo de endereço number: type: string description: Número complement: type: string description: Complemento cepCode: type: string description: CEP latitude: type: string description: Latitude longitude: type: string description: Longitude city: type: object allOf: – #/definitions/cityRecord description: Cidade cityRecord: description: Cidade type: object required: – name – district – state properties: name: type: string description: Nome district: type: string description: Bairro state: type: object allOf: – #/definitions/stateRecord description: Estado stateRecord: description: Estado type: object required: – stateShortName – country properties: stateShortName: type: string maxLength: 2 description: Estado/UF country: type: object allOf: – #/definitions/countryRecord description: Pais countryRecord: description: Pais type: object required: – id – name properties: id: type: integer format: int64 description: Código único de identificação name: type: string description: Name contactRecord: description: Objeto com todos os dados do contato type: object required: – phoneNumberOne – phoneNumberTwo – email properties: phoneNumberOne: type: string description: Telefone 1 phoneNumberTwo: type: string description: Telefone 2 email: type: string description: Email cnaeRecord: description: Objeto com todos os dados da atividade. type: object required: – main – secondaries properties: main: type: object allOf: – #/definitions/activityRecord description: CNAE principal secondaries: type: array items: type: object allOf: – #/definitions/activityRecord minimum: 1 description: CNAE secundário activityRecord: description: Objeto referente ao CNAE principal. type: object required: – code – description properties: code: type: string description: Código description: type: string description: Descrição meiRecord: description: Dados de MEI type: object required: – active – registrationDate – deletionDate properties: active: type: boolean description: Informa se ainda é mei registrationDate: type: string format: date description: Data de criação como MEI deletionDate: type: string format: date description: Data de deleção como MEI partnerRecord: description: Sócio da empresa type: object required: – cnpjBasic – name – document – qualification – country properties: cnpjBasic: type: string description: Oito primeiros digits do CNPJ da empresa desse sócio name: type: string description: Nome document: type: string description: Documento desse sócio CPF/CNPJ qualification: type: string description: Qualificação Representativa country: type: object allOf: – #/definitions/countryRecord description: Pais cacheRecord: description: Record referente ao retorno dos cache type: object required: – code – description properties: code: type: string description: Código description: type: string description: Descrição group: type: string description: Grupo filterCacheDatasetRecord: description: Filtros utilizados para os caches dos datasets type: object properties: description: type: string description: group: type: string description: 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